Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Extract one page in PDF document automatically

New Here ,
May 31, 2018 May 31, 2018

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,

TOPICS
Edit and convert PDFs

Views

2.0K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , May 31, 2018 May 31, 2018
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.

Likes

Translate

Translate
Adobe Community Professional ,
May 31, 2018 May 31, 2018

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?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2018 May 31, 2018

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,

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

Do you have Acrobat DC Pro or Standard?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

Adobe Acrobat Pro DC (versión 2018.011.20040)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 31, 2018 May 31, 2018

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2018 May 31, 2018

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,

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 31, 2018 May 31, 2018

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).

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2018 Aug 20, 2018

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!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 20, 2018 Aug 20, 2018

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2018 Aug 20, 2018

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Execute menu? No, you need to set it to "Run a JavaScript" with that code.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Sorry, yes it' "Run a JavaScript".

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 20, 2018 Aug 20, 2018

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2018 Aug 20, 2018

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Can you share the file with us (via Dropbox, Google Drive, Adobe Send & Track, etc.)?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Sure.  Where can I send it to?  Would you be able to provide you email address?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 20, 2018 Aug 20, 2018

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 .

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2018 Aug 20, 2018

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.

Shared Files - Acrobat.com

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 20, 2018 Aug 20, 2018

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2018 Aug 20, 2018

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Remove the last comma as well.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2018 Aug 20, 2018

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

LATEST

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?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines