Applies to Pega Platform versions 7.2 through 8.6.2
Border styles not displayed, cells empty
Currency symbols and table borders not reflected in PDF file
Refresh Section designed for downloading PDF misbehaves
Font size difference using SmartShape
Required fonts not applied in generated PDF
Styling issue with check box and Inline dynamic layout
HTMLtoPDF activity run by an agent styles missing
Large number of table rows not exported to PDF after upgrade
Table formatting issues with inline styling
Section grid layout not reading CSS from Skin
Help topic update for Pega Platform version 8.1 through Pega Platform version 8.3
Pega-supported HTMLtoPDF parameters for Pega Platform version 8.2 and earlier releases
PDF Generation creates blank, empty pages
See also Updates to PD4ML support for information about later Pega Platform releases.
Line breaks missing
Symptom
After using the activity HTMLtoPDF to generate PDF, you notice that the line breaks added in the RTE are not reflected in the PDF output.
Explanation
Custom styling in the CSS is defective.
Solution: Local change
See SA-68597, PDF generated using HTMLtoPDF activity does not have line break
Remove the following custom styling in the CSS file:
p {
margin: 0px;
}
Border styles not displayed, cells empty
Symptom
After using the activity pyViewAsPdf to generate PDF output, you notice in the PDF output that the border styles are not displayed and table cells display no content; they are empty.
Explanation
Customer markup is defective.
Solution: Local change
- Apply Compact styling before calling the HTMLtoPDF activity:
On the Parameters page of the rule form, set the string property UseCompactStylesforPDF to true.
Alternatively, set the Parameter using the following code before calling the HTMLtoPDF activity:
Tools.putParamValue
(“UseCompactStylesforPDF”,
”true”);
- Avoid HTML input processing before calling the HTMLtoPDF activity:
On the Parameters page of the rule form, set the property pyHTMLDisableProcessing to true.
Alternatively, set the Parameter using the following code before calling the HTMLtoPDF activity:
Tools.putParamValue
(“pyHTMLDisableProcessing”,
”true”);
See also SA-69112 PDF table borders do not display. (HFix-45601 applies to Pega Platform 7.3.1.)
Currency symbols and table borders not reflected in PDF file
Symptom
All sections do not render into the PDF.
Table borders are not reflected in the PDF even though styles are present in pyCompactstyleforPDF.
You pass the whole section in the activity pyViewAsPDF and try to generate the PDF of that particular section. Tables that are present in that section do not take the table borders from the CSS file. The DSS pyCompactStyleForPDF is set to true, but the activity is not picking up the stylesheet.
A check of the markup shows that it is generated successfully.
Your attempts to update the CSS file locally in the affected section do not resolve the problem.
Explanation
The CSS file Compactstylesforpdf is not getting linked to the generated PDF.
Solution: Local change
In the HTML: PDFPages rule, the HTML tab, add a dummy link tag as part of the markup:
link rel="stylesheet" type="text/css" href="webwb/styles.css"
This will cause the compact styles code to take effect.
Report Definition export to PDF borders incorrect after upgrade from Pega Platform version 7.2.2 to Pega Platform version 7.4
Symptom
After upgrading their systems from Pega Platform version 7.2.2 to Pega Platform version 7.4, users report that when using the Report Definition action Export to PDF, they observe that cell borders are not correctly displayed.
Explanation
The border styles are collapsed. Hence, some borders align incorrectly.
table {
border-collapse: collapse;
}
Solution: Local change
See SA-76324, Cells in generated PDF align incorrectly
Refresh Section designed for downloading PDF misbehaves
Symptom
Using Pega Platform version 7.4, you are using Export to PDF on a dynamic layout designed with an onClick action to allow application users to click Refresh Section and invoke the HTMLtoPDF activity by sending the required parameters to generate the PDF file. After the Refresh Section action is triggered and during the reloading of the harness, some parameter pages are removed, and the HTML stream is null. This functionality worked as expected in Pega Platform version 7.1.7 applications.
Explanation
Refresh Section cannot be used for downloading PDF or other files.
Solution: Local change
The Refresh Section activity cannot be configured for downloading PDF files generated from HTML. Instead, you should use the Run Script activity for a control. Run Script passes the function name that needs to be run. The function takes two parameters: Activity Name and Class Name. The Activity Name is a custom activity for which you set some parameters in the parameters page before calling the HTMLtoPDF activity.
Follow this example:
- Add an action Run Script with Function Name downloadFile and specify the following parameter Names and Values:
- activityName customPDFActivity
- class @baseclass
- Attach a script tag containing the function specified in the User Work form.
Here is an example of the script:<script>
function downloadFile(activityName, className){
var suURL = SafeURL_createFromURL(pega.u.d.url);
suURL.put("pyActivity", activityName);
suURL.put("pyClassName", className);
var formEle = document.createElement('form');
formEle.id = "download_file";
formEle.method = "POST";
formEle.action = suURL.toURL();
if(pega.env.ua.webkit)
formEle.target = "";
document.body.appendChild(formEle);
formEle.submit();
document.body.removeChild(formEle);
}
</script>
See also SA-71354, Export to PDF does not download PDF.
Font size difference using SmartShape
Symptom
Font size differs in PDF using SmartShape and pxCreatePDF.
A PDF file is generated in two ways: through the SmartShape in the flow and using pxcreatePDF in the HTMLtoPDF activity. The generated PDF files display different font sizes. The PDF files should have the same font size, regardless of how they were generated.
Explanation
The application skin is applied when the PDF is generated through a flow SmartShape; the font size is controlled by the skin.
Solution: Local change
For Pega Platform version 7.4 and later releases, you can use the Dynamic System setting (DSS) called UseCompactStylesForPDF. When you set this DSS to true, the application skin is not imported into the PDF.
This true setting calls the rule pyCompactStylesForPDF.css, which provides a bare minimum CSS with some default styles that you can use to override the CSS used by the application skin. All PDFs will have a consistent CSS applied.
As an alternative to setting the DSS, you can specify Compact Styles by passing a parameter UseCompactStylesForPDF to the HTMLtoPDF activity with value true.
Be sure to set the parameter before calling the activity HTMLtoPDF using one of the following choices:
- Set the parameter to true on the Parameters page of the activity, or
- Use the following line of code:
Tools.putParamValue
(“UseCompactStylesforPDF”,
”true”);
Required fonts not applied in generated PDF
Symptom
Required fonts are not applied in the generated PDF. Specifically, a section with a grid containing Chinese characters is created with Calibri font specified as the Inline style for labels and fields. The generated PDF displays the Times New Roman font instead of Calibri.
Explanation
A software use or operator error: The fonts in the Windows directory were missing in the Pega application server directory.
Solution: Local change
Create a non-auto section and place the CSS needed in the non-auto section in the <style> tag. Then include the non-auto section above all in the section that you want to export to PDF.
Follow these steps:
- Download Times New Roman font (or any required font style).
- Add the font in the Fonts directory.
- Create a non-auto section.
- Add the required CSS in the non-auto section between the <style> tags.
- Include the non-auto section above all in the section that must be exported to PDF.
<style>
body{
font-family: <FONT_NAME>;
}
</style>
- Copy the FONT_NAME from the pd4fonts.properties file.
Styling issue with check box and Inline dynamic layout
Symptom
When PDF is generated through the createPDF SmartShape, the styling for Inline dynamic layout check box and its label are not displayed correctly.
Explanation
An internal issue with the PD4ML library causes some styles not to be rendered correctly. In this case, the style display: inline-block is displayed incorrectly.
Solution: Local change
In this case, the user does not want to use the DSS setting UseCompactStylesForPDF because the application skin will not be generated.
Instead of using a check box and a label with inline styling, use the checkbox caption to achieve the same effect.
HTMLtoPDF activity run by an agent styles missing
Symptom
When you create a PDF using the HTMLtoPDF activity, if the activity is run by an agent, the styles are not included in the generated PDF. The styles are included if the activity is executed manually.
Explanation
A software use or operator error: Styles are lost when the HTMLtoPDF activity is run by an agent.
Solution: Local change
Specify the Access Group in the Security tab of the Agent rule to ensure that the style markup matches the style markup when the HTMLtoPDF activity is run standalone, without an agent.
See SA-79488, Styles are not included in generated PDF.
Large number of table rows not exported to PDF after upgrade
Symptom
Export to PDF does not work whenever the number of rows to be exported is 1000 or more. Before upgrading from Pega Platform version 6.3 to Pega Platform version 7.4, users noticed that PDF generation was fast, taking 10 minutes or less. On Pega Platform version 7.4, PDF generation takes longer or fails with large numbers of rows.
Explanation
Pega Platform version 7.4 introduced many changes in terms of execution, whereby new infrastructure components and internal APIs consume more resources and take more time, unavoidably. Because the grid markup is work object oriented, the extra processing is required.
Solution
Apply the new property Split table when exporting to PDF as described in Help topic update for Pega 8.1 through Pega 8.3, Split table when exporting to PDF in Report Definition.
Table formatting issues with inline styling
Symptom
While using the HTMLtoPDF activity, users notice a spacing issue between table headers in generated PDF. Borders for the headers and data cells are added through inline styling.
Explanation
Inline styles are used in the section along with custom configurations for the table.
Solution: Local change
- Set the DSS setting UseCompactStylesforPDF to true.
- Set the property in the Parameters tab of the HTMLtoPDF activity.
- Make the relevant CSS changes in the file pyCompactStylesforPDF.css.
See also Font size difference using SmartShape.
Section grid layout not reading CSS from Skin
Symptom
The Section grid does not pick the Cascading Style Sheet (CSS) from skin while generating a PDF using the HTMLtoPDF activity. The PDF does not display CSS for grid columns, rows, font family, and font size.
Explanation
An old version of the PD4ML library was in use.
Solution: Local change
Download and install the latest PD4ML version, 3.10.0 PRPC.1.
See SA-78787, Section grid does not pick CSS from skin
Help topic update for Pega Platform version 8.1 through Pega Platform version 8.3
Split table when exporting to PDF in Report Definition
In the Help topic for Pega Platform 8.3 and earlier releases to Pega Platform 8.1, Report Definition Data Access tab, the property, Split table when exporting to PDF, was omitted. This new property was added in Pega Platform 7.3 HFix-51852, Pega Platform 7.4 HFix-52879, and delivered in Pega Platform 8.1, as shown in the following image for Reporting database > Prefer reporting data source if defined > Split table when exporting to PDF.
In the Help topic for Pega Platform 8.3 and earlier releases to Pega Platform 8.1, Report Definition Data Access tab, under General Data Source Settings, and below Ignore application skin when exporting to PDF, the following information should appear for the new property, Field and Description:
Field |
Description |
---|---|
Split table when exporting to PDF in Report Definition |
Splits the records into small tables for faster generation of PDF. Set to true when there are many records for a table. When set to true, two additional properties are displayed:
For large records, generation of PDF from HTML through PD4ML takes more time; this property is a workaround for optimizing the time taken to generate PDF from given markup. |
Pega-supported HTMLtoPDF parameters for Pega Platform version 8.2 and earlier releases
The following table lists the parameters in the Pega-provided HTMLtoPDF activity and their purpose. These parameters are available for Pega Platform version 8.2 and earlier releases. For parameters supported in Pega Platform version 8.3 and later releases, see the appropriate Help topic or article, for example, Generating PDFs and attaching them to work objects or viewing them in web browsers.
For information about Pega support for PD4ML in Pega Platform version 8.4 and later releases, see Updates to PD4ML support.
Number |
Parameter |
Purpose |
Default Value |
Is PD4ML |
|
---|---|---|---|---|---|
1 |
pyPDFPageOrientation |
Sets the page orientation of the PDF document: Landscape or Portrait |
Landscape |
Yes |
|
2 |
pyPDFPageSize |
Sets the page size of the PDF document |
A4 |
Yes |
|
3 |
pyPDFEnableHyperlinks |
Enables hyperlinks in the PDF document when set to true. When set to false, hyperlinks are not actionable. |
false |
Yes |
|
4 |
Specifies the path to the directory where fonts are located |
Empty |
Yes |
|
|
5 |
pyPDFEmbedFont |
Enables the fonts to be embedded into the PDF document from pyPDFFontsDirectory when set to true |
false |
Yes |
|
6 |
pyPDFPropsDirectory |
Specifies the directory to use at run time to generate the Properties file during PDF generation (optional) |
Empty |
Yes |
|
7 |
pyPDFHeaderHTMLTemplate |
Defines the HTML code to be rendered in page headers Example: <div style="color:blue;"> page $[ page] of total $[total] </div> |
Empty |
Yes |
|
8 |
pyPDFFooterHTMLTemplate |
Defines the HTML code to be rendered in page footers Example: <div style="color:blue;"> page $[ page] of total $[total] </div> |
Empty |
Yes |
|
9 |
pyGenerateToolTips |
Produces tooltips from TITLE HTML attributes (PDF Annotations) when set to true |
false |
Yes |
|
10 |
pyEnableSmartTableBreaks |
Enables PD4ML insertion of page breaks in between table rows to make the table portions fit page height when set to true If the table has a header, a true setting replicates the header row in each table section |
false |
Yes |
|
11 |
isClearCache |
Removes all objects (images, CSS) from internal PD4ML caches when set to true A true setting helps to avoid memory leaks with huge TTF and TTC files after PDF generation. |
false |
Yes |
|
12 |
pyHTMLDisableProcessing |
Disables processing the HTML input for conformance when set to true Pega pre-processes the HTML stream and invokes the HTML TIDY utility to get a clean stream of the HTML input. |
false |
No |
|
13 |
startPage |
Sets the page number counter to the specified value for page numbering in document headers and footers |
1 |
Yes |
|
14 |
pyEnableOutlines |
Generates outlines or bookmarks in the PDF document when set to true Outlines can be generated from anchor tags, <a name="Bookmark1">. |
false |
Yes |
|
15 |
pyPDFGeneratePDFA |
Forces PD4ML to output PDF compliant with the PDF/A specification for long-term archiving Method call does not guarantee the generated output to be of format PDF/A if fonts embedding is not set to true.
Request the last rendering status to check if the generated PDF document is PDF/A compliant. |
false |
Yes |
|
16 |
pyShowWarning |
Shows the log warning during HTML TIDY parsing when set to true (optional) HTML TIDY errors are always shown. |
false |
No |
|
17 |
pyEditablePDF |
Makes the PDF editable when set to true, forcing PD4ML to convert HTML forms into PDF forms (Acroforms) When set to true, InputTextBox, check box, and other form elements become editable. |
false |
Yes |
PDF Generation creates blank, empty pages
Symptoms
The PDF is generated with thousands of blank pages.
One blank page in between displayed content pages is created in the generated PDF. The source content for the generated PDF was an email correspondence fragment.
PDF of a section displays a blank page.
Explanations
A Pegasystems defect that will be corrected by a product enhancement and documented as a Resolved Issue for a future release -- Not all fonts are available in the Pega RTE for Documents.
User error for email correspondence fragment
Client bug with CSS
Environments
The problem was reported in the following environments:
Pega Platform™ 8.4.3 in Pega Cloud® services 2.17.2
Pega Platform 8.4.4 in Pega Cloud services 2.18.2
Pega Platform 8.4.5 in Pega Cloud services 2.21.2
Pega Platform 8.5.3 on-premises environment
Pega Platform 8.6.1 in Pega Cloud services 2.18.2
Pega Platform 8.6.1 in Pega Cloud services 2.20.8
Pega Platform 8.6.2 in Client-managed cloud Staging environment
Solutions
Watch for the Pegasystems defect correction to be documented as a Resolved Issue in a future release of the Pega Platform. In the Resolved Issues for a future release, search for ISSUE-781135.
In the meantime, choose the workaround that best fits the symptoms that you see.
- For any Word documents that might be generated as PDF, use the OpenSans and Georgian fonts or Plain Text. These choices are supported by the PD4ML library.
- In the Data Transform pyPDFSettings, set pyEnableSmartTableBreaks to true.
- Remove nested tables in the email correspondence fragment.
- When you create a PDF file using the Create PDF smart shape in a case type or by using the HTMLToPDF activity, you can use the pyCompactStylesforPDF compact style sheet instead of the style sheet that the application skin uses. Use this style sheet to generate PDF files and to render certain elements that you cannot render when you use the application skin to generate PDF files.
To use the compact style sheet, enable the UseCompactStylesforPDF dynamic system setting by performing the following steps:
- In Dev Studio, search for UseCompactStylesforPDF.
- Click the result that appears in the dialog box.
- On the Settings tab, in the Value field, specify true.
- Click .
Related content
Generating PDFs and attaching them to work objects or viewing them in a web browser
Generating complex PDFs on your UI