Create a print button that will print a page range but only if data present?

New Here ,
Apr 20, 2020

Copy link to clipboard

Copied

Hello,

 

Can anyone tell me how to create a print button that will print a page range, but only if data present on the page?

 

Example:

I have a ten-page pdf. Page one is the data entry page with five data fields (A, B, C, D, E). Pages 2 through 10 are template forms.

 

Data entered into one or all of the data fields on page one populates pages 2 through 10. If I enter information into data fields A, B, and C, but leave D and E blank, there's no need to print all 9 pages, I only need to print pages 5, 6, and 9.

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

131

Likes

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

Create a print button that will print a page range but only if data present?

New Here ,
Apr 20, 2020

Copy link to clipboard

Copied

Hello,

 

Can anyone tell me how to create a print button that will print a page range, but only if data present on the page?

 

Example:

I have a ten-page pdf. Page one is the data entry page with five data fields (A, B, C, D, E). Pages 2 through 10 are template forms.

 

Data entered into one or all of the data fields on page one populates pages 2 through 10. If I enter information into data fields A, B, and C, but leave D and E blank, there's no need to print all 9 pages, I only need to print pages 5, 6, and 9.

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

132

Likes

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
Apr 20, 2020 0
Most Valuable Participant ,
Apr 20, 2020

Copy link to clipboard

Copied

This can be done using a script. You can compose an array of page numbers to print based on the values of the fields and then use that array as the printRange parameter of the PrintParams object when calling the print method of the document, if the array is not empty, of course.

Likes

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
Reply
Loading...
Apr 20, 2020 0
FDSc LATEST
New Here ,
Apr 27, 2020

Copy link to clipboard

Copied

Hello try67,

 

Thank you for the suggestion. My knowledge of arrays is limited. I'll research more and report back.

Likes

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
Reply
Loading...
Apr 27, 2020 0