Solved

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

Posted on 2004-04-01
7
513 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now