You need to sign in to do that
Don't have an account?
miha198206
Can't apply css styles when renderAs="PDF"
I try to create the page from here: http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_page.htm
I've made a page:
<apex:page renderAs="pdf"> <style> body { font-family: Arial Unicode MS; font-size:72px;} </style> <h1>Congratulations</h1> <p>This is your new PDF</p> </apex:page>
But styles was not applied. How can I use css in PDF? Why does this code sample not work for me?
Thanks a lot.
Mikhail
Put your style tag within the head tag
-Suresh
All Answers
Put your style tag within the head tag
-Suresh
Thanks a lot.
I've try it with head tag before. But now I've noticed that sometimes I should click ctrl+F5 to refresh changes in generated PDF file.
Thanks Suresh that solved my problem too!
Starting from API version 27 do NOT use a <html> tag as it will be included by SF.
I found this issue when moving a well CSS formatted PDF page from the sandbox to the live system, and the formatting was gone in the live system due to the update in the API version.