Skip to main content
Known Participant
June 27, 2023
Question

Adobe Acrobat Pro DC goes to Not Responding

  • June 27, 2023
  • 1 reply
  • 1315 views

Hello Adobe Experts,
I am using the below JS Code in "Adobe Acrobat Pro DC" to Extract the Text Content From the PDF File. Using String Concatenation (word by word), I am trying to get the whole text content of the pdf in "docText" variable. But after the alert, the Application goes to "Not Responding" where I am struggling and iritating a lot. I tried almost all the setting changes (explored from google/forum). Is there any special settings I have to make or Is there any other way to extract the text content from the PDF.
For your information:
We are using "Adobe Acrobat Pro DC" in remote servers.
The same code works perfectly in "Adobe Acrobat X Standard".
The pdf is a scanned pdf processed through Abbyy OCR.

Please help me in detail. Thanks in advance.

Code Executed from Console Window (Even in Folder Level Script also Same Issue) :
for (var pg = 0; pg < this.numPages; pg++) {
   var pageText = "";
   for (var w = 0; w < this.getPageNumWords(pg); w++) {
      pageText = pageText + this.getPageNthWord(pg, w, false) + "\r\n";
   }
   docText = pageText + "========================================\r\n" + docText;
}
app.alert("Process Completed");

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
June 27, 2023

You never defined the docText variable, but that should only cause an error, not cause the application to freeze.

How big is the file you're trying to process? How long did you wait for when it "froze"? This kind of operation can take a while, especially wiht large files.

ThuyavanAuthor
Known Participant
June 28, 2023

Oops, I missed the first line "var docText = ""; when I copy the code. Even though I defined that variable still i m facing the issue. The document is having 88 pages. My concern is this code works and takes just 15-20 seconds to complete without any issue in Adobe Acrobat X Std. But not in Adobe Acrobat Pro.

try67
Community Expert
Community Expert
June 28, 2023

It should work... Can you share the file in question?