Dynamic stamps and dd-mm-yy  SOLVED

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
hcoward
User
Posts: 6
Joined: Thu Jan 11, 2018 6:05 am

Dynamic stamps and dd-mm-yy

Post by hcoward »

Hi,

I am currently evaluating PDF-XChange Editor Plus, as far as I have got I like what I see but I have hit a road-block..

Importing Dynamic stamps with the dd-mm-yy format.

Using Foxit I have a dynamic stamp that achieves a dynamic stamp with the date format dd-mm-yy, the Javascript goes like this:

event.value = (new Date()).toString();
AFDate_FormatEx("dd/mm/yyyy");
event.value = ((!identity.name || identity.loginName != (event.source.source || this).Collab.user) ? (event.source.source || this).Collab.user : identity.name) + " " + event.value;

It works in Foxit, I have tried importing the stamp into PDF-Exchange Editor Plus but it doesn't update the date.

So I tried something simpler, I edited the stamp in Foxit to give...
event.value = util.printd("dd/mm/yyyy", new Date());

That gives the date in Foxit, but not in PDF-Exchange Editor Plus

How can I get a Dynamic date in PDF-Exchange Editor Plus with the dd/mm/yy format?

I hope that you can help
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17889
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Dynamic stamps and dd-mm-yy

Post by Tracker Supp-Stefan »

Hello hcoward,

Please try using the util.printd() method instead:

Code: Select all

todayDate = "Date: " + util.printd("dd, mm, yyyy", new Date());
You can take a look at pages 718 and 719 of this file:
http://www.adobe.com/content/dam/acom/e ... erence.pdf
For a full list of the supported parameters for the date formatting.

Regards,
Stefan
hcoward
User
Posts: 6
Joined: Thu Jan 11, 2018 6:05 am

Re: Dynamic stamps and dd-mm-yy

Post by hcoward »

I edited the stamp using Foxit, using the suggested code and then saved it.

I go to PDF-Xchange editor, open up any old pdf to experiment with..
> Stamp
> Stamps Palette
> Add new
> Add new stamp from file (and then select the stamp that had the dynamic code)

If I use imported stamp within "any old pdf" to experiment, it does not show the date (this may be a clue, it shows a date from the past).

If however I use the Java console that code does indeed return today's date.

?
hcoward
User
Posts: 6
Joined: Thu Jan 11, 2018 6:05 am

Re: Dynamic stamps and dd-mm-yy

Post by hcoward »

An update...

Using the example found at https://help.pdf-xchange.com/EUM/de ... mic_stamps

Change to:
var d = new Date;
event.value = util.printd("dd/mm/yy", d);


At least I have got today's date rather than some date in the past.

When I have time, from tomorrow onwards, I'll post confirming whether (as I would hope) it shows the date that the stamp is inserted (rather than the date it was edited).
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8544
Joined: Wed Jan 03, 2018 6:52 pm

Re: Dynamic stamps and dd-mm-yy  SOLVED

Post by TrackerSupp-Daniel »

Hi hcoward

Give the instructions on this page a shot too, https://help.pdf-xchange.com/pdfxe6 ... ol_ed.html

They are instructions for the V6 version of the software, but the javascript in this one is much more fleshed out than in the v4/5 manual that you are looking at there.
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
hcoward
User
Posts: 6
Joined: Thu Jan 11, 2018 6:05 am

Re: Dynamic stamps and dd-mm-yy

Post by hcoward »

Thanks for that link.

I followed the instructions precisely and it seems to be working :)

I believe the problem that I had been encountering was due to the stamp I was trying to import not being "flattened" prior to import.

Yesterday I flattened the stamp, used the code as per my post of "Mon Jan 15, 2018 6:23 pm" and imported it.
Today when I try and use the stamp it updates to show today's date!


Thanks again.

Great product by the way.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17889
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Dynamic stamps and dd-mm-yy

Post by Tracker Supp-Stefan »

Hello hcoward,

Appreciate the kind words for our products!

And happy to hear you've got the stamp working as intended!

Cheers,
Stefan
Post Reply