You need to sign in to do that
Don't have an account?
Visualforce RenderAs PDF not supporting SLDS CSS
Hi All,
I have a VF page built on Lightning Design system (LDS) framework. When I add the renderAs="PDF" attribute, pdf does not show the content with LDS CSS/Style.
Reference Link: https://github.com/salesforce-ux/design-system/issues/341
Note1: apex:page tag has all the usual attributes which is required for pdf (showHeader="false" sidebar="false" standardStylesheets="false" docType="html-5.0" applyHtmlTag="false" applyBodyTag="false")
Note2: Salesforce supports external stylesheet. That is, CSS file stored in Static resource. URL for example:https://developer.salesforce.com/page/Creating_Professional_PDF_Documents_with_CSS_and_Visualforce
I also copied the whole css content from the LDS CSS file (Path: 'assets/styles/salesforce-lightning-design-system-vf.min.css') and applied as inline CSS in VF page. But still, there is no luck.
My styleSheet is referred in VF page as below
apex:stylesheet value="{!URLFOR($Resource.SLDS221, 'assets/styles/salesforce-lightning-design-system-vf.min.css')}"
Page works absolutely fine if it is not rendered as PDF.
Also questioned in Stack Exchange: https://salesforce.stackexchange.com/questions/178572/visualforce-renderas-pdf-not-supporting-slds-css
Any suggestions guys??
Thanks,
Syed
I have a VF page built on Lightning Design system (LDS) framework. When I add the renderAs="PDF" attribute, pdf does not show the content with LDS CSS/Style.
Reference Link: https://github.com/salesforce-ux/design-system/issues/341
Note1: apex:page tag has all the usual attributes which is required for pdf (showHeader="false" sidebar="false" standardStylesheets="false" docType="html-5.0" applyHtmlTag="false" applyBodyTag="false")
Note2: Salesforce supports external stylesheet. That is, CSS file stored in Static resource. URL for example:https://developer.salesforce.com/page/Creating_Professional_PDF_Documents_with_CSS_and_Visualforce
I also copied the whole css content from the LDS CSS file (Path: 'assets/styles/salesforce-lightning-design-system-vf.min.css') and applied as inline CSS in VF page. But still, there is no luck.
My styleSheet is referred in VF page as below
apex:stylesheet value="{!URLFOR($Resource.SLDS221, 'assets/styles/salesforce-lightning-design-system-vf.min.css')}"
Page works absolutely fine if it is not rendered as PDF.
Also questioned in Stack Exchange: https://salesforce.stackexchange.com/questions/178572/visualforce-renderas-pdf-not-supporting-slds-css
Any suggestions guys??
Thanks,
Syed
Can you please incude <apex:slds /> tag and try .
Thanks ,
Raj
@Raja: Thanks for you suggestion. Unfortunately, Apex:slds doesn't go with renderAs="pdf" attribute. It means you can't use both these two features in a VF page. You will get this error An internal server error has occurred
If you want, you can test this,
Copy the example code from the below url and add renderAs="pdf" attribute in apex:page tag.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_styling_slds.htm
Thanks,
Syed
https://success.salesforce.com/ideaView?id=0873A000000U3GIQA0