Skip to main content
carlosp87181292
Participating Frequently
March 20, 2017
Question

Good morning, i´v managed to create a custom stamp date...but i need the stamp to print the original date of creation of the document, stated on is propoerties...not the actual date or the date the doc was moved or copied...Thanks in advance

  • March 20, 2017
  • 5 replies
  • 1690 views

Good morning, i´v managed to create a custom stamp date...but i need the stamp to print the original date of creation of the document, stated on is properties...not the actual date or the date the doc was moved or copied...

var strMsg = util.printd("ddd, mmmm dd, yyyy",this.creationDate);

strMsg += " at " + util.printd("h:MM:ss tt", this.creationDate);

this.getField("DateCreation").value = strMsg;

What i am doing wrong?

Thanks in advance

This topic has been closed for replies.

5 replies

carlosp87181292
Participating Frequently
March 23, 2017

Hi all,

hank you for the support....i´v  managed creating a simple stamp with the sript code

event.value = (new Date()).toString(); AFDate_FormatEx("h:MM tt, mmm dd, yyyy");

not the creation date but the actual date....

now i´m tryng to do this task:.

every doc shows the date when is printed. (ex: this doc was printed on xx.xx.xxxx)

what is the best solution (adobe acrobat dc)

after a few tests i have a doc that is working....i tought that it was with the code

var inch = 72;
for (var p = 0; p < this.numPages; p++) {
var aRect = this.getPageBox( {nPage: p} );
aRect[1] = .5*inch;
aRect[3] = aRect[1] - 24; // and 24 points high

var f = this.addField("PrintField", "text", p, aRect )
f.delay = true;
f.textSize = 16;
f.textFont = font.HelvB;
f.textColor = color.black;
f.alignment = "center";
f.readonly = true;
f.display = display.noView;
f.delay = false;
}

var myWillPrintScript = 'var f = this.getField("PrintField"); \r'
+ 'f.value = "This document was printed on " + util.printd("m/d/yyyy hh:MM", new Date());

put it in javacript action " this document was printed on"

but trying to do with another doc and it is not working...

Please somebody help me

try67
Community Expert
Community Expert
March 23, 2017

Not working, how? You need to provide details if you want help.

On Thu, Mar 23, 2017 at 7:00 PM, carlosp87181292 <forums_noreply@adobe.com>

Inspiring
March 21, 2017

You can create a simple button with a Javascript on it that can be copied from one file to the other.

The javascript have to contains the next code:

Source: https://acrobatusers.com/tutorials/date_time_part2

I hope it helps

Good luck

Patrick

carlosp87181292
Participating Frequently
March 21, 2017

Hi,

i´v tried just as you sugested but with no results....is this correct?

var strMsg = util.printd("ddd, mmmm dd, yyyy",event.source.source.creationDate);
strMsg += " at " + util.printd("h:MM:ss tt", event.source.source.creationDate);
this.getField("DateCreation").value = strMsg;

Thank you

try67
Community Expert
Community Expert
March 21, 2017

Yes, but without seeing the actual stamp file I can't help you further, I'm afraid.

carlosp87181292
Participating Frequently
March 21, 2017

Good morning,

Sorry if i did not explain it well.....basically i work for a company in Portugal. One of our customers wants to purchase adobe acrobat dc, but it ask for a specific operation; but that when necessary the printed doc will have the date of its creation. After a little investigation i found the process of creating a "custom stamp"

"How To Create Custom Dynamic Stamps - idtPlans LLC " made the steps described in this link.

I need help to know if this is possible, and what is the correct process.

in the opened pdf doc, selecting its properties, there is its creation date, that´s the information we need to be printed.

Thank you once again

try67
Community Expert
Community Expert
March 21, 2017

I'm not sure a stamp is the best way of doing it (although it's possible), but if you do want to use a stamp then you need to access the document that is being stamped, not the stamp itself.

To do that change "this.creationDate" in your code to "event.source.source.creationDate"...

try67
Community Expert
Community Expert
March 20, 2017

Where did you place this code?

carlosp87181292
Participating Frequently
March 20, 2017

Hi,

in the custom configuration script of the stamp