remove restricted permissions from imported PDF

Hi,

We have a requirement to retrieve the latest PDF form from a URL, map some fields to it, and present it to the user on click of a button

We are using connect-Http to fetch the document and the GenerateEform activity to map the fields. However, the document hosted at the URL has restricted permissions, such as not allowing editing or copying, which is preventing us from mapping the fields to the Eform.

Our question:

  1. Is there a way to retrieve the PDF form as raw byte data (byte code) without encountering these restrictions?
  2. Alternatively, is there a method to remove or bypass the document’s restricted permissions to enable field mapping?

@priyankab0879 To address the issue of restricted permissions in the imported PDF, you can retrieve the document as raw byte data and process it to bypass restrictions. Use the Connect-HTTP rule to fetch the PDF as a byte stream from the URL. Then, utilize a library such as Apache PDFBox or iText within a custom Java step in Pega to modify the PDF. These libraries allow you to remove restrictions like editing or copying by processing the PDF as byte data. Ensure that you only use this for authorized purposes, adhering to the document’s terms of use. Once the restrictions are removed, pass the modified byte stream to the GenerateEform activity for field mapping. This approach helps you work around the permissions issue and enables seamless integration of the PDF form with mapped fields for user presentation.

@Sairohith Thank you for your response.

Do you have any sample Java code for this?

@Sairohith thank you. Your solution worked out.