Hi,
Is it possible to make a stamp readonly as soon as it is placed?
I know how to do it with a function later, but it would be more convenient to make it read only as soon as its placed on the dynamic stamp javascript.
Kind regards,
Make stamp readonly the moment it is placed
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 21
- Joined: Thu May 13, 2021 11:50 am
-
- Site Admin
- Posts: 17949
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Make stamp readonly the moment it is placed
Hello ng80092a,
This is the default behaviour of "dynamic" content in dynamic stamps - it becomes static the moment the stamp is placed.
Or do you want to make the whole stamp object read only?
This will have to be done after the stamp placement event.
Kind regards,
Stefan
This is the default behaviour of "dynamic" content in dynamic stamps - it becomes static the moment the stamp is placed.
Or do you want to make the whole stamp object read only?
This will have to be done after the stamp placement event.
Kind regards,
Stefan
-
- User
- Posts: 21
- Joined: Thu May 13, 2021 11:50 am
Re: Make stamp readonly the moment it is placed
Hi Stefan,
Thanks for the reply, Yes. I want to change the stamp properties after it is placed, by performing a secondary action indeed.
I was able to get close, but not enough, by running a function that would determine the last created stamp on the document.
This of course, will perform the property change on the previous created stamp and not the one that I'm actually inserting.
The code inside the dynamic stamp:
The code on the roaming .js file
What I would need is to run the function, but immediately after the stamp is created so it is considered in the loop trough the document.
Would that be possible somehow?
Thanks for the reply, Yes. I want to change the stamp properties after it is placed, by performing a secondary action indeed.
I was able to get close, but not enough, by running a function that would determine the last created stamp on the document.
This of course, will perform the property change on the previous created stamp and not the one that I'm actually inserting.
The code inside the dynamic stamp:
Code: Select all
returnlaststamp(event.source.source);
Code: Select all
function returnlaststamp(thedoc)
{
var oStampCount = {};
var previousaAnnots = "";
var d0 = new Date(1998,01,01,0,0,0,0);
for(var p=0; p<thedoc.numPages; p++) {
var aAnnots = thedoc.getAnnots(p)
if (aAnnots != null )
{
for(i=0;i<aAnnots.length;i++)
{
if(aAnnots[i].type == "Stamp")
{
var cStampName = aAnnots[i].AP;
var d1 = aAnnots[i].creationDate;
if (d1 > d0)
{
d0 = d1;
laststampname = aAnnots[i].name;
laststamppage = aAnnots[i].page;
}
}
}
}
}
return [laststampname, laststamppage];
}
Would that be possible somehow?
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Make stamp readonly the moment it is placed
Hello ng80092a,
Are you using the Editor SDK or the End-User Editor's JS?
Cheers,
Alex
Are you using the Editor SDK or the End-User Editor's JS?
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 21
- Joined: Thu May 13, 2021 11:50 am
Re: Make stamp readonly the moment it is placed
The End user, but would SDK release be able to do this?
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Make stamp readonly the moment it is placed
Hello ng80092a,
The Editor SDK is able to do that.
Cheers,
Alex
The Editor SDK is able to do that.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