So I already have some code that I found in these forums that works. Just trying to make it a bit better if possible.
I just want to extract a certain number of pages (in my script below I am extracting the first three) from a batch of PDF's, and have them saved as "Extracted OriginalFileName.pdf". So far so good. So here is that code:
var oldDoc = this; var newDoc = oldDoc.extractPages(0,2); newDoc.saveAs(oldDoc.path.replace(oldDoc.documentFileName, "Extracted " + oldDoc.documentFileName));
I did some searching, trying to find other simple scripts that behaved the same way, or other extraction scripts that might give me a clue as to what I might need to fix this relatively small issue and I have come up empty.
If someone could point me in the right direction I would appreciate it.
Instead of using the saveAs method you can specify the file-path directly as the third parameter of the extractPages method.
Wow I feel dumb. I thought I had unchecked that "prompt user" box but I had not. Thank You.
Would using the file path method keep the files from opening as they are created?
I think so, yes. If not you can always call the closeDoc method on newDoc...