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

Button to Email specific pages

Explorer ,
Jan 28, 2020 Jan 28, 2020

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

TOPICS
Create PDFs , Edit and convert PDFs , How to , PDF forms , Standards and accessibility
3.2K
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 ,
Jan 28, 2020 Jan 28, 2020

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.

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
Explorer ,
Jan 28, 2020 Jan 28, 2020

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.

 

Screenshot 2020-01-28 12.54.49.png

 

 

 

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 ,
Jan 28, 2020 Jan 28, 2020

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.

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
Explorer ,
Jan 28, 2020 Jan 28, 2020

Ok. So let's forget about 1B.

It seems like you're saying that 1 & 2 can be done. What about 3?

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 ,
Jan 29, 2020 Jan 29, 2020
LATEST

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

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