Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Script for printing 4-up with page numbers

Community Beginner ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Hi,

I want to be able to print a multipage pdf 2 by 2 (like you can in Acrobat) but with the filename and page number beneath each page. I have some software development experience but this is my first script that I am writing so I don't know how to do this correctly.

 

The initial setting is that the pdf is already open in Acrobat. I was thinking about making a folder level script so the user can be able to choose "Print 4-up..." from the file menu, directly beneath the default "Print" menu item. What I ideally want is the file to stay open and no prompting for saving the file when the user should close it. This is the biggest difficulty that I have to write the script.

 

My first idea was to open a second instance of the open file but hidden, then resize the pages so I can add the text beneath each page and then trigger the default n-up printing process of Acrobat. Now it doesn't seem to be possible to open two instances of the same document because calling closeDoc() closes the open document that is visible for the user. Do I really need to save a second copy of the file to make the changes? Because, if true, I want to delete it after it was printed and I'm not sure if it is allowed.

TOPICS
JavaScript

Views

41

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 1 Correct answer

Adobe Community Professional , Jul 26, 2021 Jul 26, 2021
To avoid the save prompt use: this.dirty = false;

Likes

Translate

Translate
Adobe Community Professional ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

To avoid the save prompt use:

this.dirty = false;

 

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
Community Beginner ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

LATEST

Did not know that one existed. At the end of my script I can undo all my changes and then set the dirty state to false. This way the user will see the original document state. That was the missing piece. Thank you!

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