Question

How to export a section as pdf

In the section, I have draged one dynamic layout(inline grid triple). In that layou I have given three charts and given report definition as source. Then I have given that section in the manager dashboard. Now I want to export that page or section as pdf . Please suggest some solution to do this

Comments

Keep up to date on this post and subscribe to comments

Pega
September 27, 2019 - 12:58am

Hi,

The Work-.pxCreatePDF activity can be used to generate a PDF of a section.

Pega
September 27, 2019 - 1:00am

Pega
September 27, 2019 - 1:01am

Hi,

You can use pxCreatePDF smart shape in your flow for this requirement.

However, I see you are using inline grid triple for your dynamic layout. The resulting PDF might be truncated at the right side. This is an expected behavior as the smart shape function generates PDF based on whatever is visible in the window viewport.

Thanks

September 27, 2019 - 2:17am
Response to Srinivas21

To resolve the section truncate issue (which is smart shape's normal behavior when vertical/ horizontal scroll bar exist in the UI), you can create another section and uncheck "Auto-Generated HTML" and paste below code in there.

<pega:include name="SampleSectionName" type="Rule-HTML-Section" mode="noinput"></pega:include>

Later, pyAttachAsPDF activity can be used to attach the PDF to the work object or activity "HTMLToPDF" followed by "View" (Code-Pega-PDF) can be used to view the generated PDF as a browser response.

September 28, 2019 - 8:32am

September 29, 2019 - 5:27am

You can use "Create PDF" smart shape and pass the Section name which you want to convert to PDF. 

Also, you can provide a name to the PDF. Also, you can select PDF Orientation - Landscape or Portrait.