I was wondering if it was possible to grab the username of the account logged into the puter. I wanted to print the username of the person that is printing out the pdf file.
I was thinking about trying to grab the %username% environment variable. Does not seem to be possible.
I was wondering if it was possible to grab the username of the account logged into the puter. I wanted to print the username of the person that is printing out the pdf file.
I was thinking about trying to grab the %username% environment variable. Does not seem to be possible.
Share Improve this question asked May 28, 2009 at 15:28 Kevin KaskeKevin Kaske 1,1392 gold badges12 silver badges18 bronze badges 03 Answers
Reset to default 4In Acrobat JavaScript, many local system parameters are considered privileged. The user's login name is one of these. In order to access the "identity" object the JavaScript code has to be executed from a trusted context. Code inside a PDF doesn't qualify. Or at least it doesn't normally. If the local system user has given explicit permission to the PDF, then it can access privileged data. But obviously this isn't a general purpose solution. Typically the "identity" object is only accessible to Folder Level Automation scripts.
Thom Parker www.pdfscripting.
take a look a the identity object.
name = identity.name; //gives you the user name that the user entered in the Identity preferences panel
userName = identity.loginName; //login name as registered by the operating system
This may be possible to some extent server-side. Here's an NTLM auth module for Apache/Unix, and here's one for Apache/Windows.