+ Start a Discussion

Converting a VisualForce Page to a image

Is it Possible to Convert a Visualforce Page as a Image.

Cory CowgillCory Cowgill

You can convert a Visualforce Page to a PDF, Word, or Excel document using the "RenderAs" Attribute on <apex:page> tag.


You cannot render it as an image to my knowledge.




renderAs String The name of any supported content converter. Currently pdf is the only supported content converter. Setting this attribute to pdf renders the page as a pdf. Rendering a Visualforce page as a PDF is intended for pages that are designed and optimized for print. Standard components which are not easily formatted for print or contain form elements like inputs, buttons, any component that requires JavaScript to be formatted, should not be used. This includes but is not limited to, any component that requires a form element. Verify the format of your rendered page before deploying it. If the PDF fails to display all the characters, adjust the fonts in your CSS to use a font that supports your needs. For example, <apex:page renderas="pdf"> <style> body { font-family: Arial Unicode MS; } </style> Note that the pageBlock and sectionHeader components do not suppor double-byte fonts when rendered as a PDF.   13.0 global

Hi Cory. is there a way I can render as an image. coz when i render as pdf my fonts are lost and looks like VF to pdf only supports 4 fonts. 
is there a work around you know or can suggest. 
Highly appreciate your help.