Copy link to clipboard
Copied
Hi, I have a PDF with about 20 documents, totaling around 60 pages.
the use case is that some of these documents need to be provided to a customer ... let's just say its page 43, 46-52.
Initially, my thought was to create a button that would extract all the relevant pages into a new PDF file and that could then be emailed. However, it seems that extract will not work for non-sequential pages.
So my second thought is to create a button that will email the above-mentioned pages. I'm hoping that the email command does not suffer from the same non-sequential limitations or others that would prevent me from doing this. Please help.
-Mark
Copy link to clipboard
Copied
The way to do it is to delete the pages you don't want to submit. However, you mentioned in your other thread that you want to do it in Reader, and that's not going to work there, either.
Copy link to clipboard
Copied
hmm... so extract everything than delete pages that are not needed... that's clever...
maybe we might have to rethink limiting it to reader... and get pro to simplify things.
assuming it's on Acrobat pro, what would the code be to:
1) Extract all pages...
1 B) newly extract file name should be "name of source file + Copy".. and not something like "Acr1234567543.temp"
2) Delete unwanted pages from extract
3) and ask to email via default email client. preferably, ...open/compose default email client with the new file as an attachment.
currently, the email button is a chepo "submit form" button. see image.
Copy link to clipboard
Copied
You can extract just the pages from the first one to the last, and then delete the ones you don't need in between.
However, specifying a file name for the extracted file requires running the code from a privileged context, such as a folder-level script.
Copy link to clipboard
Copied
Ok. So let's forget about 1B.
It seems like you're saying that 1 & 2 can be done. What about 3?
Copy link to clipboard
Copied
Yes, that's also possible. Here's the basic code that does it:
var newDoc = this.extractPages(42,51); // extract pages 43-52 as a new document
newDoc.deletePages(1,2); // delete pages 2 and 3 (corresponding to 44-45) from the new document
newDoc.mailDoc({cTo: "test@test.com"}); // mail the new document
newDoc.closeDoc(true); // close the new document
Find more inspiration, events, and resources on the new Adobe Community
Explore Now