I need to create a PDF document that is "aware" of how many times it has been opened. What i want is the capability to send a document for evaluation but place a limit on how many times the document has been viewed, displaying a message to the user when the limit has been reached. I found this code on another post and I just want to make sure that it will work (obviously the code does not include the message box).
Many thanks for your help
if (global.count = null)
{
global.count = 0
global.setPersistent("count",true)
}
else
global.count++
That's not the right way to check for the existence of a global variable. If a global variable does not exist, it will return a value of undefined, not null. Also, the code has a bug such that it actually sets the global to null rather than testing to see if it's equal to null.
Try something like this:
if (typeof global.count === "undefined") {
global.count = 0;
global.setPersistent("count", true);
} else {
global.count++;
}
North America
Europe, Middle East and Africa
Asia Pacific