How to add name/status text form to stamp

A picture is worth a thousand words. We have created some pdfs tutorials showing common tasks.

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

Post Reply
melfnaus
User
Posts: 2
Joined: Mon Dec 16, 2019 11:02 pm

How to add name/status text form to stamp

Post by melfnaus »

Hey all!

I´d like to know how to add a name/status to a dynamic stamp using javascript.
Using another pdf program I used the script below so that a pop up box appears once you placed your stamp and you manually enter your name and the status of the document being reviewed.

var cAsk = "Status: Approved, Rejected, or In Process";
var cTitle = "Document State For Stamp";

if(event.source.forReal &&
(event.source.stampName == "#stamp1"))
{
event.value = app.response(cAsk, cTitle);

}

-------------------------------------------------------------------------------------

var cAsk = "Enter a name";
var cTitle = "Document State For Stamp";

if(event.source.forReal &&
(event.source.stampName == "#stamp1"))
{
event.value = app.response(cAsk, cTitle);
}

I have resolved the name/identity part using this script: (but prefer to do this manually)

if((identity.name != null) && !/^\s*$/.test(identity.name))
event.value = identity.name;
else
event.value = identity.name.replace(/\./g," ").replace(/\./g," ").replace(/\b(\w)/g,function(Word,cFst){return cFst.toUpperCase()});


What would be the best way forward?

Thanks in advance! :D
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8439
Joined: Wed Jan 03, 2018 6:52 pm

Re: How to add name/status text form to stamp

Post by TrackerSupp-Daniel »

Hello Melfnaus,

From what I can see, this JS works correctly in our application as is, you simply need to create a stamp with a form field to contain it, then input the new stampName. This article should help:
https://www.pdf-xchange.com/knowle ... p-Creation

Kind regards,
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
melfnaus
User
Posts: 2
Joined: Mon Dec 16, 2019 11:02 pm

Re: How to add name/status text form to stamp

Post by melfnaus »

Thanks for testing it out!

I had a look at the link that you sent and I can't seem to find the Stamp Id in properties.
Please refer to the snip below with what appears when I select the stamp
Capture_01.JPG
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to add name/status text form to stamp

Post by Tracker Supp-Stefan »

Hello melfnaus,

Please make sure you are using the latest Editor build, and that you are adding the stamp from a stamp collection and not e.g. through JS code executed in the JS console - and you should see the Stamp ID there:
Stamp_ID.png
Stamp_ID.png (19.17 KiB) Viewed 3919 times
Regards,
Stefan
Post Reply