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

Printing sections is not working as expected

SA-43745

Summary



On converting a section with dynamic layouts (inline grid) to PDF with the out of the box HTMLToPDF Activity, the fields in the layout are all coming in a vertical in the PDF, while in the section it was coming in stacked column format.


Error Messages



Not Applicable


Steps to Reproduce

  1. Create a section with Inline grid dynamic layout.
  2. Pass the section HTML as Markup to HTMLToPDF Activity.


Root Cause



This issue was determined to be a product enhancement request:

PD4ML is a third Party tool used for generating a PDF, there is an issue in that tool where it incorrectly interprets some media css. PD4ml library treating the child div's as block level elements though the parent is styled with "display:inline-block”.


Resolution



Perform any of the following local-change to get the alignments right:
  1. Change the Dynamic Layout to Free form layout.
  2. Since some of the advanced style elements like display:inline-block are not being handled by the pd4ml library(resulting in formatting issue in the generated PDF, include the skin css in a non auto-generated section and overwrite some of the style elements to achieve the intended formatting. Below is an procedural example:
  1. Copy the Skin css from Application > Application Skin > preview(It can be found in actions tab) and create a new css file ExportToPdfStylesCSS.css.
  2. Create a HTML rule and include the required section and the ExportToPdfStylesCSS. This HTML rule will be passed as Markup to the HTMLToPDF Activity.
<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", "PATR-SRTest-Work-B74205");
sectionListKeys .putString("pyStreamName", "CaseSummary");

String sectionStream = tools.getStream(sectionListKeys, null);
out.println(sectionStream);
%>
</body>
</html>

3. Make the changes in the elements of the ExportToPdfStylesCSS.css to get the formatting right of the generated PDf.

Note: Pega management is considering adding a newer version of PD4ML in a future version of the platform to address these issues.


Suggest Edit

Published December 15, 2017 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

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