Solved

How do I put a timestamp on a PDF file each time it is printed..?

Posted on 2004-04-01
7
524 Views
Last Modified: 2010-05-18
i want to fire a  event, when ever there a print there should be a date stamp. I think this can be done using a javascript. though i found a code for it i dont know how to call every time a document is printed.

thnx
0
Comment
Question by:agsingh2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10736819
Which version of Acrobat do you have?
0
 

Author Comment

by:agsingh2000
ID: 10736848
its version 5
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10737192
Open the PDF file that you want to print the time stamp on.
In Acrobat 5 select the menu "Tools>JavaScript>Set Document Actions". This will bring up the "Document Actions" dialog. Here you can assign JavaScript programs to certain events (Document Will Close, Document Will Save, Document Did Save, Document Will Print and Document Did Print).

Select the "Document Will Print" entry and click on "Edit". In the editor, paste the following script:

 for (var i = 0; i < this.numPages; i++)
     {
          // get the crop box for the page
          var aRect = this.getPageBox("Media", i);
          var width = aRect[2] - aRect[0];
          var height = aRect[1] - aRect[3];

          // create the form fields for all pages
          var fieldPos = [width-144, height-72, width, height];
            var f = this.addField(String("Received"), "text", i, fieldPos);
            f.textSize = 12;
            f.textColor = color.blue;
            f.fillColor = color.transparent;
            f.textFont = font.HelvB;
            f.borderStyle = border.s;
           f.strokeColor = color.transparent;
          f.value = stamp;
     }


Then select "Document Did Print", and add the following script:

// remove today's date
for (var i=0; i<this.numPages; i++)
{
    this.removeField("PrintedDate");
}

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:agsingh2000
ID: 10743096
i have a similar code, but the problem is i dont want the users to always change the settingsin acrobat reader. Can this be done in some way that its automatic. So irrespetive of pdf document when ever there is a print even this code is fired.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 10743501
JavaScript only allows this on a per job basis. If you need something that always works, you need to write (or have somebody write) a plug-in. In your last comment you mention Reader. A Reader plug-in unfortunately requires that you get a license from Adobe (either $1000 or $2500, depending on how you will use or distribute the plug-in).
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10898648
Does this answer your question?
0
 

Author Comment

by:agsingh2000
ID: 10900432
not exactly. I had the similar code that you gave me. But it seems that what i want cannot be achieved by javascript.
i am giving you the points for letting me know.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question