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

pdf form extract last page and save

New Here ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

Hi

Im using Adobe Acrobat Pro DC Version 2015.023.20053 on Windows 10

I would like - based on a 2 page pdf form (the first page is the input page the second page ist the output page) to extract the second page and save it based on fields of the first page.

extracting works as following:

on the button "extract and save as" in the Action tab, run javascript

this.extractPages({nStart:1});

this extracts the correct page as a tmp file.

so far so good.

how do I add (1) name and (2) path, to the extracted page and save it under the name, based on fields from the first page?

(1)   name: lastname_firstname.pdf

        lastname = textfield on first page

        firstname = textfield on first page

(2)   path: /s/flie-server/Tech-support/"region"

        "region" = dropdownfield of the first page and existing folder in /s/flie-server/Tech-support/

(3)   close the extracted pdf

i allready searched the library but could't find a spesific quetion/answer

best regards

beat

TOPICS
Acrobat SDK and JavaScript , Windows

Views

273

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 Expert ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

LATEST

Are you running this code from a button that you added to the application, or from the PDF file itself?

If the latter you won't be able to do it without a script that's also installed on the local machine.

Basically, you would need to specify the cPath parameter of extractPages, like this:

var newFilePath = "/s/flie-server/Tech-support/" + this.getField("region").valueAsString + "/" +

     this.getField("lastname").valueAsString + "_" + this.getField("firstname").valueAsString + ".pdf";

this.extractPages({nStart:1, cPath: newFilePath});

Votes

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