Skip to main content
Participating Frequently
June 12, 2021
Question

Acrobat Javascript OCR Example

  • June 12, 2021
  • 3 replies
  • 3898 views

I am looking for a Javascript example that executes OCR on a scanned document. I am having trouble finding the document methods that perform that and other Acrobat actions on a PDF document.

 

Thanks

This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
Community Expert
June 20, 2021

Yes, but this is a setting that is well hidden (and not available for PNG and JPEG formats): 

 

Acrobate du PDF, InDesigner et Photoshopographe
rjabendAuthor
Participating Frequently
June 20, 2021

Is it ever lol, but it also appears it can be set for many file formats other than tiff. Thanks again!

gary_sc
Community Expert
Community Expert
June 20, 2021

(Thanks JR Boulay for that screenshot!)

 

Actually no. If you want automatic OCR-ing without a second step, you have to scan into the TIF format. Try it and see: if you scan into PNG or JPG, Acrobat will convert into a PDF but then it stops. To proceed with the OCR process, you then need to go into the Scan & OCR Tool, and then select the appropriate option for recognizing text

 

gary_sc
Community Expert
Community Expert
June 12, 2021

Hi rjabend,

 

I am sorry but I do not do any scripting so I cannot answer your question. HOWEVER, if you scan a document and save it as a png, or jpg, after converting that document to a PDF, you then have to go do an extra step to do the OCR process. On the other hand, if you save that document as a TIF, when opening that document in Acrobat, it will convert the document to a PDF AND also self-initiate the OCR process.

 

Just a small tip that might help you.

rjabendAuthor
Participating Frequently
June 12, 2021

Nice tip! I was not aware of that. Thanks!

Legend
June 12, 2021

There is no guarantee that JavaScript offers all the features of Acrobat. So you will find countless things you can only do manually.

rjabendAuthor
Participating Frequently
June 12, 2021

Can OCR be executed in Javascript? I am not looking for a "guarantee", just whether or not it is possible.

try67
Community Expert
Community Expert
June 12, 2021

No.