Support Article
PDF download not picking skin rule styles
Summary
Generated PDF does not reflect styles from the Application skin.
Error Messages
No Error Message.
Steps to Reproduce
1. Create a Section (Step-1) having a button field.
2. This Button has On-Click Refresh action which is calling a custom activity (CustomHTMLtoPDF).
3. Create CustomHTMLtoPDF which is again calling the OOTB activity HTMLtoPDF.
4. Create a non auto-generated HTML Section (Step-2) which contains following code:
<pega:static type="style" app="webwb">
<pega:file name="ExportToPdfStyles.css" />
</pega:static>
You may change the name of CSS file accordingly.
5. Create a 3rd Section (Step-3) which is being called by Activity. (Stream name for the Activity is Step3)
Root Cause
An issue in the custom application code or rules.
Resolution
In the non auto-generated HTML Section, include the CSS file (ExportToPdfStylesCSS) in the head and include the Section (Step3) in the body.
This can be done in the following way:
<html>
<head>
<pega:static type="style" app="webwb">
<pega:file name="ExportToPdfStylesCSS.css" />
</pega:static>
</head>
<body>
<%
StringMap sectionListKeys = new HashStringMap();
sectionListKeys .putString("pxObjClass", "Rule-HTML-Section");
sectionListKeys .putString("pyClassName", "DEMO-pdf-Work");
sectionListKeys .putString("pyStreamName", "Step3");
String sectionStream = tools.getStream(sectionListKeys, null);
out.println(sectionStream);
%>
</body>
</html>
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.