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

Script for printing 4-up with page numbers

Community Beginner ,
Jul 26, 2021 Jul 26, 2021

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
876
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
1 ACCEPTED SOLUTION
Community Expert ,
Jul 26, 2021 Jul 26, 2021

To avoid the save prompt use:

this.dirty = false;

 

View solution in original post

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

To avoid the save prompt use:

this.dirty = false;

 

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

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