Get user's print params from the print dialog box with Javascript.

New Here ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

I have created a print stamp that postions a date to the document when printing. Because the document contains different size pages, to make the postion of the print stamp consistent across all of the pages, I have used a  for loop to create print stamps accross all of the pages when the document is printed.

The problem is it slow to process the print request this way for large documents. The type of documents that will be printed are 100 to 300 page PDFs of which the user will most likely only be printing between 2 to 10 pages of their choice.

I want the script to make the print stamp only for the pages that the user selects in the print dialog box to save processing time in large documents. How can I get hold of these params using Javascript in Adobe Acrobat?

TOPICS
How to , JavaScript , PDF forms , Print and prepress

Views

46

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
community guidelines

correct answers 2 Correct answers

Adobe Community Professional , Jul 19, 2022 Jul 19, 2022

You can't read the parameters from the print dialog with Javascript.

Likes

Translate

Translate
Adobe Community Professional , Jul 19, 2022 Jul 19, 2022

You can't. The only way to do that is to prompt the user to enter the page range they want to print before opening the Print dialog, then watermark those pages, and then open that dialog for them, and pre-populate the Pages field in it. This can only be done if they use a button you add to your file to print it. You can't do it if they use the built-in File - Print command, nor can you prevent them from changing that range, if they wanted to.

Likes

Translate

Translate
Adobe Community Professional ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

You can't read the parameters from the print dialog with Javascript.

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
community guidelines
Adobe Community Professional ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

LATEST

You can't. The only way to do that is to prompt the user to enter the page range they want to print before opening the Print dialog, then watermark those pages, and then open that dialog for them, and pre-populate the Pages field in it. This can only be done if they use a button you add to your file to print it. You can't do it if they use the built-in File - Print command, nor can you prevent them from changing that range, if they wanted to.

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
community guidelines