Skip to main content
Participant
May 6, 2020
Answered

Batch Rename from Document Contents

  • May 6, 2020
  • 3 replies
  • 7496 views

Hi, All

We would like to use Acrobat Pro DC to rename all our invoices and make it easier for our Creditors team to find and service them.

We need to do the following: 

1) Save PDF Invoics received by email or downloaded by FTP into a networked folder

2) Automate opening up each invoice and recognising information such as Invoice Number and Date using OCR

3) Batch rename all PDFs in the folder using the resulting OCR information to create the name in a specified format

 

I've had a look at the Scan and OCR Tool in Acrobat DC Pro, and while it will batch rename files in a folder, it does not seem to be able to do so using information extracted from these files.

 

There is a third-party app called A-PDF that will do this, but we are concerned that it may not be the best solution.

 

Your help would be appreciated!

Thanks

Stephen Kane

This topic has been closed for replies.
Correct answer Thom Parker

Searching for and Extracting data from a PDF page is on the more advanced side of Acrobat scripting.  Use the "doc.getPageNthWord()" function.  You'll find some post that discuss this function on this forum. 

Here's the reference entry:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_methods.htm%23TOC_getPageNthWordbc-54&rhtocid=_6_1_8_23_1_53 

3 replies

SKITDAuthor
Participant
May 7, 2020

Hi, All

OK, a modification of our requirementsas I have received additional infomation.

 

We would like to use Acrobat Pro DC to rename all our invoices and make it easier for our Creditors team to find and service them.

 

The saving of files to a specific network folder is done manually, so that requirement is removed.

So our requirements are now:

 

1) Automate opening up each invoice and recognising information such as Invoice Number and Date using OCR

2) Batch rename all PDFs in the folder using the resulting OCR information to create the name in a specified format

 

We currently Use A-PDF Rename as follows:

1) Admin opens the app

2) Adim opens the folder in the app, hand-selects all the new invoices that have been added.

3) Runs a macro that allows the app to OCR each invoice and output Invoice Number, Date and Amount as a rename of the original file

4) The app identifies whether the rename has been successful with a green tick, or specifies an error with a red X

 

I've had a look at the Scan and OCR Tool in Acrobat DC Pro, and while it will batch rename files in a folder, it does not seem to be able to do so using information extracted from these files.

 

Is it possible to build a custom tool that might do this for us? If so, can anyone point to the options I could use?

 

Your help would be appreciated!

Thanks

Stephen Kane

 
 

Topics

 
Edit and convert PDFs,How to,Scan documents and OCR
Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
May 8, 2020

Searching for and Extracting data from a PDF page is on the more advanced side of Acrobat scripting.  Use the "doc.getPageNthWord()" function.  You'll find some post that discuss this function on this forum. 

Here's the reference entry:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_methods.htm%23TOC_getPageNthWordbc-54&rhtocid=_6_1_8_23_1_53 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
Community Expert
May 6, 2020

I've written many scripts for extracting data from scanned PDFs, so there is no problem with performing this part of your process in Acrobat with a script. But front end (automatically saving PDF email attachments to a network folders) and the back end (renaming the files) require an external tool. 

 

I don't know which of the A-PDF tools you are using, but I don't see a complete solution for what you need. 

If you're email is MS Office, then this process could be automated with an MS Office script. Such a script can "talk" to Acrobat to perform the PDF specific issues.  

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
May 6, 2020

This might be possible with an Action that first OCRs the files and then uses a script (assuming the results of the OCR were good, of course), but it can't actually rename a file. It can only save a new copy of it under the new name.

SKITDAuthor
Participant
May 7, 2020

Thank you!

This looks like a good option, as I would recommend they save new files into one folder and then copy them to another.

 

Any pointers on how I could build teh script?

 

I have no scripting experience at all...

Regards

Stephen