You need to sign in to do that
Don't have an account?
ryanhca
Making Pretty VisualForce PDFs
VisualForce pages rendered as PDF never retain the font styling and other formating present in the HTML. What have you done to make the output more like the HTML output?
This thread has a post on the supported fonts. There are not many. http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=8601&query.id=474456#M8601
I've also found that importing a external style sheet works a lot better than inline styles for PDF generation.
All Answers
My VF page is 100% HTML right now, with no VF tags... I wanted to make sure I could create a nice looking PDF with static HTML first.
It doesn't seem to recognize CSS style sheets. If I include inline styles, it seems to recognize some. For instance, if I put:
<p style="font-family:Verdana;font-size:10px">Text here</p>
... it will recognize the smaller font size, but not the font face -- it'll render it in Times New Roman.
Table styles are completely ignored.
This thread has a post on the supported fonts. There are not many. http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=8601&query.id=474456#M8601
I've also found that importing a external style sheet works a lot better than inline styles for PDF generation.