How to Open Multiple Attachments from a PDF Link or Button
Question details
The user wants to open multiple attached files simultaneously using a single hyperlink or button within a PDF document.

- Product
- Device & OS
- not provided
- Scenario
- Creating interactive PDF documents with embedded attachments.
- Observed behavior
- Standard PDF hyperlinks only support executing a single command, making it impossible to directly open multiple attached files at once using a basic link.
Ensure that all the documents you wish to open are already attached to the main PDF file before setting up your interactive links or buttons.
Create a Form Button with Multiple Actions
Use a form button instead of a standard text hyperlink to trigger multiple file-opening commands with a single click.
Standard hyperlinks in PDFs are limited to a single associated action. By using a form button element, you can stack multiple actions sequentially to open several files at once.
Open your PDF editor, navigate to the forms or interactive elements section, and draw a new button on your PDF page.
Right-click the newly created button and select 'Properties' from the context menu.
Go to the 'Actions' tab. Select 'Go to a page view' (or open a file) from the Select Action dropdown, choose your first attached file, and click 'Add'.
Repeat the previous step to add a new 'Go to a page view' action for each additional file you want to open. When clicked, the button will execute all actions sequentially.

Use Document-Level JavaScript
Write a custom JavaScript utilizing the exportDataObject command to launch multiple attachments from a single link.
Manage PDF Links and Attachments with WPS Office
WPS Office provides a comprehensive PDF editor that allows you to effortlessly insert, manage, and link attachments. Creating interactive PDFs with advanced formatting is intuitive and highly efficient.
- 1. Open WPS Office: Launch the WPS Office desktop application and open your existing PDF document.
- 2. Access PDF Editing Tools: Navigate to the 'Edit' tab in the top ribbon to locate the tools for managing links, forms, and attachments.
- 3. Add Interactive Elements: Use the built-in interactive tools to insert links or draw shape buttons, right-click to access properties, and configure your desired file-opening actions.

Frequently Asked Questions
Can I use a standard PDF hyperlink to open multiple files?
No, standard PDF text hyperlinks can only execute a single associated command or action at a time. To open multiple files, you must use a form button configured with multiple actions or utilize a custom JavaScript code.
Do the files need to be attached to the PDF before linking?
Yes, for the exportDataObject JavaScript command or the internal link actions to function correctly, all corresponding files must be attached directly to the host PDF document beforehand.
Will JavaScript actions work on mobile PDF viewers?
Most mobile PDF viewers have limited or zero support for JavaScript actions. For the most reliable experience, users should view and interact with JavaScript-based buttons or links using a robust desktop PDF reader.




