How to Automatically Save a Signed PDF to a Network Folder
Question details
Configure a PDF form's submit button to automatically bypass email/web submission and securely save the digitally signed document to a specific local or network directory.

- Product
- PDF Editors
- Device & OS
- not provided
- Scenario
- Automating the collection of signed PDF forms within a corporate environment by routing them directly to a centralized network storage path.
- Observed behavior
- Default PDF submit buttons are limited to email or URL actions; saving directly to a local or network path is blocked by application security sandboxes unless explicitly authorized.
Verify that you have administrative access to deploy script files to user machines, and ensure your organization's IT security policies permit folder-level JavaScript execution.
Use a Folder-Level Trusted JavaScript Function
Create and deploy a local script file containing a trusted function that safely bypasses PDF security restrictions to save the file to your designated network path.
Because saving files directly to a local drive or network folder poses a severe security risk, standard PDF readers block this behavior when triggered directly from a document.
To accomplish this, administrators must deploy a folder-level JavaScript (.js) file to every client computer. This file establishes a 'Trusted Function' that the PDF form can securely call to execute the save command.
Open a plain text editor and write a script using the `app.trustedFunction` wrapper around the `doc.saveAs` method. Specify your target network folder path using device-independent formatting (e.g., `/server/shared/folder/`). Save this file with a `.js` extension.
Copy the `.js` file to the global JavaScripts folder of the PDF application (e.g., the Acrobat or Reader JavaScripts directory) on every user's computer who will submit the form.
Open your PDF form in edit mode, right-click the Submit button, and select 'Properties'. Under the 'Actions' tab, remove any existing submit actions.
In the 'Actions' tab, select 'Run a JavaScript' from the dropdown menu and click 'Add'. Enter the code to call the trusted function you defined in your folder-level script, passing any required parameters like the file name.

Sign and Save PDFs Seamlessly with WPS Office
If deploying folder-level scripts across your organization is too complex, WPS Office provides an intuitive, code-free interface to digitally sign PDF documents and save them securely to mapped network drives.
- 1. Open the PDF Form: Launch WPS Office and open your fillable PDF form.
- 2. Fill and Sign the Document: Navigate to the 'Protect' or 'Fill & Sign' tab, input your form data, and select 'Sign' to apply your digital signature securely.
- 3. Save to Network Storage: Click the 'Menu' button, select 'Save As', and browse to your designated mapped network folder to store the finalized document.

Frequently Asked Questions
Why can't I embed the save script directly into the PDF form?
For security reasons, PDF applications execute document-level scripts in a restricted sandbox environment. This prevents malicious files from silently writing data to your hard drive or network. The script must be installed locally as a 'Trusted Function' to prove it is authorized by the system administrator.
How do I format the network path in the JavaScript code?
PDF JavaScript requires device-independent paths. Instead of a standard Windows path like '\\server\shared\file.pdf', you must use forward slashes and format it as '/server/shared/file.pdf'.
Will this automated save function work on mobile devices?
No. Folder-level JavaScripts and trusted functions rely on the desktop application's file architecture and security model. Mobile PDF readers typically do not support custom folder-level scripts.




