How to Add PNG File To PDF File In Pega

On pega Process can we adding for PNG files (example Signature) to PDF files?


*for example a user uploads 2 types of files,

  1. PNG File(signature)
  2. PDF File (the document that will be signed),

so we will insert the PNG file into the PDF File. Can this be done in Pega?

@spencerwikal

Hi,

You can use any one method to get your requirement:

1.You can use the pxAddImage function in a Pega activity to add a PNG image to a PDF file. This function allows you to specify the image file, its location, and the PDF file to which you want to add the image.

2.The pxGeneratePDF function can be used to generate a PDF file from a template or a HTML string.

Regards,

Poojitha Behara

@spencerwikal - In run time which section is capturing the these two files can be passed to either pxCreatePDF or pyViewAsPDF activity to generate the PDF.

pxCreatePDF - Attach the PDF at the case level and takes section rule

pyViewAsPDF - Download’s the PDF and takes the html file ( Can include the section in html rule by using <pega:include type=“Rule-HTML-Section” name=“SectionName” />)

Thank you.

@BEHARAP9 Thank You For your reply

@Priyanka Boga Thank You For your reply

@spencerwikal

You can follow the below steps to include signature in pdf.

Code to include signature in pdf:

CaptureManagerSignature -This should have the signature.


Non auto generated section

<style>

    .signature-actions{

      display:none;

    }

    </style>

  <body>

    <pega:include name="CaptureManagerSignature" type="Rule-HTML-Section" /> 

Signature:

<img src="<p:r n='param.BASE64OutParam' m='literal'/>">

    </body>

</html>

Call this non autogenerated section in pdf generating section.