Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Custom styles defined in CSS do not get passed to PDF

SA-6250

Summary



User has a non-autogenerated section to generate a label with bar codes on the screen.The label is shown appropriately on the screen and the same label have to be exported to PDF. HTMLTOPDF activity is used to generate the PDF. The custom styles do not get reflected in the generated PDF. 

Error Messages



Not Applicable. 


Steps to Reproduce



1) Create a non-autogenerated section
2) Add your own custom HTML code.
3) Add the styles to a CSS file.
4) Refer the CSS file in the non auto generated section using <link rel or pega:static JSP tags.
5 ) In an activity first step set property-set-stream and specify the above created section.
6) Get the HTMl content in to a param or a loca variable.
7) Pass it to the HTMLTOPDF activity.
8) Use code-pega-pdf.view activity to view the PDF that is generated.


Root Cause



The root cause of this problem is that the link tag for the CSS mentioned in the HTML code is not being referred and picked. The CSS link tag is read directly without reaching the reference CSS file as follow:-




Resolution



This issue is resolved by directly mentioning the CSS code in the HTML instead of referencing using the link tag.

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us