+ Start a Discussion
Matthew CavalierMatthew Cavalier 

Using slds in visualforce when rendering as a PDF

Does anyone know of any way to use slds in visual force when rendering the page as a pdf?
It keeps the formatting but the sytle is not applied.

Any Ideas?
Best Answer chosen by Matthew Cavalier
GulshanRajGulshanRaj
I am really sorry to say rederas="pdf" doesn't support any extenal css. You have to use inline css to render VF page as pdf.

Regards
Gulshan Raj

All Answers

GulshanRajGulshanRaj
I am really sorry to say rederas="pdf" doesn't support any extenal css. You have to use inline css to render VF page as pdf.

Regards
Gulshan Raj
This was selected as the best answer
GulshanRajGulshanRaj
Hi @matthew Cavalier,

Did you find any solution? As per my understanding we cannot add external css for page as pdf.

Thanks
Gulshan Raj
Matthew CavalierMatthew Cavalier
You are correct. After digging around I found that the only way to add css is to either have it as internal css or inline css.
GulshanRajGulshanRaj
Yes, this is what I researched when worked on PDF few months back. 

If my suggestion helps you, then can you please mark this question as solved and mentioned my comments as best answer so that it will help others in future to choose correct answer.


Thanks
Gulshan Raj
Matthew CavalierMatthew Cavalier
I do want to add that it looks like Salesforce is adding advanced pdf rendering in their Summer '17 release, though only in a pilot program, which "renders Visualforce pages as PDF files with broader support for modern HTML standards, such as CSS3, JavaScript, and HTML5. This change applies to both Lightning Experience and Salesforce Classic".