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

Creating Wizard in PDF

New Here ,
Dec 06, 2019 Dec 06, 2019

Dear experts

I have thousands of pdf files and I want to save onlt the 2 pages of each file and export the shortened file to excel. 

I use this java script   

   this.extractPages(0.1); 

It cuts by files but creates a .tmp file with the 2 pages. 

I am trying to add the save app from Save and Export, but it does not execute both commands together (the java script and the export). 

What should I do??

Thank you, Giora

  

TOPICS
Create PDFs
385
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 ,
Dec 06, 2019 Dec 06, 2019

Are you doing it as a part of an Action?

If so, you can instead delete pages 3-last page, then export the file (this can also be done with a script), then close the original without saving it. The basic code for it would be something like this:

 

this.deletePage(2, this.numPages-1);

this.saveAs(this.path.replace(".pdf", ".xlsx"), "com.adobe.acrobat.xlsx");

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 ,
Dec 06, 2019 Dec 06, 2019
LATEST

Use following code:

if (this.numPages > 2) {
  this.deletePages({nStart: 2, nEnd: this.numPages-1});
  this.dirty = false;
}
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