How to Get the Current Adobe Acrobat User with JavaScript
Question details
The user needs to retrieve identity information using JavaScript within a PDF form to determine who is currently opening or interacting with the document.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or modifying dynamic PDF forms that require user identification for workflows, tracking, or auto-filling forms.
- Observed behavior
- The developer needs the correct JavaScript method to access user identity properties while properly handling the software's security restrictions.
Ensure you have access to the Adobe Acrobat JavaScript API Reference and verify your application's Trust Manager settings, as strict security policies may block scripts from reading identity information.
Use the JavaScript Identity Object in Acrobat
Access the current user's details by leveraging the built-in identity object properties within your Acrobat JavaScript code.
The Acrobat JavaScript API provides an `identity` object that contains properties such as `loginName`, `name`, `corporation`, and `email`. Because this data is sensitive, Adobe restricts access to it through the Trust Manager.
If a user has disabled JavaScript access to global object data, or if the document is not certified/trusted, these properties will either return empty strings or throw security exceptions. Always handle these scenarios in your code.
Launch Adobe Acrobat, open your PDF form, and navigate to the Prepare Form tool. Right-click on a form field or open Document Actions to access the JavaScript editor.
Write your script using the identity object. For example, use `var currentUser = identity.loginName;` or `var userName = identity.name;` to retrieve the relevant information.
Wrap your identity retrieval logic in a `try...catch` block. This ensures that if security settings block the request, your PDF form will not break and can provide a fallback behavior.

Manage Interactive PDF Forms Seamlessly with WPS Office
While advanced JavaScript identity retrieval depends on strict security configurations in standard PDF readers, WPS Office provides a highly capable, lightweight PDF editor for efficiently handling, filling, and managing interactive PDF forms across all your devices.
- 1. Download and Install: Get WPS Office for free from the official website and install it on your computer.
- 2. Open Your PDF Form: Launch WPS PDF and open your interactive document to instantly access form fields.
- 3. Fill and Manage: Use the intuitive PDF tools to seamlessly fill out data, add digital signatures, and manage document security settings.

Frequently Asked Questions
Why is the Acrobat identity object returning a blank value?
This happens when Adobe Acrobat's security settings restrict scripts from accessing user identity data. The user must explicitly allow the document to read this information, or it must be permitted in the software's Trust Manager.
What properties are available in the PDF JavaScript identity object?
The primary properties available include `identity.loginName`, `identity.name`, `identity.corporation`, and `identity.email`. Their availability strictly depends on the user's application preferences and security permissions.
Can I force Acrobat to read the user's name without prompting?
No. For privacy and security reasons, Acrobat requires user consent or enterprise-level trust configurations (like using certified documents or trusted directories) to grant scripts access to personal details.
How do I check if my PDF viewer supports JavaScript?
You can test basic JavaScript support by adding a simple `app.alert('Test');` command to a document-level script or a button click action. If a popup alert appears when triggered, JavaScript is enabled and functioning.




