You need to sign in to do that
Don't have an account?

Visualforce renderAs="pdf" with Bootstrap
I am trying to create a PDF version of an existing visualforce page using Bootstrap.
The visualforce page looks great until I add the renderAs="pdf" attribute to the page, which causes me to receive the following error:
"PDF generation failed. Check the page markup is valid."
When I comment out the following line of code, the pdf generates(without styling obviously)
Has anyone come across this issue before?
The visualforce page looks great until I add the renderAs="pdf" attribute to the page, which causes me to receive the following error:
"PDF generation failed. Check the page markup is valid."
When I comment out the following line of code, the pdf generates(without styling obviously)
<apex:stylesheet value="{!URLFOR($Resource.bootstrap, 'css/bootstrap.min.css')}" />
Has anyone come across this issue before?
I have tried this before, However, I won't get the style right when you tried to get resource from static resource. You should get the css file from an direct link.
The codes above works for me.
Le
I tried changing to a link reference. My styling still works in the regular visualforce page, and I can now renderAs pdf, but the pdf doesn't have the correct styling. Any thoughts?
1. Add https://netdna.bootstrapcdn.com to your remote site setting.
2. Copy whole bootstrap css file in within style tags.
3. Replace ../ with https://netdna.bootstrapcdn.com/bootstrap/3.1.1/
4. Do the style like below example:
Le
I tried as you explained, but now I am back to the "PDF generation failed. Check the page markup is valid." error.
In my case, It's working fine when I copy a whole bootstrap file into style tag.
Le
I ended up downloading a customized bootstrap file where I removed many of the features/components that I don't need on the PDF. It's now working great using the file as a static resource.
Hi
Would it be possible for you to share your css? I download a custom bootstrap (I left gridsystem and tables), and copy and paste the minimize version directly into the page, however when I try to render the page I get the error:
PDF generation failed. Check the page markup is valid.
I also add it in a static resource, but I got the same error
https://success.salesforce.com/ideaView?id=0873A000000U3GIQA0