PDF Editing Issues

How to Reorder PDF Pages with an Acrobat JavaScript Script

Aamir Naveed AkramAamir Naveed Akram Nov 5, 2026 869 views

Question details

The user needs to automate the reordering of scanned microfiche PDF pages from a row-by-row arrangement to a column-by-column sequence.

How to Reorder PDF Pages with an Acrobat JavaScript Script
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Reorganizing the layout sequence of batched scanned documents.
Observed behavior
Pages are incorrectly ordered by rows instead of columns and require programmatic repositioning across multiple files using a script.
Before you start

Ensure you have Adobe Acrobat Pro installed, as standard free PDF readers do not support executing document-level JavaScript for structural file modifications.

Solution 1Recommended

Automate Page Reordering using Acrobat JavaScript

Use the Acrobat JavaScript API and the movePage method to programmatically change the sequence of your document pages based on a custom defined array.

Acrobat JavaScript allows you to automate repetitive tasks across multiple files. The movePage method is particularly useful for resequencing pages that were scanned out of order, such as microfiche files.

To accomplish this, you must write a script that stores your target page order in an array, then loops through the array while calling the this.movePage() function.

1
Access the JavaScript Console

Open Adobe Acrobat Pro, navigate to the Tools menu, select 'JavaScript', and open the 'JavaScript Debugger' or Action Wizard.

2
Define the target page array

Write an array in your script that maps the current row-by-row page indices to the new column-by-column order.

3
Implement the movePage loop

Create a loop that iterates through your array and applies the 'this.movePage(nPage, nInsertAt)' method, moving each page to its intended index.

4
Execute the script

Run the script on your active document. To apply this to multiple files, save the script as an Action in the Action Wizard and run it across your target folder.

Automate Page Reordering using Acrobat JavaScript
JavaScript Knowledge Required: Familiarity with Adobe Acrobat's specific JavaScript API is necessary to write the exact looping logic and handle zero-based page indexing correctly.
Visual PDF Page Reordering

Reorder PDF Pages Instantly with WPS PDF

If writing custom JavaScript scripts is too complex or time-consuming, WPS Office provides an intuitive visual interface to rearrange, extract, and organize PDF pages without writing a single line of code.

  1. 1. Open your PDF: Launch WPS Office and open your scanned PDF document.
  2. 2. Navigate to the Page tab: Click on the 'Page' tab located in the top navigation ribbon.
  3. 3. Select Page Organize: Click on 'Organize Pages' to view all pages as visual thumbnails.
  4. 4. Drag and drop to reorder: Click and hold the thumbnails, then drag them into your preferred column-by-column layout.
  5. 5. Save the changes: Click 'Save' or press Ctrl+S to finalize the new page sequence in your document.
Visual drag-and-drop page reorderingNo programming or scripting knowledge requiredFully compatible with standard Adobe PDF document formatsLightweight alternative for quick document management
QA img-9

Frequently Asked Questions

Can I run Acrobat JavaScript in free PDF readers?

No, advanced script execution that modifies document structure, such as moving or deleting pages, typically requires Adobe Acrobat Pro. Free readers lack the necessary API permissions to modify page geometry.

What is the movePage method in Acrobat JavaScript?

The movePage method is a built-in Acrobat JavaScript function that allows a script to change a page's position within a document. It requires parameters specifying the page you want to move and the index where it should be placed.

Is there a way to batch reorder PDF pages without coding?

While automated batch processing across hundreds of files usually requires scripting or Action Wizard macros, dedicated PDF editors like WPS PDF allow you to quickly visualize and manually drag-and-drop entire sequences of pages without any coding.