Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Extract one page in PDF document automatically

New Here ,
May 31, 2018 May 31, 2018

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
8.2K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
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.

View solution in original post

Translate
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 Expert ,
May 31, 2018 May 31, 2018

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?

Translate
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

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,

Translate
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 Expert ,
May 31, 2018 May 31, 2018

Do you have Acrobat DC Pro or Standard?

Translate
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

Adobe Acrobat Pro DC (versión 2018.011.20040)

Translate
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 Expert ,
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.

Translate
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

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,

Translate
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 Expert ,
May 31, 2018 May 31, 2018

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

Translate
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
Explorer ,
Aug 20, 2018 Aug 20, 2018

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!

Translate
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 Expert ,
Aug 20, 2018 Aug 20, 2018

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.

Translate
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
Explorer ,
Aug 20, 2018 Aug 20, 2018

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. 

Translate
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 Expert ,
Aug 20, 2018 Aug 20, 2018

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

Translate
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
Explorer ,
Aug 20, 2018 Aug 20, 2018

Sorry, yes it' "Run a JavaScript".

Translate
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 Expert ,
Aug 20, 2018 Aug 20, 2018

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.

Translate
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
Explorer ,
Aug 20, 2018 Aug 20, 2018

I'm using Acrobat and no, I don't see a new file on the folder of the original file.

Translate
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 Expert ,
Aug 20, 2018 Aug 20, 2018

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

Translate
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
Explorer ,
Aug 20, 2018 Aug 20, 2018

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

Translate
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 Expert ,
Aug 20, 2018 Aug 20, 2018

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 .

Translate
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
Explorer ,
Aug 20, 2018 Aug 20, 2018

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

Translate
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 Expert ,
Aug 20, 2018 Aug 20, 2018

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.

Translate
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
Explorer ,
Aug 20, 2018 Aug 20, 2018

Sorry, by removing the path the code will be as such?  "this.extractPages(0, 0, );"

It gives a syntax error. 

Translate
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 Expert ,
Aug 20, 2018 Aug 20, 2018

Remove the last comma as well.

Translate
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
Explorer ,
Aug 20, 2018 Aug 20, 2018

It works.  Thanks a lot for your patience.  I'm just starting to use this JS and still finding my way.

Translate
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
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?

Translate
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