Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9099735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:41:42+00:00 2026-06-17T00:41:42+00:00

I have a double-sided document as two separate pdf files — front-facing pages in

  • 0

I have a double-sided document as two separate pdf files — front-facing pages in one document and rear-facing pages in the second.

front.pdf
rear.pdf

I have also combined them into a single document with all the pages but with all the front-facing pages before the rear-facing pages. The page ordering is of the form, {1,3,5,7,...,[n],2,4,6,8,...,[n-1 OR n+1]}

all.pdf

I wish to write a simple javascript that can be run from inside Adobe Abrobat X Pro. Ideally, it would count the pages of the document all.pdf, handle both occasion when there are either an odd or even number of total pages and then reorder them such that they are in their original order:

page [1>3>4>2] => page [1>2>3>4]

The tiny leading code snippet above is from the answer by user171577 on SuperUser in this question: https://superuser.com/questions/181596/software-that-merges-pdf-every-other-page

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:41:43+00:00Added an answer on June 17, 2026 at 12:41 am

    I was able to accomplish this following advice from NullUserException :

    This script requires a document composed of all the odd pages followed by all the even pages. It will cope with cases where there are n even pages and n+1 odd pages.

    I entered a ‘Document JavaScript’ called InterleavePages, with the following code:

    function InterleavePages() {
    
    var n = this.numPages;
    var nOdd = Math.floor(n / 2);
    var nEven = n - nOdd;
    var x;
    var y;
    var i;
    
    for(i = 0; i < nEven; i++) {
                             // movePage x, toAfterPage y
                             // note page numbers are 0-indexed
        x = nOdd + (i);      //
        y = i * 2     ;      //  
        this.movePage(x,y); 
       }
    }
    InterleavePages();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to slice a two dimensional array in C#. I have double[2,2] prices
I have an object which has one field- double[] _myField it's hashcode is public
I have added two gesture recognizers to a view. One will handle the view
I have a 3d modeling application. Right now I'm drawing the meshes double-sided, but
I have double values which I would like to convert to String values with
Let’s say I have double length that can be either a real length or
Right now I have double numba = 5212.6312 String.Format({0:C}, Convert.ToInt32(numba) ) This will give
I have a specific requirement that all children of a particular JComponent have double
I have an double level array. On the first level there are about 10
i have a double, the decimal place isn't fix (8-?) i want to fix

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.