I have a folder with 2000 PDF files. Is there a way using Javascript to extract the first page of all PDF files in one folder and then save those individual extracted PDFs to another folder?
I have thought of two approaches to this because my folder with 2000 PDF files contains many files that only have one page.
1) Somehow find a way to determine the PDF files with more than one page, then run a script to extract and save the first page of every PDF with > one page i.e., to another folder.
2) Run a javascript in Adobe Acrobat XI to extract the first page of all 2000 PDF files in my folder and save the resulting PDFs to another folder.
I wish if possible to do this without all 2000 PDF windows opening up during the process---which will no doubt crash my computer if I try to do this will all 2000 PDF files!
So far, I have tried using the Action Wizard which carries out 3 steps:
Execute JavaScript:
- this.extractPages(0);
Delete pages:
- from 2 to 3
Save
- Add to original file name a "1" after the original file name
- Output: PDF
If I do it like this, all the files within my folder start to open. I ended the task before anything like 2000 PDFs were opened. Also, this delete option failed as it seems to be specific?
Does anybody know of a way to achieve the extraction of the first page of multiple PDF files followed by the saving of the extracted PDF files to another folder?
Kind regards,
Doug.
