-
1. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Patrick Leckey Feb 20, 2008 9:35 AM (in response to (Santiago_Gonzalez_Arriola))This can be easily accomplished through Visual Basic using the InsertPages method.
You can find information about that in the Interapplication Communication API Reference document included with the Acrobat SDK under the section "AcroExch.PDDoc".
You can find all the relevant documentation here:
http://www.adobe.com/devnet/acrobat/?navID=documentation -
2. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Bernd Alheit Feb 20, 2008 9:37 AM (in response to (Santiago_Gonzalez_Arriola))Read this:
http://www.planetpdf.com/developer/article.asp?ContentID=collating_pdfs_using_javascrip&rh s_fa -
3. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Patrick Leckey Feb 20, 2008 9:41 AM (in response to (Santiago_Gonzalez_Arriola))Bernd's answer is certainly better for a scripting beginner.
Gotta love German efficiency. -
4. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
(Santiago_Gonzalez_Arriola) Feb 20, 2008 10:15 AM (in response to (Santiago_Gonzalez_Arriola))Wow!!!!!!!
You guys are amazing!! Sweet deal, really appreciate it! would love to look into the BV scripting, but got a Master's thesis to finish.
Thank you guys so much! -
5. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Jon E P Jun 2, 2009 8:51 AM (in response to Bernd Alheit)Hi Bernd, thanks for posting this. Can you explain where to place the script? Sorry--my first time around with this. The site says to use the Javascript Debugger... not just create this as a script?
Thanks
JP
-
6. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Bernd Alheit Jun 2, 2009 9:27 AM (in response to Jon E P)You can execute the code in the Javascript Debugger.
-
7. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
omrico1 Jun 15, 2009 7:52 AM (in response to (Santiago_Gonzalez_Arriola))There is a simple application I wrote, which provide a solution for that
problem exactly. It is completly free, although you are more thanwelcome to donate in the site :-)
-
8. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
jbaitis Oct 30, 2009 7:52 PM (in response to (Santiago_Gonzalez_Arriola))I've attached a script that adds two menu items into the "Tools" menu. "Collate" merges even and odd pages, and "Reverse" will as reverse the order of the pages in a PDF.
To install it, exit Acrobat. Save the script into Acrobat's Javascripts directory (e.g. C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Javascripts ), and restart Acrobat.
I hope you find this script useful!
-
CollatePages.js 1.9 K
-
-
9. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
aa1508 Aug 6, 2011 6:17 PM (in response to (Santiago_Gonzalez_Arriola))OK, I JUST FIGURED OUT HOW TO DO THIS
Adobe Acrobat X Pro (may work with others also)
File
Create...
From Scanner...
Black and White (or another option)
Now scan the pages you have in order (pages 1,3,5,7.....)
when you are done it will give you three options
1. done
2. continue with more pages
3. continue with reverse sides
Select the third option to add the reverse sides of the pages.
Place the stack of papers to start from the last page first, and press scan again.
It will place the pages in the appropriate section of the document.
Hope this helps. Good luck.
-
10. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
dan-hariton Sep 28, 2011 11:24 PM (in response to jbaitis)- CollatePages.js (1.9 K)
was downloaded and placed in the following folder:
C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Javascripts
It worked as described by “JBAITIS”.
Had to open first the PDF file having ODD pages, in Acrobat9.
Next from “TOOLS” selected “COLLATE”.
After a brief error message, the name of the second PDF file having all EVEN pages was selected.
Clicked OK and done!
NB: for “COLLATE” to work you have to open a PDF file first, preferably the odd-pages PDF file.
Thank you “JBAITIS” for a GREAT and essential time-saver program, and thank you all.
Dan
-
11. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
jbaitis Sep 29, 2011 10:43 AM (in response to dan-hariton)Here is the latest version of this script, compabible with Acrobat X. The functions have been moved into the "Edit" menu because there is no tools menu in Acrobat X. It still maintains compatibility with Acrobat 9. Unfortunately, you'll have to manually copy and paste this into a file because Adobe has disabled the file attachment feature on Jive Forums.
// Complements: Planet PDF (http://www.planetpdf.com/)
// Modified by Jeff Baitis for Acrobat 9 and Acrobat X compatibility
// Improved Collate function with status bar.
// Add a menu item to reverse all pages in the active document
app.addMenuItem({ cName: "Reverse", cParent: "Edit", cExec: "trustedReversePages();", cEnable: "event.rc = (event.target != null);", nPos: 0 });
// Add a menu item to collate with another document on the filesystem
app.addMenuItem({ cName: "Collate", cParent: "Edit", 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();
})
-
12. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
declophi Oct 31, 2011 9:42 AM (in response to jbaitis)jbaitis's js file is an Excellent job, if I may!
-
13. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
ebug77 Dec 14, 2011 6:18 PM (in response to jbaitis)This js file is exactly what I needed but I'd like to added it the batch processing function. unfortunately when i copy the script and put it into the js sequence, it appears to run successfully but after i select the file to add, nothing happens. any ideas?
-
14. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Rowan! Oct 27, 2012 11:12 AM (in response to jbaitis)Wowie wow! This is what I've been pulling my hair out over for ages! Thank you so much for this JavaScript script. It works wonderfully and since I just wrote up a file for myself on installing and using it on a Mac, I thought I'd just copy/paste it here for other Mac users who are using Acrobat Pro X and need to collate their files. Hope this helps other Mac users:
So, for Macintosh users, there are Two Big Steps:
Big Step 1:
The CollatePages.js file has to be placed in
~/Library/Application Support/Adobe/Acrobat/10.0/JavaScripts
folder. To create the file, you can simply copy the script above then paste it into Textedit (make it a plain text file). See important note 2 below for naming it.
Five Important Notes:
- If you can't see the Library folder, then in the Finder, use the Option Key to select the Go menu: the home Library folder appears, which will get you into the home library folder that is normally not visible.
- At least for Acrobat X Pro, it can be copied and pasted into a file unaltered and it works without a problem. It doesn't really matter what the file is called just be sure to name it as a .js file, not as a .txt file.
- Be aware that an upgrade may make the file go away or no longer be read from the 10.0 folder! You can tell it's gone when the Collate & Reverse commands are missing under the Edit menu:

