Problem with Document Filename in the dynamic stamps.

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

dawid_111
User
Posts: 2
Joined: Tue Nov 19, 2019 12:33 pm

Problem with Document Filename in the dynamic stamps.

Post by dawid_111 »

Hello,
I made a dynamic stamp to show the file name. Unfortunately, the stamp shows the name of the file with dynamic stamps, something like:
3a723805-de1b-412c-a5901f781714cb2b.pdf
It should show something like this:
file11.pdf
My dynamic stamp:

Code: Select all

var nazwa = new String;
nazwa = documentFileName.replace(/.pdf/,"");
event.value = util.printf (nazwa);
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17949
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Problem with Document Filename in the dynamic stamps.

Post by Tracker Supp-Stefan »

Hello David,

Yes - if you take the name like this - it will be the value of the file in which the stamp itself resides.
Please try e.g.:

Code: Select all

event.value = event.source.source.documentFileName.replace(/.pdf/,"");
Cheers,
Stefan
dawid_111
User
Posts: 2
Joined: Tue Nov 19, 2019 12:33 pm

Re: Problem with Document Filename in the dynamic stamps.

Post by dawid_111 »

Problem solved. Thanks :)
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6901
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada

Re: Problem with Document Filename in the dynamic stamps.

Post by Paul - Tracker Supp »

:D
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com