cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daniel_Pa
Resolver II
Resolver II

Adding text or image of text to PDF

Hi

 

I'm trying to add an ID number to a PDF, before archiving it. It's a six digit number, which should be added at a specific position of the PDF on a specific page (i have several different formats, where I'd like to specify the location based on filename).

 

Has anyone had any success with something similar? Preferably without 3rd party software, but scripts would be an option.

Though, if a straight forward solution exists with 3rd party software, I'm also curious.

 

It could also be adding a picture of the text, if that makes it easier. I'm also willing to use Power Automate/ Flow, if that could simplify the process. But PAD would be preferable.

 

TIA

Daniel

1 ACCEPTED SOLUTION

Accepted Solutions
Daniel_Pa
Resolver II
Resolver II

I think i have found a viable solution!

 

Using the free Adobe Reader, I'm able to add comments, which is enough for this use case, and keeps the signing history for the document.

 

Thanks for the inputs though! 🙂

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hello @Daniel_Pa 

 

Maybe this is not the answer what you want, but what about using Word app to open PDF file?

 

In below example, I use Word app to open PDF file, type 012345 into the top of the document, and then export it to PDF format file again.

 

shindomo_0-1632317974399.png

 

System.RunApplication ApplicationPath: $'''C:\\Program Files\\Microsoft Office\\root\\Office16\\WINWORD.EXE''' CommandLineArguments: $'''/t \"C:\\Users\\User01\\Documents\\PDF Files\\PDF 01.pdf\"''' WindowStyle: System.ProcessWindowStyle.Normal ProcessId=> AppProcessId
WAIT (UIAutomation.Windows.ToOpenByTitleClass Title: $'''Microsoft Word''' Class: $'''#32770''' FocusWindow: True)
MouseAndKeyboard.SendKeys TextToSend: $'''{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False
WAIT (UIAutomation.Windows.ToOpenByTitleClass Title: $'''PDF 01 - Word''' Class: $'''OpusApp''' FocusWindow: True)
MouseAndKeyboard.SendKeys TextToSend: $'''012345{Return}{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False
MouseAndKeyboard.SendKeys TextToSend: $'''{Alt}(){F}{E}{A}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False
WAIT (UIAutomation.Windows.ToOpenByTitleClass Title: $'''Publish as PDF or XPS''' Class: $'''#32770''' FocusWindow: True)
MouseAndKeyboard.SendKeys TextToSend: $'''New PDF File Name{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False

Hi shindomo

 

Great suggestion! Really appreciate it.

I just tested it, and its close to a working suggestion, although some elements from the PDF act a bit funky when opened in Word. Some letters are jumping around, unfortunately.

 

If it wasn't for that, I would gladly use your solution! But, since the documents are legal contracts, i can't allow any other modifications besides the addition of the ID, before archiving.

 

Best,

Daniel

MichaelAnnis
Super User
Super User

Assuming you have Adobe Pro, I would look into Header and Footer options.  They are very customizable and it's how I did the Bates numbering for a recent divorce/custody case with over 600 pages.  I even see an option for "Apply to Multiple Files"

MichaelAnnis_0-1632321559442.png

Regardless of whether or not you can find a solution here in Adobe Pro, I also recommend Adobe Split Pro.  It is a 3rd party software that runs about $100-120 per computer license (that's for life, no membership).  I use it to split, merge, rename files, etc.  It probably has a function or two that would be useful for Bates numbering.

 

Best of Luck!

Hi Michael

 

Thanks for chiming in - always appreciate reading your suggestions here on the forum.

I've also considered buying Adobe Pro, but I would need an option to place the text at a specific place on each template. Not in the header or footer, but in an "ID field" (formatted as "xxxx ID: ___________") in the text on the last page. Do you know if this is possible with Adobe Pro?

 

Best,

Daniel

Daniel_Pa
Resolver II
Resolver II

I think i have found a viable solution!

 

Using the free Adobe Reader, I'm able to add comments, which is enough for this use case, and keeps the signing history for the document.

 

Thanks for the inputs though! 🙂

Grats.  With Adobe Pro, you can add text anywhere, but automating it would be harder.

Yeah, it looks like adding text programmatically to PDFs is kinda tricky. Unless you go all in and use some Python Libraries or something similar.

 

But for now, with just a handful templates, i believe im fine with just hardcoding where to place the text through mouse clicks on screen coordinates and keyboard shortcuts.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,802)