- If installing after an upgrade, then it's likely the folder '10.0' will have changed. The important note is to get the file into the JavaScripts folder that Acrobat Pro reads on startup. I'm saying that here because Acrobat Pro XI is (soon to be) out so it's likely the folder will change.
- Last, be sure to enable JavaScripts in Acrobat Pro itself: Under Acrobat -> Preferences, scroll down in the left Categories column to JavaScript (click that). On the right side under JavaScript, be sure the first two items: "Enable Acrobat JavaScript" and "Enable menu items JavaScript execution privileges" are both checked.
Big Step 2:
In Acrobat Pro, you collate two files: The odd pages file needs to be already open and the even pages file is opened using the Collate command (now under Edit in the menubar as the picture in Note 3 above shows). The file that gets added (presumably the even pages) gets interweaved with the first (already open) file starting at the second page.
If you have separate files for each page (either because they were scanned in separately or they were extracted within Acrobat to separate files) then you first need to combine them into one file for odds and evens.
The Reverse command simply reverses the page order of the open file; possibly helpful if a source file has its pages in the opposite order before collating.
Last, you could, if you want to, click on Yes (this was helpful) below.
-
15. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
earthmag Jan 21, 2013 7:35 PM (in response to jbaitis)jbaitis, your script is exactly what I've been looking for. Do you have paypal as I'm feeling the need to make a small monetary contribution.
-
16. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
jbaitis Jan 21, 2013 9:33 PM (in response to earthmag)Hi Earthmag!
Thank you for offering to contribute. May I request that you contribute to some of my favorite software-related organizations:
- Software in the Public Interest ( spi-inc.org )
- Free Software Foundation ( fsf.org )
- FreeBSD Project ( freebsd.org )
or any allied academic institution? That would be the best way of saying "thanks" with $$$ that I can think of! :-)
Please note that I am not the original author of either of the scripts -- I merely made them a little easier to install and to use.
-
17. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
LarrySmith1000 Jan 22, 2013 11:50 PM (in response to (Santiago_Gonzalez_Arriola))Not to knock on Adobe, but until they figure out that this function is needed (this thread has been around for 4 years, do they read these things), you can use this:
http://sourceforge.net/projects/pdfsam/files/pdfsam/2.2.2/pdfsam-x64-v2_2_2.msi/download
It does exactly what you are asking for, and it is free. Once it is open, select "alternate mix".
There are many other functions too.
Adobe, if you are reading this, please compile your programs for Linux to please.
-
18. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer Mar 5, 2013 12:41 PM (in response to jbaitis)Thank you for this, but unfortunately I cannot get it to work with Acrobat XI Standard. I can't believe that Adobe still hasn't made this a feature.
-
19. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
GKaiseril Mar 5, 2013 2:01 PM (in response to Mark Cramer)Did you look at the Planet PDF solution? For Acrobat X and XI you need to install the per
User JavaScript Changes for 10.1.1 (Acrobat | Reader) and for XI change 10.0 to 11.0. -
20. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer Mar 5, 2013 2:49 PM (in response to GKaiseril)Thank you, GKaiseril! Yes, I looked at the Planet PDF solution but was unable to get it to work. The link you gave says that the new location for the JS is going to be Users\(username)\AppData\Roaming\Adobe\Acrobat\Privileged\10.0\JavaScripts, however, after C:\Users\Mark\AppData\Roaming\Adobe\Acrobat I have no folder called "Priviledged". I turned on "Hidden Items". Maybe this is because I have Windows 8, I'm not sure. I can get to C:\Users\Mark\AppData\Roaming\Adobe\Acrobat\11.0 but there's no "Priviledged" folder there either. Nor is there any "JavaScripts" folder. I don't know where to go from here.
-
21. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
GKaiseril Mar 6, 2013 8:45 AM (in response to Mark Cramer)You can run the code using the JavaScript console for a one time use.
Open the odd pages PDF.
Open the JavaScript Console, "Ctrl + J.
Copy and paste the revised script to the console window.
Select all the text in the console window.
Use the Ctrl + Numeric Keypad Enter key to run the code.
You should now have the new menu options until you restart Acrobat.
I would move the code to add the menu items to after the creation of the trusted functions.
-
22. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer Mar 6, 2013 10:24 AM (in response to GKaiseril)Thank you again, GKaiseril. This is a bit frustrating. Ctrl+J does not open the JavaScript Console. I took a look at http://acrobatusers.com/tutorials/javascript_console and it says that you can also get there using Advanced>JavaScript>Debugger, but I can't find the "Advanced" menu item either. I'm running Adobe Acrobat XI v11.0.2 if that helps. Any other ideas?
-
23. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Test Screen Name Mar 6, 2013 10:35 AM (in response to Mark Cramer)Almost all the menu items moved to the TOOLS button in Acrobat X. So JavaScript options are there for you.
-
24. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer Mar 6, 2013 11:51 AM (in response to Test Screen Name)I found the Tools button, but there is nothing there relating to JavaScript. I have "content editing", "pages", "interactive objects", "forms", "text recognition" and "protection". I've clicked on all of them and there is nothing. I also found a Common Tools button but there is nothing there either.
-
25. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Test Screen Name Mar 6, 2013 12:26 PM (in response to Mark Cramer)Above those tools, and below the Tools button, is a little icon. I can't describe it, but you should be able to find it. Click on it and you'll see you can turn on a whole lot more options (it will list Content Editing, Pages, etc. with a tick).
-
26. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer Mar 6, 2013 2:10 PM (in response to Test Screen Name)Thank you again. I'm getting close to giving up here, however. I found the JavaScript button which has a button "Set document actions". When I press it I get a box that says, "When this happens..." with options like "Document will close" and "Document will save." I opened up a couple of them and pasted in the JS and tried to run it, but nothing happened.
-
27. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
krazykat10 May 2, 2013 4:33 PM (in response to Mark Cramer)@Mark Cramer
Did you ever get the script to work? I have been reading the trail of your efforts and need to do the same thing. If you have any updates could you post? Or if Gkaiseril or Test Screen Name have additional comments or directions they would be appreciated,
Thank you
-
28. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer May 2, 2013 4:40 PM (in response to krazykat10)@krazykat10 - Unfortunately I was never able to get it to work. I tried all of the suggestions above and then monkeyed around with it a bit more before giving up.
-
29. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
GKaiseril May 3, 2013 8:29 AM (in response to Mark Cramer)You can not just cut and paste the text for many reasons.
Like the old joke about the IBM repairman the walks to the computer. He runs his hand over the side of the computer. Pulls a hammer out of his tool box and taps the side of the computer.
The IS manager says, "I could have that!"
To which the repairman states "It is not in hitting the computer, it is knowing where to hit the computer!".
If the scripts are installed in the directory needed by your version and not necessarily the one in the article.
Also one cannot use Word for editing the text.
If you want more help more specific information is needed as to what exactly is not working, any pop up warnings, and any JavaScript errors.
One of the scripts adds a menu option, so you need to install that script in the "JavaScript" folder for the version of Acrobat that you are using.
These scripts can only work in Acrobat.
Look at PDFtk and the shuffle operation to collate pages. There are even more options than provided by the scripts/
If at 60+ and no computer training in college and not an IT professional, if I can figure this out, you should be able to resolve it.
-
30. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer May 3, 2013 1:57 PM (in response to GKaiseril)@GKaiseril What version of Acrobat do you have? I have Acrobat 11 and I think that might be the issue. By the way, I hit my computer with a hammer and that did not help. Thank you for your continued assistance! I kind of gave up hope earlier, but I've got a 50-page document that needs collating so I'm willing to give it another try. (I'm still irritated that this isn't a standard feature, but hey...)
-
31. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
GKaiseril May 3, 2013 2:08 PM (in response to Mark Cramer)Have systems with version 8, 9, X, and XI.
There are features that are far more needed than a collation tool.
For the project I needed this for, I ran it through the JavaScript console.
-
32. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer May 3, 2013 2:19 PM (in response to GKaiseril)@Gkaiseril - So with Acrobat XI, what happens when you get to the "Set document actions" button? Here is what I said previously when I got stuck. I have no idea how to go from there.
Mark Cramer wrote:
I found the JavaScript button which has a button "Set document actions". When I press it I get a box that says, "When this happens..." with options like "Document will close" and "Document will save." I opened up a couple of them and pasted in the JS and tried to run it, but nothing happened. -
33. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
GKaiseril May 3, 2013 2:35 PM (in response to Mark Cramer)Do not use the "Set Document" actions. These actions are for use when printing, opening, saving, or closing a PDF. They have nothing to do with combining PDFs and I do not see were they are appropriate.
If you get the scripts in the correct folder for your version of Acrobat, you should see the added buttons under the "Edit" menu option.
-
34. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Mark Cramer May 3, 2013 3:56 PM (in response to GKaiseril)Holy cow! I'm finding this a little hard to believe, but I got it to work. With Adobe XI the folder is C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Javascripts. I just copied the script above, saved it as collate.js and voilà. Amazing. Thank you, GKaiseril, for all the help! I'll put my hammer away now.
-
35. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
misc_fruitbat May 21, 2013 2:15 PM (in response to Mark Cramer)Hello, it sounds like the javascript solution will suit most people, but it is possible to do it yet another way!
For instance, you have scanned a book two pages per pdf page.
Create directories "odd" "even" and "output".
You crop all the odd pages and extract all pages to the odd directory as separate files.
Undo the crop, then crop all the even pages and extract all pages to the even directory as separate files.
The file prefix must be the same for the odd and even pages, which is why I use undo and recrop.
Select "Add Bates Numbering" under pages, edit page design.
Select the "odd" directory and output to the "output" directory. Add a zero to the original file name in output options.
Select the "even" directory and output to the "output" directory. Add a one to the original file name in output options.
You should have in the output directory pages in pairs like, mybook 10.pdf mybook 11.pdf, mybook 20.pdf mybook 21.pdf.
If you select "Combine Files" in Acrobat and select the "output" directory, they will appear in order.
-
36. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Ideasmiths Jun 7, 2013 10:13 PM (in response to misc_fruitbat)Thanks to misc_fruitbat for the great idea.....some of the steps got me messed up as I was unfamiliar with the command. I manged to experiment and was successful. Am adding these pictures as guides, so others may benefit from the bates processing method
I started out with a 75 pages A4 landscape, company instruction manual. The final PDF file is 150 pages with the odd and even pages correctly in sequence.
You may need to click on each picture to see the full image....
Extracting to single pages
Bates Numbering process - adding all the pdf in a folder
Odd pages bates numbering processing
Even pages processing
Combining the output folder with correct arrangement of the odd and even pages
-
37. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
zw@adobe Aug 5, 2013 9:44 AM (in response to Ideasmiths)@ Ideasmiths: Thanks a lot for the imaging instruction. It helps a lot!
However, my Acrobat 9 Pro does not turn out to be a correct arrangement of the file names, whenever the names end with pure numeric numbers like B1, B2, B3…B12. I mean, no matter in window “Combine Files” or “Bates Numbering”, my files are automatically listed in a wrong order like B1, B10, B11, B12, B2, B3, … , rather than B1, B2, B3,…, B12 as shown in your images. I clicked the Name column tab trying to sort them, but useless. You know, one cannot move EACH up & down manually into a correct order, if the total files are up to hundreds or thousands. It's so frustrating.
Could you or any other expert give me some solutions to fix this please?
-
38. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
Ideasmiths Aug 5, 2013 8:24 PM (in response to zw@adobe)You didn't mention your windows operating system so I guess it's XP or vista? Because from your description it sounds like the sequence of the files are 'wrong' when viewed in window explorer either using list or detail views. Normally this should be A1, A2....A10, but you are seeing A1, A10, A11.....A2, A21...etc
This then may not be the issue with Acrobat 9 but the windows operating system?
-
39. Re: Combining an even pages file and an odd pages file into one PDF achieving propper order
zw@adobe Aug 5, 2013 9:20 PM (in response to Ideasmiths)Thanks for your reply.
My operating system is Windows 7. And the sequence of these numeric-named files are in right order when they are in a file folder on my computer. I guess the problem is still from my Acrobat 9 Pro. But I don't know how to fix it. Appreciate if you could help.









