PDF Editing Issues

Move Multiple PDF Pages with One Adobe Acrobat JavaScript Button

Huma Ashraf ChHuma Ashraf Ch Nov 18, 2026 868 views

Question details

The user wants one Acrobat JavaScript button to move several PDF pages instead of clicking a separate button for each page.

Move Multiple PDF Pages with One Adobe Acrobat JavaScript Button
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Create a PDF form button that runs a sequence of page moves.
Observed behavior
One button click should run all the specified page moves.
Before you start

Open the PDF in a version of Adobe Acrobat that supports form editing and page organization. Check the source and destination page numbers, then use Save As to create a copy for testing the script.

Solution 1Recommended

Run a Page-Moving Loop from an Acrobat Form Button

Use a button action to call movePage repeatedly during a single click.

Acrobat JavaScript uses zero-based page indexes: index 0 is the first page. In this example, the document must have at least 111 pages.

The example moves the original pages 107–110 after the original page 111, leaving the moved pages in reverse order: 110, 109, 108, 107. Different source and destination positions require adjusting and testing the indexes.

1
Add a form button

Open the PDF in Acrobat, choose Tools > Prepare a Form, and add a button to the page.

2
Create a JavaScript action

Open the button's Properties, select the Actions tab, and choose Mouse Up as the trigger and Run a JavaScript as the action. Click Add.

3
Enter the page-moving script

In the JavaScript editor, enter: var pages = [109, 108, 107, 106]; for (var i = 0; i < pages.length; i++) { this.movePage(pages[i], 110); } Adjust the indexes for the pages and destination in your PDF.

4
Test the button

Close the properties dialog, exit form editing, and click the button once. Open the page thumbnails to verify the resulting order before saving the tested PDF.

Run a Page-Moving Loop from an Acrobat Form Button
Page order and permissions: The fixed destination index and descending source indexes produce the reverse order shown above; do not assume this loop preserves the original order. If the action is blocked, check the PDF's permissions and Acrobat's JavaScript settings.
Free Microsoft Office alternative

Organize PDF Pages and Edit Office Files with WPS Office

WPS Office is a free, lightweight alternative with a familiar interface and support for common Office formats, making it easy to bring existing files into your workflow. Its PDF tools can help with manual page organization, although they do not replace an Acrobat JavaScript button.

Use PDF page organization tools for manual page rearrangement; some features may require a paid plan.Open and edit Microsoft Office formats, including DOCX, XLSX, and PPTX.Work in a familiar interface with a lightweight office suite.Start with a free version for everyday document tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why are the script's page indexes different from the page numbers?

Acrobat JavaScript counts from zero, so the first page is index 0 and page 111 is index 110. Check the page thumbnails before choosing indexes.

Does the example preserve the original order of the moved pages?

No. With the specified indexes, original pages 107–110 end up after page 111 in the order 110, 109, 108, 107. Test any revised script on a copy and inspect the page thumbnails.

Where do I attach the script to a button?

In Acrobat, open Tools > Prepare a Form, add or select a button, and open its Properties. Under Actions, select Mouse Up and Run a JavaScript, then click Add.

What should I check if clicking the button does nothing?

Make sure you have exited form editing and that the button has a Mouse Up action. Also check Acrobat's JavaScript settings and whether the PDF's permissions allow page changes.