Support Article
Unable to view logo image on converted PDF
SA-17579
Summary
PRPC is unable to render images to PDF. These images are created using out-of-the-box htmltoPDF activity.
Error Messages
Not Applicable
Steps to Reproduce
Create an activity, which calls HTMLtoPDF function to generate and view a PDF.
Root Cause
A defect or configuration issue in the operating environment. User has created a Rule-File-Binary from a Save As of the original rule which created a problem as pzInsKey and pzOriginalInstanceKey are different (as explained below) from the RULE-XML of RULE-FILE Binary.
As it was created as a Save As, the pzOriginalInstanceKey was refering to the original instance instead of the new rule created. The extension of file that has to be given while creating the Rule-File-Binary should be in JPG format. The name of the image file and also the Rule-FIle-Binary contains mixed formats ( for example, ClearRiverLake.JPG)
Resolution
Perform the below local-changes.
- Remove the custom java code and use OOTB HTMLtoPDF activity.
- The extension of file that has to be given while creating the Rule-File-Binary should be in the format "jpg".
- The name of the image and also the Rule-File-Binary name has to be in lower case letters (for example, abc.jpg)
- Create all the Rule-File-Binary as new rather than Save As
- Set the param.isClearCache to "true"
When the HTMLtoPDF activity is run for the fist time after creating a image (Rule-File-binary), it will load the image from:
<Pega-Temp Dir>StaticContent\common\<Opertorid>\<Directory>\Sample.jpg ( Example : Temps\StaticContent\common\393ad5d1a6165a3dfed3521ea3c37228\webwb\px.jpg)
Then the image will be cached under StaticContent\autogenerated\Rule-File-Binary\autogenerated\Rule-File-Binary
Next successive runs of the HTMLtoPDF will render the image from the "autogenrated" folder rather than static content directory of Pega temporary.
To make the image load continously from StaticContent or common folder, set param.isClearCache to "true"
An enhancement request (FDBK-13593) is raised to add the feature to enable setting custom Margins for the generated PDF.
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.