Question
Deutsche Telecom AG
RO
Last activity: 30 Aug 2023 10:13 EDT
Edit PDF in Pega Robot Studio
Hello everyone,
I want to ask how I can edit a PDF using Pega Robot Studio. I can read the PDF data with pdfConnector, but I also want to make some edits. PDF does not have editable forms.
The edits are made manually at the moment using Adobe Pro.
Any thoughts on how I can achieve this?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
@AndreiN16802781 Pega Robotics does not have the full capabilities of a tool like Adobe Acrobat Pro. In terms of editing a PDF file, you are limited to being able to edit Form fields, annotate a document, or insert pages from another document. Below is an article on working with PDF files that discusses the capabilities in detail.
Deutsche Telecom AG
RO
@ThomasSasnettThank you, I read the documentation but I was hoping to find a workaround. How does one approach editing PDFs in Pega? Maybe convert it to docx? Adding Adobe Pro automation?
Thank you
Pegasystems Inc.
US
@AndreiN16802781 I would probably look at the use case and try to work with a Word document instead. You can extract whatever data you need from the PDF and enter into a corresponding Word document. You might then save that document as a PDF. If you needed items from the PDF (like signatures or other hand-written items), then you could include the original document with the edited one.
I am fairly certain you wouldn't be able to automate Adobe as an application as it uses non-standard controls and has tended to change them regularly with even minor releases.
Deutsche Telecom AG
RO
@ThomasSasnett Thanks for the idea, I have another question... I have read the PDF line by line and I want to copy the info in a word document. How can I do this without using bookmarks, I would also like to keep the formatting.
Thank you!
Pegasystems Inc.
US
@AndreiN16802781 Pega's Word connector gives you access to the entire Word document object, so you can use Ranges to insert text in places without bookmarks, but if you are going to do that, then it would make sense to write a C# script to do it. You can search for "Word Interop" for some examples on how you might work with a Word document in C#.
Bookmarks are the easiest way to work with a Word document in Robotics. If you create your bookmarks enclosed in a specific text format, then whatever text you insert will be in that format. For example, if you create a bookmark and then bold the area where the bookmark is, the text inserted will be bold.
Deutsche Telecom AG
RO
@ThomasSasnettCan I use external libraries(that are not present when I click button "manage references") when writing a script? If yes, how can I add them into the project?
Keeping the formatting from the pdf to word is a complicated job and I would like to try to convert it using Aspose DLL.
Thanks
Pegasystems Inc.
US
@AndreiN16802781 You may use external assemblies. They will get packaged with the deployment, but you can also add in any manually. During development, they need to be placed either in the installation folder (C:\Program Files (x86)\Pegasystems\...Studio) or in %AppData%\Pegasystems\PublicAssemblies. I have found in 19.1 that the installation folder works best. In 22.1 though, I have not had any issues with the latter.