Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Adding Printed Date to PDF Files
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Adding Printed Date to PDF Files

 Post Reply Post Reply
Author
ashleyayling View Drop Down
New Member
New Member


Joined: 28 Nov 2011
Points: 3
Post Options Post Options   Quote ashleyayling Quote  Post ReplyReply Direct Link To This Post Topic: Adding Printed Date to PDF Files
    Posted: 28 Nov 2011 at 11:05am
Good Morning,
 
I am looking for a method to have the current date automatically stamped or included on a PDF when it is printed.
 
For example, "This document will expire 7 days from X." or something similar.
 
I have a full version of Adobe Acrobat 7, and I have tried using javascript to add a watermark on the documents open.  This works fine when opened in Acobat, but the majority of users will only be using Adobe Reader and I require it to be generated using that as well (without Acrobat installed).
 
Any help would be greatly appreciated.
 
Regards.
Back to Top
Sponsored Links


Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 617
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 28 Nov 2011 at 11:21am
You can use a simple text field. Set its visibility to "Hidden but printable" and under the Calculate tab, enter this code as the custom calculation script:

event.value = "This document will expire 7 days from " + util.printd("mm/dd/yyyy", new Date());

You can change the date format if you wish, of course.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4076
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 29 Nov 2011 at 3:47pm
You may have a problem since the date is added when the form if opened and not printed.
 
I would add form field, hidden but printable, and in the 'Will Print" action add:
 
// change format for display format
var cPrintFormat = "mm\dd\yyyy";
// get current date
var oNow = new Date();
// set string to display - modify as needed
var cText = "This document will expire 7 days from " + util.printd(cPrintFormat, oNow);
// set filed value:
event.value = cText;
Back to Top
ashleyayling View Drop Down
New Member
New Member


Joined: 28 Nov 2011
Points: 3
Post Options Post Options   Quote ashleyayling Quote  Post ReplyReply Direct Link To This Post Posted: 30 Nov 2011 at 4:47pm
Many thanks for your help, greatly appreciated.  I have tested this and it seems to be working great!
 
Is there any way that this can be applied to a group of douments via batch processing or a script?  I have 500 documents, and do not really want to sit there adding and positioning form fields manually to them all!
 
Any help is greatly apprecaited.
 
Regards.
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4076
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 30 Nov 2011 at 9:35pm
Yes, but you will want to add some script to add a form page and the will print action. You most likly will want to compute the location of the form field based on the page crop box. You will also have to review all the modified forms to make sure the form fields are working, not conflicting with existing form fields, and the fields are not rotated.
Back to Top
ashleyayling View Drop Down
New Member
New Member


Joined: 28 Nov 2011
Points: 3
Post Options Post Options   Quote ashleyayling Quote  Post ReplyReply Direct Link To This Post Posted: 03 Jan 2012 at 12:30pm
Many thanks for your help.  Could you possibly tell me how I would create a script that would add this to the page or point me in the right direction?
 
I have tried to work this out myself but to no avail :(
 
Any help would be greatly apprecaited.
 
Regards.
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4076
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 2015 at 7:48pm
The OP is concerned about the users with Reader being able to add the WaterMark.

Does your product work with Adobe Reader?

Would each user need to purchase your product?


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.016 seconds.