First of all I wanted to thank you for making PDF-XChange Editor. I use it for several years now and it has become one of my most valued tools that I use multiple times each day. It saved me countless hours of work and many headaches.
I recently started to familiarize myself with dynamic stamps and I have one question that I didn't manage to figure out.
Goal to achieve:
Have a Stamp that has a text that states the filename of the document the stamp is placed on.
Example:
Open the file Testfile007.pdf in PDF-XChange editor. Place a dynamic stamp. The text on the dynamic stamp should read "Testfile007".
What I tried so far:
I tried two different ways that both return just the filename of the stamp-file.
try1:
Code: Select all
var filename = this.documentFileName.replace(/.pdf/,"");
event.value = filename;
Code: Select all
if (event.source.forReal && (event.source.stampName == "#g3Bsd7emS4gn7CbzZEVzv2"))
{
var filename = this.documentFileName.replace(/.pdf/,"");
event.value = filename;
}
It seems that "this.xxx" has the scope of the stamp file. I was not able to figure out a way to access metadata of the file the stamp is placed on.
I tried to find something in the forum; If I missed a thread I apologize and kindly ask you to point me to it.
I also tried to dig into the Acrobat PDF Javascript documentation but wasn't able to find any useful guidance on this topic.
Can you point me towards a solution on how to access metadata from the file the stamp is placed on?
Any help is appreciated.
Thanks,
Peter
PDF-XChange Editor Plus Version 9.3 build 361.0 running on Windows 10 Pro Version 21H2