Posted: 19 Aug 2020 22:26 EDT Last activity: 30 Sep 2020 6:17 EDT
How to generate pdfs with dynamic content?
I have requirement to generate pdfs on the click of button and show it to the user. Other then the dynamic data the pdfs will have multi line records from a pagelist. my question is which approach i should use to create this pdf.
***Edited by Moderator: Pallavi to update platform capability tags***
On clicking the button you can run the activity, where you will be referring the OOTB activities HTMLtoPDF and View activities. Also you can pass the section name which will contain the required data as a parameter to the HTMLtoPDF activity
Implement a Section to stage the data you want to include in the PDF, just as if you were wanting to show it on a UI for an Assignment.
If the PDF will wind up being an attachment to the case anyway, it will be less engineering to use the "Create PDF" automation in the Flow rule following where the dynamic data is finalised, and then guide the user experience to accessing the generated PDF as an attachment.
If it genuinely needs to be an on-demand action from a Button-click, run the Tracer over a flow rule that runs the "Create PDF" automation to see what rules it uses and look to reuse those to ensure you are tapping into Pega's latest PDF generation capability. It may still be HTMLtoPDF.
Your solution was perfect. I was able to use HTMLtoPDF ootb activity to generate PDF. I went through the background processing of Create PDF smart shape and got to learn a lot.
After successfully implementing it i have got another requirements for allowing the user the update the static content on the paragraph. That way technology team dont have to involve to make any static changes. Once the user update the static content from the portal system should always pick the updated paragraph to create a pdf.
I am thinking if is there is anyway we can store the entire HTML of Paragraph in column of a database table? That way if user make any updates the updated HTML will get added to table as a new record. That way system can refer both the old record as well as new record as per the requirements. Because system needs to refer both the old version paragraphs as well as new version paragraphs.