Skip to main content
Participant
October 31, 2018
Question

JavaScript help extract, combine and print non sequential pages

  • October 31, 2018
  • 2 replies
  • 476 views

I am looking to extract pages 7, 16, 17 of an 18 page document...and then combine them into one separate document.

At the moment I am using:

this.print({ nStart: [7 - 1], nEnd: [ 7 -1] });
this.print({ nStart: [ 16 - 1], nEnd: [ 17 - 1] });

Printing the pages and then combining them manually which is not great...

Any help would be greatly appreciated.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
October 31, 2018

There's no need to print them at all. Actually, it won't work if you do it.

The way to do it is to create a new document (using the newDoc method) and then insert pages from the old file into it (using the insertPages method). At the end of the process you delete the first page of the new file since it's a blank page added by default (using the deletePages method).

Participant
October 31, 2018

Thanks for your assistance. Very new to all this...are you able to assist with a code?

try67
Community Expert
Community Expert
October 31, 2018

Well, I've provided the basic structure of the code to do it. Do you have specific questions, or do you want me to write the whole thing for you? If the latter please contact me privately (try6767 at gmail.com) and we could discuss it in more detail, including the price.

Legend
October 31, 2018

See newDoc and insertPages.