Acrobat Javascript OCR Example
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
There is no guarantee that JavaScript offers all the features of Acrobat. So you will find countless things you can only do manually.
Copy link to clipboard
Copied
Can OCR be executed in Javascript? I am not looking for a "guarantee", just whether or not it is possible.
Copy link to clipboard
Copied
No.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Nice tip! I was not aware of that. Thanks!
Copy link to clipboard
Copied
I tried your suggestion and the resultant Acrobat PDF file is not OCR'd automatically. Is there a setting or something else I am missing?
Copy link to clipboard
Copied
Yes, but this is a setting that is well hidden (and not available for PNG and JPEG formats):
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
Is it ever lol, but it also appears it can be set for many file formats other than tiff. Thanks again!
Copy link to clipboard
Copied
(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
 
Copy link to clipboard
Copied
It appeared under BMP scanned optimization preferrences that OCR was possible. Thoughts?
Copy link to clipboard
Copied
Ah, well that adds to my education.
As a Mac user, BMP are kinda irrelevant so I'd not have thought to even look to see what options they provide. So my bad.
So yes, TIFs and BMPs (the latter for the PC inclined :>))
Thank you!
Copy link to clipboard
Copied
Thank you!! I gained considerable education from your reply!
Copy link to clipboard
Copied
"It appeared under BMP scanned optimization preferrences that OCR was possible. Thoughts? "
You can use any image format where this option is available since images will be discarded after OCR and PDF conversion (using JPEG2000 compression).
🙂
PDF Acrobatic, InDesigner & Photoshoptographer

