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

Use app.execMenuItem("SaveAs"); script to save all pages of the pdf except for the 1st page.

Engaged ,
Jun 28, 2020 Jun 28, 2020

Copy link to clipboard

Copied

I want to save a pdf file via button using the app.execMenuItem("SaveAs");  but I want to exclude the first page of the file and save the remaining pages.    this .extractPages() doesnot work with Reader.. thatswhy want to use the Menuitem but want to exclude the 1st page.  In other words i want a method which will save the file (except for 1st page) in adobe reader.

 

Below is the script i am using in the button field  for deleting the first page and using menuItem to save it but it is not working in reader.

this.deletePages(0);
app.execMenuItem("SaveAs");

 

Plz guide.

 

Thanks

TOPICS
Acrobat SDK and JavaScript

Views

3.0K

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
LEGEND ,
Jun 28, 2020 Jun 28, 2020

Copy link to clipboard

Copied

Saving will save the whole file, by definition. Adobe really want to sell Acrobat to everyone for this kind of job.

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
Engaged ,
Jun 28, 2020 Jun 28, 2020

Copy link to clipboard

Copied

I just checked  app.execMenuItem("SaveAs") is also not working in adobe Reader

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
Community Expert ,
Jun 28, 2020 Jun 28, 2020

Copy link to clipboard

Copied

That should work, but the deletePages command will not (unless that page was spawned from a Template)...

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
Engaged ,
Jun 28, 2020 Jun 28, 2020

Copy link to clipboard

Copied

Yes, the pages are spawned from a template.. delete pages comman is working but the app.execMenuItem("SaveAs") not working.... If  you can tell me a method via which both  1st page is deleted and then the file can be saved when used in Adobe reader

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

Does it work in Adobe Acrobat?

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

"SaveAs" is working for me in Reader XI.

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

SaveAs works when you make the file READER EXTENDED.... but since i am also using template scripts so i cannot save it as reader extended .. in that case saveas doesnot work it only works when you save it as reader extended

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

No, even without it it works, if you use a relatively new version of Reader (XI or higher, I believe).

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

I have adobe reader dc 2020.009.....  and it doesnot work if i use it without reader extended .... it works fine when i save the file as reader extended

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

 :... if you can make the saveAs work without reader extended

what i want is when the user select the dropdown only the corresponding pages (template method),  after that on clicking the button only the country pages(it can be multiple pages, here it is of only 1 page)  should be saved not the cover page..

 

 

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

Like I wrote, it worked fine for me. I don't see where you have this code in your file. If you send it with the code I could test it (again). You used extractPages, which won't work in Reader.

 

And you can't spawn from an array, but you can use a for-loop (with or without an array) to issue multiple spwan commands, sure.

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

ok can i SaveAs a file with specific pages only .. like if i have 11 pages file and using app.exeMenuItem("SaveAs") save only specific pages.......

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

No.

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

then what methods should i use so that i have template spawing plus  saving the pdf file with specific pages in reader

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

But the first page in your file is not spawned from a Template (the other pages are). Therefore, it can't be deleted in Reader.

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

ok how about the print method.......... once the templates are spawned via dropdown.. and from button run the print() method .... to print (to pdf using pdf printer) all the pages except first page  how to do it. I know to print specific pages ex : this.print(false, 1) this prints the second page.. but how to print all pages except for first page since the  no. of spawn will vary;

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

Reader doesn't come with the PDF printer, either, but it's possible they could have another printer that will do it (although you can't count on it). Anyway, you can do it like this:

this.print({nStart: 1, nEnd: this.numPages-1});

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

I don't want to show the print dialog box... in this script this.print({nStart: 1, nEnd: this.numPages-1});   i changed it to this.print(false, {nStart: 1, nEnd: this.numPages-1});

but doesnot work

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

ok got the print script to work without print dialog box this.print(false, 1, this.numPages-1);

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

Also how to delete the spawned pages before if the next dropdown option is selected.. plz refer to my file ...... like user chooses INDIA then it spawn the INDIA page but when the user changes the option to USA, then it should delete the INDIA page then spawn USA. this i was able to do when there was only 1 template for each country (see the pdf file i attached in the previous mssg)....  but when there the number of pages vary for each country then how to do it

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

this.deletePages(1, this.numPages-1);

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

we already have pdf printer installed on computers .. so print method is no issue..

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

For now everything expected is working great  Thanks for your guidance.......

will post if i get stuck with something.

 

thanks

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
Engaged ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

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