Copy link to clipboard
Copied
I'm creating my very first custom dynammic stamp to apply to exhibits used in court.
I want the file name to automatically appear on the stamp.
I've created the tesx field and added the following custom calculation script:
event.value = event.source.source.documentFileName.replace(".pdf", "");
Nothing happens when I apply the stamp to a document. The stamp appears, but no file name appears on the stamp.
Any suggestions as to what I've done wrong?
Copy link to clipboard
Copied
Remove one source. What does you get?
Copy link to clipboard
Copied
If I remove one "source", I still get nothing.
Copy link to clipboard
Copied
Hi,
Your script seems correct. If you remove one "source" you should get the name of the stamp file.
To get the name of the stamp file, just type event.value=this.documentFileName;
Do you only have this script in your stamp? It's maybe an other one which stops this one.
...and just a suggestion, if you want to remove the .pdf extension you shoud write:
event.value = event.source.source.documentFileName.replace(/.pdf$/i, "");
This will remove only the extension and is case-insensitive.
Try my attached stamps...
@+
Copy link to clipboard
Copied
So good and bad news.
1st - this is the only script in my stamp;
2nd - if I replace what I had with:
event.value = event.source.source.documentFileName.replace(/.pdf$/i, "");
I still get nothing. I was beginning to suspect that my stamps was just badly designed and not working, but I used:
event.value=this.documentFileName;
and the stamp populated with the name of the stamp file, which isn't my goal. However, I know the stamp is able to populate information, just not the information I'm looking for.
Copy link to clipboard
Copied
The code you're using is fine, so maybe the issue is with the stamp itself, or maybe you're not placing it in the correct place. Could you share your stamp file with us?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This is not what a stamp that was created in Acrobat looks like. Did you create it elsewhere, by any chance?
Copy link to clipboard
Copied
Sure, that should work!
Did you try my stamps file I shared, it's exactly the same script and it's working fine...
Is it possible you share your stamp file? I will have a look...
@+
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you soo much for your time. It was created using Adobe, but I can't even begin to describe why its messed up.
Your version works great!