How to Create a Click-Through Agreement PDF in Adobe Acrobat DC
Question details
The user wants to set up a click-through agreement dialog that prompts readers to accept terms upon opening a PDF document in Acrobat DC.

- Product
- Adobe Acrobat DC
- Device & OS
- not provided
- Scenario
- Distributing a PDF document that requires the reader to explicitly agree to specific terms and conditions before they are allowed to access the file's content.
- Observed behavior
- The desired state is an interactive prompt displaying the agreement upon file open, which either allows access if accepted or closes the file if declined, utilizing JavaScript.
Ensure you have the exact JavaScript code for your agreement prompt ready, and create a backup copy of your PDF before adding custom scripts.
Add a Document-Level JavaScript for the Agreement Prompt
Using a Document-Level script ensures the click-through prompt only runs once when the PDF is initially opened, rather than every time a specific page is visited.
Adobe Acrobat DC supports standard JavaScript features, including those found in older tutorials. To create a seamless click-through experience, the script must be applied at the document level. If applied at the page level, the script will re-trigger annoyingly every time the user navigates back to that page.
Open your PDF file in Adobe Acrobat DC. Navigate to the top menu, click on 'Tools', scroll down to the 'Customize' section, and select 'JavaScript'.
In the JavaScript toolbar, click on 'Document JavaScripts'. This opens the dialog box where you can manage scripts that affect the entire file.
Type a descriptive name for your script (e.g., 'AgreementPrompt') in the 'Script Name' field and click the 'Add' button.
Delete any default code in the editor, then paste your customized click-through agreement JavaScript code. Ensure your code includes the dialog setup and logic to close the document if the user declines.
Click 'OK' to close the editor, then save and close the PDF. Reopen the PDF file to test the agreement dialog and verify it works as intended.

Secure and Manage PDFs Easily with WPS Office
While adding JavaScript provides custom prompts, standard PDF security doesn't have to be complicated. WPS Office is a free, lightweight, and highly compatible alternative that allows you to easily protect PDFs with passwords and permissions, without writing a single line of code.
- 1. Download and Install: Visit the official WPS Office website to download the free installation package for your operating system.
- 2. Open Your PDF: Launch WPS Office and open the PDF document you want to secure.
- 3. Apply Password Protection: Navigate to the 'Protect' tab and select 'Encrypt' to easily set open passwords and restrict editing permissions.

Frequently Asked Questions
Why does my PDF agreement dialog appear every time I change pages?
If you added the JavaScript to a 'Page Open' action rather than as a Document-Level JavaScript, the script will trigger every time that specific page is rendered. Move the script to Tools > JavaScript > Document JavaScripts to fix this behavior.
Can I use older JavaScript tutorials for Acrobat DC?
Yes, Adobe Acrobat DC still supports the core JavaScript APIs and features used in older Acrobat versions, so legacy click-through agreement scripts generally still function perfectly.
Is it possible to lock the PDF if the user clicks 'Decline'?
Yes, your JavaScript can be written to invoke the `this.closeDoc()` method, which automatically closes the PDF file immediately if the user chooses not to accept the terms in the dialog box.
Do click-through PDFs work in all PDF readers?
No. The click-through dialog relies on JavaScript execution, which is fully supported in Adobe Acrobat but may be disabled by default or completely unsupported in some third-party PDF readers and web browser viewers.




