Copy link to clipboard
Copied
Dear all,
I need extract the first page in one PDF document and then save it in a new PDF document. It is necessary to do it automatically
I have Adobe Acrobat DC. Can you help me, please?
I don't know if I need to know java or other programing language
Thanks in advance
Regards,
OK, then go to Tools - Action Wizard, create a new Action that executes this JavaScript code:
this.extractPages(0, 0, this.path.replace(/\.pdf$/i, "_p1.pdf"));
Then run it on your files and the first pages will be extracted into the same folder as the originals.
Copy link to clipboard
Copied
Do you want to do it to one file, or multiple files?
Do you want to save the extracted page, or just extract it as a new document?
Copy link to clipboard
Copied
Hello,
I need to do with multiple files in one directory
I could erase the original document if it were the only way But, if it is possible, I prefer to preserv the original document in the directory
Thanks
Regads,
Copy link to clipboard
Copied
Do you have Acrobat DC Pro or Standard?
Copy link to clipboard
Copied
Adobe Acrobat Pro DC (versión 2018.011.20040)
Copy link to clipboard
Copied
OK, then go to Tools - Action Wizard, create a new Action that executes this JavaScript code:
this.extractPages(0, 0, this.path.replace(/\.pdf$/i, "_p1.pdf"));
Then run it on your files and the first pages will be extracted into the same folder as the originals.
Copy link to clipboard
Copied
Ok, thank you for support
Can I insert it in a .bat file or similar command line instruction?
I need to do all the process automatically. Without open Adobe manually to press the new Action
Thanks
Regards,
Copy link to clipboard
Copied
You can't do that with Acrobat. It is possible to do it using a stand-alone command-line utility, though.
If you're interested in purchasing such a tool feel free to contact me privately (try6767 at gmail.com).
Copy link to clipboard
Copied
Hi try67,
I have the same problem as above, i.e., extracting and saving page 1 of a fillable pdf to be sent to a supplier. I tried to copy your code but when I click the button it doesn't do anything. I'm also using Acrobat Pro DC. Am I missing something?
Thanks in advance!
Copy link to clipboard
Copied
I don't know... What happens when you run the code? Are there error messages in the JS Console?
Also, running this code will only cause the page to extract as a new file. It won't open it or anything like that.
Copy link to clipboard
Copied
There's no error message. The button does click but it doesn't extract page 1 as a new page. I copied and pasted the following code on JS editor: mouse up > execute menu
this.extractPages(0, 0, this.path.replace(/\.pdf$/i, "_p1.pdf"));
Extract as a new file without opening the file is fine with me.
Copy link to clipboard
Copied
Execute menu? No, you need to set it to "Run a JavaScript" with that code.
Copy link to clipboard
Copied
Sorry, yes it' "Run a JavaScript".
Copy link to clipboard
Copied
After clicking the button check the folder where the original file is located. Do you not see a new file there?
Also, in what application are you opening the file? It will only work in Acrobat, not Reader.
Copy link to clipboard
Copied
I'm using Acrobat and no, I don't see a new file on the folder of the original file.
Copy link to clipboard
Copied
Can you share the file with us (via Dropbox, Google Drive, Adobe Send & Track, etc.)?
Copy link to clipboard
Copied
Sure. Where can I send it to? Would you be able to provide you email address?
Copy link to clipboard
Copied
I was suggesting you make it public, but if you want to send it to me privately you can do so to try6767 at gmail.com .
Copy link to clipboard
Copied
Sorry, didn't even realized that. Here's the link for the file and thanks a lot for taking the time.
Copy link to clipboard
Copied
Not sure why, but it's not working when you specify the path. Remove that part and try it again.
It should open the page as a new (temporary) file, which the user will then need to save.
Copy link to clipboard
Copied
Sorry, by removing the path the code will be as such? "this.extractPages(0, 0, );"
It gives a syntax error.
Copy link to clipboard
Copied
Remove the last comma as well.
Copy link to clipboard
Copied
It works. Thanks a lot for your patience. I'm just starting to use this JS and still finding my way.
Copy link to clipboard
Copied
I know this is an old thread, but how would you run this same thing but have them all become one file instead of multiple files?