Support Article

'CreatePDF' Smart Shape generates PDF with grey background

SA-33435

Summary



Using the PDF smart shape, we are able to generate the PDF, but the file includes a grey background style.





The pzCreatePDFHarnessWrapper HTML is the correct Pega 7.2.1 fixed rule after a previous Pega 7.2 bug was found and hotfixed ( BUG-248775).

Note: Pega tried to supply an html stream differnt from pzCreatePDFHarnessWrapper and then everything looks better.

Error Messages



Not Applicable


Steps to Reproduce

  1. In a flow put a PDF Smart Shape
  2. Configure the Smart Shape in order to take a section in which include HTML code that includes a css file for styiling and another section configured in the standard way.
  3. Runn the flow, the generated file contains some gray areas that are not included in the css file section.


Root Cause



A defect in Pegasystems’ code or rules.

The 'CreatePDF' Smart Shape takes a PRPC 'Section Rule' as input but does not allow the Designer to specify a Harness. Additionally the underlying library 'PD4ML' is unable to process all types of CSS and HTML that PRPC generates for Sections. The 'CreatePDF' smart shape can only really deal with subset of Sections generated by PRPC (in fact; any HTML-based input)

With regards to the grey background issue this has been logged with our Engineering team.

There is already an existing support article on PDN but this does not refer to the SmartShape issue as being also a variation of the same problem:
"Background color of generated PDF displays in grey" (SA-24544)

The product bug that was logged is to improve the CreatePDF smart shape within a Flow and run from User Portal:

Currently it results in text on Labels and from within Rich Text Editor showing as 'white-on-very-light-grey' ; in fact it is very hard to tell there is any text at all on the resultant PDF.

This can be worked-around by fiddling around with the 'Presentation' tab of the controls involved in the case of Labels; and in the case of Rich Text Editor - explicitly switching the text colour to (say) black also affects the resultant PDF. The issue can be totally avoided by crafting Rule-Obj-HTML directly.

We hope that have this resolved after the 7.3 release.

Resolution



Perform the following local-change steps:
  1. Copy the pxCreatePDF activity in the ruleset.
  2. Replace the pzCreatePDFHarnessWrapper with a custom HTML stream that simply includes the section for creating the PDF.

The suggestions to local-change is that the CSS issue is that one can 'hand-craft' 'RULE-HTML' rules, that have the advantage is the complete control over layout and style.

This has the following disadvantages:

1. HTML (+JSP) coding knowledge needed to build / maintain them.
2. No advantage of re-use that one gets when using the same sections as the UI is using.

Published February 8, 2017 - Updated March 10, 2017


100% found this useful

Have a question? Get answers now.

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