Merge even and odd pages

My printer won't do duplex scan, and I need to scan a large amount of 2-sided text. So I'm going to create one document of the odd-numbered pages, and another of the even-numbered pages. I know I can manually combine them into the right order, but I'm hoping there is some automatic way to merge the documents - one of odd-numbered pages, and one of even-numbered pages - into one document in which the pages are in the correct numerical order.
Is there?

Hey Seth and others:
Thanks for the positive feedback. I found myself needing to do some collating and reversing again, and discovered that the script didn't show up in Acrobat 9. So I updated the script, and moved the menu item into the "Document" menu.
Unfortunately I can't figure out how to attach the updated script in the new form editor, so I'll inline it. Copy the following script into a file and install it into your Javascripts folder, as before.
// Complements: Planet PDF (http://www.planetpdf.com/)
// Modified by Jeff Baitis for Acrobat 9 compatibility
// Improved Collate function with status bar.
// Add a menu item to reverse all pages in the active document
app.addMenuItem({ cName: "Reverse", cParent: "Document", cExec: "trustedReversePages();", cEnable: "event.rc = (event.target != null);", nPos: 0 });
app.addMenuItem({ cName: "Collate", cParent: "Document", cExec: "trustedCollatePages();", cEnable: "event.rc = (event.target != null);", nPos: 0 });
trustedReversePages = app.trustedFunction(function()
  app.beginPriv(); // Explicitly raise privileges
  var t = app.thermometer;
  t.duration = this.numPages;
  t.begin();
  for (i = this.numPages - 1; i >= 0; i--)
    t.value = (i-this.numPages)*-1;
    this.movePage(i);
    t.text = 'Moving page ' + (i + 1);
  t.end();
  app.endPriv();
// Collating pages
  Title: Collate Document
  Purpose: User is prompted to select document to insert/collate.
  Author: Sean Stewart, ARTS PDF, www.artspdf.com
trustedCollatePages = app.trustedFunction(function()
  app.beginPriv(); // Explicitly raise privileges
  // create an array to use as the rect parameter in the browse for field
  var arRect = new Array();
  arRect[0] = 0;
  arRect[1] = 0;
  arRect[2] = 0;
  arRect[3] = 0;
  // create a non-visible form field to use as a browse for field
  var f = this.addField("txtFilename", "text", this.numPages - 1, arRect);
  f.delay = true;
  f.fileSelect = true;
  f.delay = false;
  // user prompted to select file to collate the open document with
  app.alert("Select the PDF file to merge with")
  // open the browse for dialog
  f.browseForFileToSubmit();
  var evenDocPath = f.value;
  var q = this.numPages;
  var t = app.thermometer;
  t.duration = q;
  t.begin();
  // insert pages from selected document into open document
  for (var i = 0; i < q; i++) {
      var j = i*2;
      this.insertPages(j, evenDocPath, i);
      t.value = i;
      t.text = 'Inserting page ' + (i+1);
  t.end();
  // remove unused field
  this.removeField("txtFilename");
  app.endPriv();
Have fun
Edited: Found some bugs, fixed the code up a bit

Similar Messages

  • Even and odd page break

    Hi ALL
    I have a requirement in my report there are two things location with customer details and meter reading with costing Now my req is that location details should come on odd pages and starting from page 3. For meter details should come on even pages starting from page 4 can you plz help me in this
    Regards
    Prasoon

    i did not quite get what your report structure is.
    Is it something like
    -Customer
    -- Location details
    -- Meter reading
    -Customer
    -- Location details
    -- Meter readingIf so does the customer record fill pages 1 and 2?
    Does the location details always fit on one page or could per be more data than for one page?
    Does the meter-reding details always fit on one page or could per be more data than for one page?

  • Duplicate buttons on even and odd pages

    I would to be able to place in Acrobat on 100 facing pages document some buttons for printing and navigating but on different positions for odd and even pages. The Duplicate command does not offer any option for it. There is any available script for it? Thanks.

    Only if user written.
    You could use the template feature of Acrobat to make 2 templates, one for the odd pages and the the other for the even pages, and then overlay the template on the appropriate pages.
    Or split the PDF into odd and even pages, apply the buttons and then recombine the PDFs.

  • Even and Odd pages PO

    I have to create a po print on both sides.
    The odd pages have the po but the odd pages have condition terms, is there a way in xml publisher to do this.
    Can I test on page number, or can I set default text for odd pages ?
    Thanks for your help

    Do you really need bleed at the spine? Unless you are doing spiral binding, or you really have art dying into the binding, you generally don't.
    In cases where you do, it is easy to "break" a facing-pages spread into a left and right half. Disable page shuffling for the spread, then just pull it apart. See InDesignSecrets » Blog Archive » Breaking Pages Apart to Bleed Off a Spine
    There's a script reference down inthe comments from Harbs, too, that will do the entire document if you need it (I believe Daniel said earlier today that he's had trouble with the script once and had to break the spreads manually, but I've never seen another report of a problem.)

  • Is there a way to apply a master page to even (or odd) pages in a long document?

    I'm taking a very simple, large pdf document and bringing it into InDesign to add some graphics. The pdf is actually a customized 2-page document for a large employee group (i.e. pages 1 and 2 are for employee001, pages 3 and 4 are for employee002, pages 5 and 6 are for employee003, etc.).
    I've found a script that allows me to bring in all the pages of the pdf at one time, provided I've set up the correct number of blank pages in InDesign. What I'm looking for now is a way to apply a master page to all even numbered pages at one time. Or all odd pages. Anyone have any ideas?
    Ideally, an option that would import the entire pdf document, add the appropriate number of pages to the InDesign document, and be able to assign different master pages to even and odd pages would rock! Help!

    for (var i=0;i<= PageLength-1;i++)
    var isEven = function(someNumber){
    return (someNumber%2 == 0) ? true : false;
    if(isEven(newDoc.pages.item(i).name) == true)
              //Apply Master B for right page
              newDoc.pages.item(i).appliedMaster = app.activeDocument.masterSpreads.item("B-Master");
    //Move elements by x, y position, script label ContactEmail
    newDoc.pages.item(i).pageItems.item("ContactEmail").move([0.7292, 6.011]);
    }else{
              //Apply Master A for left page
              newDoc.pages.item(i).appliedMaster = app.activeDocument.masterSpreads.item("A-Master");
    }//for Else
    }//For

  • Zero bleed at inside page on even and odd master pages

    Hello guys!  Going directly to my question would be how to apply bleed option specifically on inside pages when working with individual master pages for master and facing pages on the main document. The thing is when I've set no bleed on inside on my Document Setup it has applied on my even and odd master pages (remembering I have individual master pages set on my document). I am not sure if I was clear enough but I keep it open for eventual comments and so on.  Thank you.

    Ok Peter. Thank you! I am posting some screen shots to help understanding.

  • How do I select, extract, delete, etc... only the even or odd pages?

    I have a 2000+ page document and I need to somehow select all the even or odd pages so I can pull them out of it that doesnt require me from having to click 1000 individual thumbnails.  I know how to print even or odd pages but dont see any way of just selecting them for editing

    I don't know where they are in Word but the print dialog is standard throughout OSX and this seems logical enough.
    The only problem is the Paper Handling is hidden under Layout. But sort of makes sense.
    Peter

  • How to work even and odd number query

    Plz explain how below worked even and odd query
    2 ) why used subquery after from and which time we can use(what time of out put)
    even
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=0   
    odd
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=1

    Row_Number function returns the sequential number of a row
    (By using partition of a result set, starting at 1 for the first row in each partition)
    >> why used subquery after from and which time we can use(what time of out put)
    When we need sequntial numbers, we can use row_number function. Put it into derived table and use this derived table after FROM clause (Same way it is used in your query)
    CREATE TABLE stud_Enrollment (
    grno int,
    stud_id int,
    stud_name varchar(20)
    INSERT INTO stud_Enrollment
    VALUES (101, 511, 'Dheeraj'), (112, 521, 'Vaibhav'), (132, 522, 'Lalit'), (124, 564, 'Amogh'), (143, 598, 'Sushrut')
    SELECT * FROM stud_Enrollment
    -- Result of your table
    --grno stud_id stud_name
    --101 511 Dheeraj
    --112 521 Vaibhav
    --132 522 Lalit
    --124 564 Amogh
    --143 598 Sushrut
    -- Now we need to find out the rows which are at even position, ie row should be at position of 0,2,4,6,8 etc..
    -- But we don't have sequential number here in your table result
    -- So we can create one new column by using row_number function
    SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row, --> additiona "row" column
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment
    -- We got "row" column in below output
    --row grno stud_id stud_name
    --1 101 511 Dheeraj
    --2 112 521 Vaibhav
    --3 132 522 Lalit
    --4 124 564 Amogh
    --5 143 598 Sushrut
    -- Now above table is used after FROM clause. It uses row column in WHERE part
    SELECT
    FROM (SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row,
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment) d
    WHERE d.row % 2 = 0
    --row grno stud_id stud_name
    --2 112 521 Vaibhav
    --4 124 564 Amogh
    -Vaibhav Chaudhari

  • Add Even and Odd Numbers

    I have a programming assignment that needs to read a set of integers and then finds and prints the sum of the evens and sum of the odds.
    I know how to find out which numbers are odd and even, I just can't figure out how to add up the evens and odds. Say a set of 10 integers is inputted, how can they be added up after it is determined if they are even or odd?

    Here is my code after the tip from student... It compiles but once ran it doesn't do anything after the integers are put in.
    import java.util.*;
    public class EvenOddIntegers {
        static Scanner console = new Scanner(System.in);
        static final int limit = 10;
        public static void main(String[] args) {
             int number = 0, limit = 0, sumEven = 0, sumOdd = 0;
             int odds = 0;
            int evens = 0;
             System.out.print("Enter ten positive integers: ");
             while (limit <= 10)
                  number = console.nextInt();
             if (number % 2 == 0)
                  sumEven += number;
             else if (number % 2 != 0)
                  sumOdd += number;
             System.out.println("Sum of even numbers is " + sumEven + ".");
             System.out.println("Sum of odd numbers is " + sumOdd + ".");
    }

  • Counting even and odd values

    Is there another way to count even and odd number than this one
    private static int countEvenOrOdd(int[] array, boolean countEvenNumbers){
              int count = 0;
              int remainderRequired = (countEvenNumbers ? 0 : 1);
              for(int i = 0; i < array.length; ++i){
                   if(array[i] % 2 == remainderRequired){
                        ++count;
              return count;
         }

    > I like hacking ;-) Have a look at this: ...
    Jos, you forgot the method for counting both:int countOddsAndEvens(int[] array) {
    return (countOdds(array) + countEvens(array));
    } ; )Yep, you're right, and for completeness reason I'd like to add the following:int countOthers(int[] array) {
       return array.length-countOddsAndEvens(array);
    }And for those junit maniacs:boolean testCounters(int[] array) {
       return countOddsAndEvens(array)+countOthers(array) == array.length;
    }btw, the moment I posted my previous reply I realized that I could've done better:int countOdds(int[] array) {
       int c= 0;
       for (int i= 0; i < array.length; c+= array[i++]&1);
       return c;
    }kind regards,
    Jos ( <-- never has to maintain others' code ;-)

  • How to display even and odd number ranges between two given inputs.

    Hi Every one,
    I am just started my career in sap abap and trying to find the solution for this.
    I am trying to display number range using select options, but I am getting an error "Memory low leave the transaction before taking a break".
    Example: when I give two number 2 and 10 , it should display set of all even and odd numbers in that range.
    Below is the code logic that I am using:
    data: a type i,
             b type i,
             c type i,
             d type i,
             num type i.
    select-options: in for num.
    a = inp-low.
    b=inp-high.
    c = inp-low mod 2.
    d = inp-high mod 2.
    while a <=b and c = 0.
    write: "even numbers:', a.
    b = a + 1.
    endwhile.
    while a <=b and c <> 0.
    write: "odd numbers:', b.
    b = a + 1.
    endwhile.
    Any help will be much appreciated.

    This is your logic...changed:
    data: a type i,
              b type i,
              c type i,
              d type i,
              num type i.
    data: even type i,
           odd  type i.
    select-options: in for num.
    a = in-low.
    b = in-high.
    c = a mod 2.
    if c is INITIAL. "It measn a is even
       even = a.
       odd  = a + 1.
    else.
       odd  = a.
       even = a + 1.
    endif.
    * Even
    a = even.
    while a <= b.
       write: / 'even numbers:', a.
    *  b = a + 1.
       a = a + 2. "The next even number
    endwhile.
    * Odd
    a = odd.
    while a <= b .
       write: / 'odd numbers:', a.
       a = a + 2. "The next odd number
    endwhile.

  • Split and add Even and odd numbers

    Hi All,
    I got a seven digit number any number say for example (6581231). Now i need to add even number and odd number separately.
    Output should be
    6 + 8 + 2 = 16
    5 + 1 + 3 + 1 = 10
    Thanks
    S

    Assuming the number is always 7 digits one way to do this would be:
    Data: string(7) type c,
             num type i.
             Nmod type i.
    **move the number to a string.
    Move num to string.
    split into 7 individual chars.
    Num1 = string+1
    Num2 = string+2.
    Num3 = string+3
    Etc…
    divide each by 2 and find remainder
    Nmod = num  mod 2.
    if remainder is 0, number is even
    If nmod = 0.
    Number is even.
    Else.
    Number is odd.
    Endif.

  • CSS Even and Odd VLANS

    On the Catalyst 5000 architecture, all Even VLANs are running on one BUS on the backplane and all the odd VLANs are running on the other BUS on the backplane. Is CSS work in the same way? Hence, is it going to be a problem if I have all Even VLANs or all Odd VLANs?
    Thanks,
    /david

    David,
    The CSS does not work in this manner so your vlans can be odd or even and have not effect on the css. The only thing to keep in mind is that ever 4 ports, 1-4, 5-8, 9-12, etc.. are on separate EPIFs. So when doing network planning, you may want to consider separating connections.
    For example, if you are only using a few ports on a CS150, it would be beneficial to use ports 1,5 and 9 as they are all on different EPIFs.
    Regards
    Pete Knoops
    Cisco Systems

  • Detecting even and odd numbers

    Hi, I'm drawing a series of rectangles using AS3, and need
    every alternate one to be lighter... I'm using a switch statement
    currently, with a variable counting the number of rectangles and
    case 1, case 2, case 3, etc.
    Is there a formula or some way of telling whether there is an
    even or odd number of rectangles so my switch statement can just be
    case even:, case odd: ? The way I have it is fine for 10 or so
    rectangles but I'd rather make it more expandable.
    Would appreciate any suggestions

    % is a modulo operator that finds a remainder of a division.
    9%2 = 1, 9%4 = 1, but 9%3 = 0.
    In the case of odd/even numbers one can look at it as that an
    even number that leaves no remainder when divided by 2 and odd
    number is a number that leaves remaining 1 when divided by
    2.

  • Change report margins according to even or odd page number

    Greetings specialist!
    I have a question regarding how can i change the left and right margins of a document depending wether it's an odd or even page.
    I would like to know if its possible to setup a different header and footer for odd and even pages as well.
    I tried using this formula in the left margin property of the report
    =IIF((Globals!PageNumber Mod 2)=0,"2,5cm","2cm")
    But it doesn't allow me :(
    Thank you for your time
    PS: I'm using SSRS 2008

    Hello Visakh16
    Thanx for the help.
    What do you mean by applying paging? It is not user input.
    My question was whether user will decide number of rows based on which paging has to be done or is it based on some value grouping etc
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Setting Up an External HD so that It Can Be Accessed Wirelessly From My Mac

    I have a 6 month old MacBook Pro running Leopard 10.5.2, an external Maxtor 500 GB HD formatted for "MAC OS Extended (Journaled)" I am using for mainly for my iPhoto Library and a Western Digital My Studio 1 TB drive formatted for "Mac OS Extended (J

  • Opening Help Topic in a New Window

    I'm posting this inquiry after searching the forum for the above topic. I have a client who requires that a contextual help page be opened in a new browser window when users press F1 in a web application screen. The client does not want help opened i

  • Fix "Folder Location" in Display

    I have a 2011 iMac that I transfered all my files to from a PC.  I had to buy Photoshop Elements 8.0 in order to transfer my catalogue of 10,000 images with all the tags and albums etc into the Organizer for the mac.  I understand that once images ar

  • Question:rman recover (error:Bad header found during inspecting archived )

    oracle9208 aix5.2 after restore database successfully,i recover database i receive info in alert_sid.log Corrupt block seq: 0 blocknum=1. Bad header found during inspecting archived log Data in bad block - seq:184680448. bno:369098753. time:0 beg:0 c

  • Windows did not detect any networking hardware, Windows 7, New Hard Drive

    Message "Windows did not detect any networking hardware" Satellite P505 S8980 Windows 7 Home Premium. I replaced the Toshiba 500 GB HD with 500 GB Seagate. Device Manager icon for any device with yellow exclamation mark, Click on "Update Driver".  La