Access Undocumented Identity Properties
There are a lot of properties, scripts, and functions in Acrobat and Reader that are undocumented, which means that they work, but for whatever reason, Adobe does not want them known publicly.
It also means they could stop working at any time after an update.
View Identity Object Properties
To view the identity object properties in Acrobat or Reader press Ctrl + k (Windows OS) or select Edit > Preferences from the menu, then select the Identity category on the left.
If you look up the identity object in the Acrobat JavaScript Reference you will see the following identity properties:
corporation
email
loginName
name
Also, if you run the following script in the console it will return the above list:
for ( i in identity)
{
console.println(i)
}
If you have the fields completed in the identity category of preferences and you run the following script in the console it will return the field values of each of the properties in the bullet list above:
for ( i in identity)
{
console.println(i + ":" + eval("identity."+i))
}
When I run it with my fields as in the screenshot above it returns:
loginName:xxxxx
name:David Dagley
corporation:PDFAutomationStation
email:david@pdfautomationstation.com
They are all fairly obvious except corporation, which is referred to as Organization Unit in the identity category of preferences.
Access to the Identity Object
Access to the identity object is privileged, which means it can be accessed through batch, console, and trusted functions in folder level scripts. It can also be accessed with dynamic stamps. For example, the following script could be used to automatically complete dynamic fields in a stamp:
this.getField("Approved By").value = identity.name;
this.getField("Company").value = identity.corporation;
This is handy for using the same stamp file for multiple users who use the stamp for approving documents. The stamp pulls the name and company of the user from the identity object. All the fields can be changed on the fly except Login Name, which is the computer login name. That’s why it is disabled in the preferences window. If security of approval stamps is a concern, the Login Name should be used instead of the Name because it can’t be easily changed:
this.getField("Approved By").value = identity.loginName;
Most of the property names are obvious:
Login Name => loginName Name => name Organizational Name => corporation Email Address => email
Undocumented Properties
There are a lot of properties, scripts, and functions in Acrobat and Reader that are undocumented, which means that they work, but for whatever reason, Adobe does not want them known publicly. It also means they could stop working at any time after an update.
The two identity properties missing from the list are Title and Organizational Unit. I experimented by running different terms in the console until I got a hit. I got Title on the first attempt:
identity.title;
Organizational Unit took a few more attempts but I eventually accessed the property:
identity.department;
It’s possible that I could’ve run terms all day long and never got a hit because the properties simply didn’t exist. I had a hunch that they might be accessible since they were part of the identity category in preferences and I was right.
If you want learn JavaScript for Acrobat Pro I invite you to examine my online learning course.
Email me at the address in the identity screenshot above and I’ll send you a promo code that will save you $100. See you next time.