Timeout scripting Adobe Acrobat Pro

My script takes a large PDF file, it determines selected ranges of pages within that PDF file. For each range of pages, it deletes the pages after the range, then before the range, then does Save As as a new file of the range itself. It then closes the document. For the next range, it reopens the document and does the same thing until finished.

For an initial PDF with 200 pages, it runs ok. For an initial PDF with 5000 pages, it times out. I assume this PDF and the script are being run on the local workstation desktop, not across a LAN.

Question, is there something building up in the script that causes the timeout? Or any reasons for the timeout?

Thanks,
Bob R.

I’d be more suspicious about a problem with Acrobat. Try having the script quit and relaunch Acrobat after every x documents.

The problem appears to be the number of pages in the Acrobat file. The script works fine for a 200 page PDF, but becomes very slow for a 5000 page PDF. The task of opening the document, deleting lots of pages after and before the range is stalling the script out. I will have to break the original PDF file into smaller file pieces it appears.

Is there a way to script Acrobat to process the PDF without it showing the open original PDF document on the desktop?

thanks,
Bob R.

Do you mean open a document without displaying it? If so, the answer is no.

What is the ultimate destination of these PDFs?

The final destination of the Saved As PDF files are a folder on the local desktop that the script creates.

Everything is done on the local workstation Desktop: The original file is dropped onto the script, the script makes a local folder and saves the PDFs to it.

I am not understanding why the Acrobat Pro document stays open exceeding the default timeout limit when it starts with 5000 pages vs. 200 pages. In pre-OSX scripting, you could manually adjust the ram settings for apps and scripts, but not in OSX.

It’s not just a matter of RAM; deleting pages from PDFs can be quite a complex process under the hood.

What are these PDFs being used for? It might be possible to use something other than Acrobat Pro. Or you could try changing the timeout.

The PDF’s, once they are separated into new documents according to page count of sections, go to an industrial docutech type printer. The resolution of the file has to be unchanged.

Thinking maybe I am doing this backward. Instead of deleting after and before pages, copy the range of pages I want and save it as the new PDF. The problem is Acrobat Pro does not seem to work that way. It cannot just save a new blank PDF. I would have to start with an existing blank PDF I create, which is not a bad thing if thats the only way.

I changed the timeout to 5 min, and this works, just takes hours to process that way.

Or a single-page PDF, from which you delete the original page after adding the new ones.