I am generating PDF files using a Visualforce page with the renderAs="pdf"
attribute. Is there any chance that I could embed vector graphics in the rendered PDF file? I tried using SVG and EPS files via <apex:image>
tags, as well as embedding svg code directly into the site, but no luck.
2 Answers
I have accomplished embedding graphics in a PDF by using Heroku to return the image to the VF controller. We needed charts generated according to datasets so we passed the data to Heroku, used a java charting application and passed the image back to the controller.
-
1Thanks, but embedding rasterized (pixel) images is not the problem, my question is only about vector graphics. Commented Feb 25, 2014 at 18:34
Highly unlikely. Remember that with SalesForce, you're basically taking an HTML page and then rendering it as a PDF. So, if it won't render first as VisualForce page (HTML), then its unlikely that you'll be able to render it as a PDF like you'd be able to with a dedicated RIP such as Acrobat Exchange.
As an afterthought... If you have your images in a vector based web plug-in format like Adobe flash, then you 'might' be able to get them to render. I've never attempted doing anything like that.
-
As I said, I already tried SVG which is the de-facto standard for vector graphics on the web. I cannot imagine why Flash should work. Thanks for your effort! Commented Feb 25, 2014 at 18:33
-
Actually, according to my recollection, until Flash came along, there was no support for rendering vector graphics content on web pages. That's going back to the mid/late 90's. Commented Feb 25, 2014 at 18:38