Link to home
Start Free TrialLog in
Avatar of Tim Stutzman
Tim Stutzman

asked on

Printer Script to Insert Current Date/Time on Print Job?

I'm looking for a printer script or some other solution that might allow me to print the current date and time on each print job for a particular printer.  We're printing already-created PDF files, that's why we cannot add the date and time to the files themselves.  Is there some sort of printer script or other software solution that might allow me to do this?  If there is a printer script available to do this, how would I implement it?  I've never played with printer scripting before.

The printer is an HP Color LaserJet 1600.
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

If you print from within Acrobat, you can use Acrobat's JavaScript to add a form field, and add the current date and time to that form field just before the document gets printed.

Are you printing with the full version of Acrobat? Do you know how to program in JavaScript?
Avatar of Tim Stutzman
Tim Stutzman

ASKER

We are printing from within Acrobat (the reader).

The PDFs that are printed are created with SoldPrintPDF from a combination of drawing files and Internet Explorer printouts.  There are literally hundreds of them, and they need to be created on the fly, so editing anything within the documents themselves, unless it is entirely automatic, is out of the question.

I do know how to program in JavaScript though.  Not sure that that is any help anymore though.  Thanks for the suggestion at any rate... any more ideas?
Any other thoughts on this?  We could really use a solution...
The problem is that any JavaScript that could add a date stamp would need to be part of the PDF document. If you can manage to add the JavaScript at the time of document creation (or via an automatic step afterwards), you could use this approach:

http://www.planetpdf.com/developer/article.asp?ContentID=AddingdynamicstampstoPDFswhenprinting

Is there another way, besides javascript, to do this?  The PDF files are created by printing to a PDF printer from Internet Explorer, so anything added to the document would need to be done then.

Is there some sort of modification we can do to the printer itself to put a time-stamp on each page that gets printed?
You can create a special print queue that filters all files by first sensing if you are printing a PDF file, and if that's the case, running a program to add a stamp on the document. I only have experience doing this with Unix based print servers, but I would assume that it's also possible with a Windows server. You can use for example pdftk to stamp your files (http://www.accesspdf.com/pdftk/)
All that is printed off of that printer is PDFs, and they all need the timestamp on them, so a filter will not be necessary.  That's why I was suggesting looking into something that the printer itself might be able to do.

I took a good look at the pdftk software that you suggested, but it doesn't seem like it could add a dynamic date (updated each time the document is printed).  Is there a way to do that with this software?
Also, I forgot to mention that the system this printer is on is a Windows 2000 workstation, it is not a server.
I think you are right, pdftk does not support dynamic content: I just tried to stamp a document with a page that contained a dynamic text field. That text field never made it on the target page.

You could probably use a two step approach with pdftk: In the first step you would fill in a text field in a template PDF with the current date. The date would be wrapped in a FDF file (you can create a sample FDF with the generate_fdf pdftk command), you would also flatten the PDF in the same step. In the second step, you would then overlay the newly created PDF stamp file with the PDF document that needs to be printed.

pdftk is based on a toolkit that you can use to create your own application. If you find things that you cannot do with it, you can either use the pdftk sources and add the missing features, or use iText (the toolkit - http://www.lowagie.com/iText/) to create your own application (or, pay somebody to build such an application for you).

When I used the term "filter", I was using it in the context of a print queue, in which a filter is a program that will process every document printed to that queue to do something with that document. This can e.g. be to add a stamp to a document, to reorder pages, ...

There are probably a number of 3rd party tools that can create dynamic stamps on your PDF pages, but I'm not familiar with anything that would work in your environment


ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial