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

Page Counter

New Here ,
Feb 16, 2017 Feb 16, 2017

Hi, how can I create an action, count the number of times a document is printed, and show in the document.

For example, I want to print a document 10 times and the document is of 1 page, So each page must exit with the numbering 1/10, 2/10, 3/10 ...

Thank you

TOPICS
Acrobat SDK and JavaScript , Windows
653
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 ,
Feb 16, 2017 Feb 16, 2017

You can do it with a simple loop. Let's say the counter is a text field called PrintCounter. You can use this code to do it:

var max = 10;

for (var i=1; i<=max; i++) {

    this.getField("PrintCounter").value = i + "/" + max;

    this.print();

}

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
New Here ,
Feb 17, 2017 Feb 17, 2017

Ok. Now I have this script and I want to add this counter so that I can see the number printed on the document. How can i include it.

I want to delete the date and time and I only have "Page 1/X".1111.png

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
Community Expert ,
Feb 17, 2017 Feb 17, 2017

You just need to create a field called "PrintCounter". If you want you can then duplicate it to all the pages in the file.

You don't need to use a script for it, though.

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
New Here ,
Feb 17, 2017 Feb 17, 2017

yes I understand, but how can I print this number on the sheets

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 ,
Feb 17, 2017 Feb 17, 2017

The value of the text field will appear on the printed copy.

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
New Here ,
Mar 16, 2017 Mar 16, 2017

Hello, after many tests I still can not make me appreciate the number of copies in printed documents. I copied the code into an action like "document javascripts", but when printing the document, no print number information appears. What I can do?.

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
Community Expert ,
Mar 16, 2017 Mar 16, 2017
LATEST

Can you share the file, via Dropbox, Google Drive, etc.?

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 ,
Feb 16, 2017 Feb 16, 2017

You can't reliably do this. Even with a script, the user can easily change the number of copies to print in the print dialog and Acrobat never gets notified.

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