I am writing a function that extracts some pages from a document so it can be used as proof. I have used a switch case that if it is true will output some pages. In the third case I want to extract the first two pages of the document, the 23rd and 24th and the two last pages. This is what I cant solve. Can I just use the this.extractPages method or do I have to use the insertPages method also. If I need the insertPages method how do I use it. The code is inside a trusted function.
case this.numPages == 1:
app.alert("A one paged proof has been created",3)
case ( (this.numPages > 1) && (this.numPages < 9) ):
app.alert("A two paged proof has been created",3)
(PROBLEM IS HERE)
case ( (this.numPages > 9) && (this.numPages < 49) ):
app.alert("A proof has been created",3)
app.alert("No proof has been created",3)
In the third case, you'd need to extract the three parts separately, save to disk separately, then and stitch them back together leaving a bunch of smaller files that Acrobat can't delete. You're better off just deleting the pages you don't need from the source and then saving to a new file.