This is a simple POC, how to use Generate Document and Create PDF smart shapes in Pega.
Demo Video:
Create a case type – Generate Document
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-213.png)
Configure the view
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-214.png)
Now add a new stage – Generate Document – add a step Generate Document
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-215.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-216.png)
Now click View and use fields
Copy tag that you want to add in the Document
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-217.png)
I have to add, the following fields in the sample document
First Name
Last Name
Address
Phone No
After clicking View and use Fields — copy tag for the above fields and add those in the sample word doc.
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-218.png)
This is the template TestFile1.docx. I have copied the Tags and added into this file.
Now I have to upload the file TestFile1.docx in Case Type.
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-219.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-220.png)
Now Run the Case type
In the first screen whatever data you will input all those will be added to the sample document.
Launch User Portal
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-221.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-222.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-223.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-224.png)
On the right side you can see the TestFile1.docx has been attached.
Open that,
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-225.png)
So whatever we have added in the first screen are available in the Word doc.
Now lets add another smart shape, Create PDF
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-226.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-227.png)
Section name is Create — So add the same in the Right pane – Section name
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-228.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-229.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-230.png)
From the flow – Check that this is the right section.
Now SAVE the Case Type — Launch the user portal
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-231.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-232.png)
Click Create –
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-233.png)
On the right hand pane we can see the two attachments – Collect Details.pdf and TestFile1.docx
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-234.png)
This is the end of the article. Please let me know your inputs in the comments section. 🙂