In this POC we will cover, how to parse a PDF in Pega using EForm.
Demo Video:
- Prerequisite: Create a PDF file with Editable fields.
Sample File:
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-235.png)
Create a Case Type
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-236.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-237.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-238.png)
Create a SampleTestFileEditable PDF file using online tool. It should be editable PDF file.
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-239.png)
Now go to Dev Studio — Configure
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-240.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-241.png)
Click Start
Next screen enter the class of the case type — MYOrg-IND-MySampleApp-Work-ParsePDF
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-242.png)
Click Next to upload the sample editable pdf file
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-243.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-244.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-245.png)
Click Next
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-246.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-247.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-248.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-249.png)
Click Next
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-250.png)
Resolved-Completed.
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-251.png)
Click Close.
Now come to App — Open – ParsePDF – Integration-Mapping — EForm File, Map eForm have been generated.
Open the Map eForm rule to Map the properties to the clipboard. You can,
define the pyWorkPage in Pages and classes and use it to map the properties.
OR you can directly map the properties.
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-252.png)
Now Create the Activity ParsePDFActivity– Records – Technical – Activity
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-253.png)
Add Parameters
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-254.png)
Pages & Classes
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-255.png)
Activity Steps :
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-256.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-257.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-258.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-259.png)
ClipboardPage eFormPg = tools.findPage(“eFormPage”);
ClipboardProperty eForm = eFormPg.getProperty (“pyEForm”);
byte[] eformByt = org.apache.soap.encoding.soapenc.Base64.decode(FormData);
eForm.setValue(eformByt);
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-260.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-262.png)
Go to the Case type — Flow – Flow Action — Call the activity
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-263.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-264.png)
Scroll down
Under Post Processing – Post Processing Activity – Run Activity
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-265.png)
Call ParsePDFActivity — MapPurpose = Map eForm = ID of eForm map rule SampleTestFileEditable
Now Go to the flow action — open the section
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-266.png)
Convert to Full screen editor
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-267.png)
Click the gear icon
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-268.png)
Click the Change link beside Text input – Custom – Other
Type – pxAttachContent
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-269.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-270.png)
Run the Case Type
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-271.png)
Sample file::
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-272.png)
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-273.png)
Upload the sample file — by filling the form with Data
Click Continue… Data will be available on the Pega screen— So the PDF file is successfully parsed.
![](https://mypegapoc.com/wp-content/uploads/2022/04/image-274.png)
Now you can use this data in Pega for further processing and even you can change the data and generate a updated PDF file.
This is how we parse PDF file in Pega. I have already posted another POC, how to parse Excel File.
Hope you have liked the article. Please let me know your inputs in the comment.
Happy Learning!! 🙂
It was well explained. Please add step comments for better understanding for us.
Thank you Shivaprasad for the feedback. Will follow the same going forward.