Question

1
Replies
302
Views
sayanip1 Member since 2014 1 post
Cognizant
Posted: 1 year ago
Last activity: 11 months 4 weeks ago

How to append the content of attachments to a PDF file

Requirement: Generate a PDF file that should contain the content of the case attachement. There can be various types of document attached to a case. From pc_data_workattach fetch the byte stream and append the content of those attachments to the PDF file.

How PDF is currently generated:

  1. The PDF is generated using an activity, using the concept of “HTMLtoPDF”
  2. An HTML stream is used where a section is referred

Approach to append the attachment content to the PDF:

  1. We need to attach the content of attached file in this section. Created a section and unchecked the ‘Auto-generated HTML’. We have fetched pyAttachStream from pc_data_workattach and tried following code in this section.
  1. Passing the InputStream as image source (For Image file)

<HTML><img src='InputStream' />
</HTML>

  1. Passing the value of InputStream as object.

<HTML>
<object> <pega:reference name="Property.pyAttachStream" /> </object>
</HTML>

The Inputstream is displayed in PDF instead of the content.

With this approach we’re unable to generate the PDF with the content of the attachment.

Low-Code App Development Dev/Designer Studio
Share this page LinkedIn