Page Splitter Redux

One of my more popular blog posts was about splitting PDF pages. I wrote that post five years ago and I am still getting regular feedback and questions.

The original script was written for Acrobat 9, and used the “Documents” menu for it’s menu item. Since then, the Acrobat user interface was changed considerably, and there is no longer a “Documents” menu. It’s not too complicated to move the menu to the “Edit” menu, but most of my readers don’t have JavaScript programming experience, and source code does look a bit intimidating if you don’t work with it every day.

In Acrobat X and XI we also have a different method of running the script: We can create an Action using the Action Wizard that takes one or more documents and creates new documents with the split pages. The biggest advantage an Action has is that you can install it by just double-clicking on the SEQU file. The biggest disadvantage of an Action is that it only works for Adobe Acrobat Pro – the Standard version does not support Actions.

So, let’s take a second look at the page splitter script and make it easier to install for users of Adobe Acrobat X or XI.

If you have Adobe Acrobat Pro, then use the following links to download the Action file. It will have a .sequ file extension, and when you double-click it, it should ask you if you want to install it in Acrobat.

You can install and run the Acrobat X Action in Acrobat XI, but you will not be able to edit it. The actions will automatically split one or more documents and will save the document with a “-split” added to the original filename in the same directory that the original document is stored in. So, if you have a document named scan.pdf, you will get a new file that is called scan-spit.pdf in the same directory that scan.pdf is stored in. For Acrobat XI Pro users, installing the Action is the easiest way to get access to this functionality.

If you are interested in the updated folder level script, you can download it from here: splitpages.js

This file needs to be installed in one of the two Acrobat JavaScripts directories on your system. See my previous blog post about where folder level JavaScripts have to be stored for more information.

To make things easier, try to install the script in the application level JavaScripts directory. This directory should always be there, whereas the user directory may have to be created by you. Let’s assume you are installing the script in Acrobat XI, the JavaScripts directory should exist in one of these two locations on a Windows system:

C:\Program Files\Adobe\Acrobat 11.0\Acrobat\Javascripts

 

C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Javascripts

On a Mac, the corresponding directory would be (this is a long path, so you will have to scroll):

/Applications/Adobe Acrobat XI Pro/Adobe Acrobat Pro.app/Contents/Resources/JavaScripts

If you are running Acrobat on Windows, and you don’t want to deal with figuring out where to install the scripts, you can use an installer I’ve created – all it does is trying to figure out where Acrobat’s JavaScript directory is, and install the script. Download the installer from here. If you have multiple versions of Acrobat installed, the script will only be installed in one version.

After this script is installed, and you restart Acrobat, you should find a new menu item at the bottom of the “Edit” menu in Acrobat. Differently from the Action, the “Split Pages” function will create a new document, but will not save it. It’s the user’s responsibility to save this file.

In order to get this folder level script to run, you need to change one setting in Acrobat’s Preferences: Bring up the Preferences dialog, then go go the JavaScript category:

2014 04 28 12 36 05

Now enable the settings “Enable menu items JavaScript execution privileges”. Without this setting, you will get an internal error when trying to run the function.

This entry was posted in Acrobat, JavaScript, PDF and tagged , , , . Bookmark the permalink.

46 Responses to Page Splitter Redux

  1. John Terdik says:

    OK I really like the idea but for reasons I don’t understand it is not working for me.
    1) First I manually created the splitpages.js file in C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Javascripts, restarted and I did NOT see the Splitpages in the Edit dropdown.
    2) I downloaded the splitpages.exe file, closed Acrobat, ran the EXE file, started Acrobat XI (I’m running Win10 x64), open my file, clicked the Edit, in the dropdown I still do not see SplitPages. Forgot to mention I did update the preferences as document above.
    3) Using Everything (search tool) I looked for Splitpages.js and there is only one file and it is in the correct folder per the instructions above.

  2. Karl Heinz Kremer says:

    John,

    I would add a debug alert message in the script to see if it gets loaded at all. You can do this by adding “app.alert(“script is loading”);” to script, but make sure it’s outside of any function body.

  3. Kelly says:

    Thank you!!!! I’m a librarian and we often scan 2 pages at once from books, this script has made my job so much easier!!!

  4. Steve Xu says:

    Hi John,

    Thanks for the file! It works like a charm. However, sometimes the middle of two pages is not actually the middle of the pdf file, and the result pdf has pages that include a bit of the next page. Is there anyway to customize the position of the cut? Thanks

  5. Karl Heinz Kremer says:

    Steve, as long as the position where you need to make the “cut” is predictable or calculable, you can adjust the JavaScript. You will run into problems when the two pages that are on one sheet are not of the same size.

  6. Agus says:

    Karl, Nice as others have said it works like a charm, but I needed to right click the link to the XI version and download directly to get access to the action. Then it is not fully updated to DC but it works inside the Action Wizard set. Thanks a lot

  7. Karl Heinz Kremer says:

    Agus, right-clicking to download is a pretty standard command in many browsers. Actions from older versions of Acrobat can be executed in a newer version, but it cannot be modified. That’s the case when going from e.g. Acrobat X to XI as well.

  8. Tricia says:

    Hi Karl, how can I make it work under macosx?

  9. Karl Heinz Kremer says:

    Tricia, this should work on a Mac as well. Look through the page, there is the path you need to use for installing it on a Mac. Keep in mind that this article is more than 3 years old, and was written for Acrobat XI, so if you are trying to use this with Acrobat DC, you need to adjust the path.

  10. Tricia says:

    Hi again, please don’t worry about my question, after some research I’ve found the way…Thanks!!!

  11. Yanny says:

    The link for Acrobat XI is not working… 🙁
    Please kindly look into it! Looking forward to the Action!

  12. Yanny says:

    After reading the comment, I know I made a silly mistake!
    Thank you SO MUCH for the Action! It worked perfectly! Have been searching for a solution for hours so thank you so much for your selfless sharing!

  13. Sentience says:

    Can it work for Adobe Acrobat Reader DC? I’ve been trying it and it’s not working.

  14. Gabriel says:

    Hi Karl,

    Thank you so much for your help!
    This tool is amazing!

  15. Karl Heinz Kremer says:

    Sentience, no this will not work with the free Reader. Reader cannot modify PDF files (with some very limited exceptions), which is necessary for this functionality.

  16. Lorax98 says:

    This is slick. Exactly what I wanted. A feature that Adobe should have included straight out of the box.

  17. Aboobs says:

    I wanted Action File for Acrobat XI Pro. I clicked, but instead of downloading the .sequ file it opened an .xml in the browser. I copied the content to a notepad and saved as .sequ. Unfortunately, it refused to work.

    I then right-clicked and downloaded the .xml file and changed the extension to .sequ. I then double-clicked to import it to Acrobat XI. It works like magic. Thanks, Karl Heinz Kremer. You made my day. Thanks again

  18. Ruthie says:

    Thanks so much for this! At first I thought it didn’t work and I was sad, because I went through the saving process “Aboobs” mentioned above and it managed to install just fine (which was good because no matter what I did, I couldn’t find that subfolder for Mac OSX you have listed; there is no “Contents” folder for me at all, nor does a search for folders named “JavaScript” turn up anything). But nothing seemed to output, despite all the dialogue boxes saying “Success!”, so I chalked it up to a bad job. But then, lo and behold, I found a new file with “split” in the name right next to the old one in the folder! I thought it was going to create and open the file in Acrobat XI, and I’d have to save it myself. I must have misread the sequence.

    In any case, I have some further advice for people using this to clean their PDFs to make them beautiful.

    First, use the “Crop Box” feature (right click on a page thumbnail, and select Crop Pages to bring up the menu) and its ability to apply itself to Even or Odd pages only to batch adjust the pages so they are all centered the way you want, and you’ve gotten rid of any page gutters or black spaces at the edges. (Sometimes weird artifacts in the scanning process result in the pages having to be slightly different sizes in order to remove all the black areas or edge elements. I hate PDFs with different page sizes, but this will be fixed in the last step.)

    Next, under “Tools”, go to the “Text Recognition” function and click the “In This File” option and run it across all pages. This will a) re-align the page to any text that is crooked from the scan during the OCR process, and b) *permanently* crop those pages, meaning it discards everything outside of the Crop Box you created in the previous step. (Before you use OCR, the rest of the scan is still there, it’s just not “visible”.) [see note 1]

    Finally, open the Crop Box again. You will see that all of the areas outside the Crop Boxes you defined before are gone! Now you can *add extra white space* by using the “Change Page Size” portion of the menu by selecting “Fixed Sizes” and picking the size of virtual paper you want from the drop down menu. [see note 2] Then under “Page Range” select “All”, hit OK and you have beautiful, highlight-able, copy-paste-able, margins-for-notes-able PDFs where every page is the same size.

    Happy cleaning!

    [Note 1: As far as I can tell, this is the only way to get Adobe Acrobat to re-align scanned pages OR to permanently crop the contents. Why are these features inaccessible to the average user, even though they exist *somewhere* in the program? I don’t know. I have been known to run text recognition on pages that don’t even have any text on them in order to crop them. Gotta do what you gotta do.]

    [Note 2: I have occasionally been able to do this on pages that are *smaller* than the current scan, but regularly run into problems where it won’t let me select a page size that is smaller than the current one. This can be somewhat adjusted by running the Crop Box again, but if your pages were scanned at a very high resolution and size you may need to resort to some resizing options before being able to do this. You can also pick a slightly bigger piece of paper than you’re used to, especially if you don’t intend to print it. I regularly use Executive, Letter and Legal.]

  19. Rick says:

    Hello Karl, it works perfectly with Acrobat DC! Just what I needed!

    Thank you very much!

  20. Chelle says:

    Thank you! This is exactly what I needed.

  21. Chris S. says:

    Karl,

    I have some files with single first pages and others with double first pages. Is there a way to get both .js functions to appear and work in the “Edit” menu (of Adobe Acrobat DC) so I could chose the correct function based upon first page type?

    I tied putting this script and the script from the older page’s comments section into the same “C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts” folder. I renamed one to splitpages1.js, but couldn’t get it to work. Other than that, it works great. Thank you.

  22. Karl Heinz Kremer says:

    Chris, you have to make sure that the cName (and cUser) information is different in the call to app.addMenuItem(). I assume that your two scripts use the same name for the menu item, and that will not work.

  23. Joel says:

    This tool looks great, and it’s free! Thank you.

    Can you change it to split the page horizontally and not vertically?

  24. Jenn D. says:

    Fantastic solution; thank you so much for sharing it, and for maintaining the instructions as time marches on!

  25. Karl Heinz Kremer says:

    Joel, yes, you need to change the cropLeft and cropRight to be top and bottom.

  26. Christopher Brown says:

    Karl, I tried changing the cropLeft and cropRight to be top and bottom, but it still continues to split the pages vertically.

  27. Karl Heinz Kremer says:

    Christopher, unfortunately I don’t have the right now to work on a solution (my paying customers always come first). When I find some time, I will take a look.

  28. Christopher Brown says:

    Thank you. I found a temporary workaround. I rotated the pages 90 degrees, ran the split, then rotated the pages back. Seemed to work just fine.

    Thanks again!

  29. Jelly says:

    I’ve been looking for hours, even tried the suggested “quite imoposing” demo for nothing..this is just perfect! thank you!

  30. Jelly says:

    By the way, do you have the opposite? Merging 2 pages into one page? I have a pdf compose of pure half images. And I have to do it by batch since it is about 68 (half image) pages long. So in the end I will only have 34 (whole image) pages. Thanks again!

  31. dawn says:

    hi! when i click on the Action download, a new page opens that says the XML file does not appear to have any style information associated. the document tree is shown below. what do i do after that?

  32. Karl Heinz Kremer says:

    Dawn, it sounds like your web browser is opening the XML file. Right-click on the download link and select to save the file so that it does not get opened.

  33. Karl Heinz Kremer says:

    Jelly, this can be done using imposition software. And no, I don’t have a solution for that. Just google for “PDF imposition” and see what you can find. My tool of choice is Quite Imposing Plus (http://www.quite.com). This may be a bit too expensive for just one job however.

  34. ScrappyScott says:

    Dear Mr. Kremer, Thank you so much for offering this solution, it does precisely what I need. However, I do have one question. I am using Split Pages in Acrobat XI Pro on a Macbook running MacOS 10.13.3 and when I open Split Pages from the Action Wizards section of Tools the Split Pages buttons overlap each other and there is no contextual information. It seems that clicking either the Start button or the Execute JavaScript line do the same thing. Am I missing something else that I should be doing or is it just as well to continue what I have done thus far. Thank you once again for providing such a necessary feature to the Acrobat users community.

  35. Karl Heinz Kremer says:

    Scott, it sounds like there is something wrong with how user interface items are being displayed on your screen. I am not aware of any problems that would result in that, or how to fix this. If you want, you can send a screenshot to me via email. My email address is on the “About” page.

  36. Brian Rice says:

    A very neat solution which I downloaded very easily. My only issue is that when I split a page and save each half as a separate file, they are both the same file size as the original double page file. This suggest the software is “hiding” the unwanted part rather than actually deleting it. The result is that the new “book” is twice the size of the original “book”. Or am I missing something here?

  37. Karl Heinz Kremer says:

    Brian, whether the file will get smaller or bigger depends on the original file. You are right, we are not removing any information during the actual splitting process. However, some PDF files contain extra data that might get removed when you run this routine. Here is an example. I have a InDesign document (PDF file created from within InDesign). This file has 28 pages and it’s size is about 740KB, when I run the action I end up with a file that contains 56 pages and is 387KB. As you can see, we cut the file size in half. This is not typical, but can happen. When I take the original file and remove anything that is not absolutely necessary to display the pages (that is all meta data and data that InDesign thought might be good to have in the PDF file), I end up with a file that is 218KB in size. When I split that, I end up with a file that’s again 387KB, so in this case we went up, but not by a factor of 2. Acrobat will try to optimize the file, and it knows that we are using the same content on two pages, and it will try to re-use as much as possible from the content that was already used on page 1, when it creates page 2. If you want to remove the extra (now hidden) content, you can use either Acrobat’s “Remove Hidden Information” tool, which however very likely makes the file much bigger (2.5MB in my example) because it needs to rasterize certain content, or use the “Remove page objects that are completely outside of crop area” preflight fixup. This will bring down the file size slightly (in my case to 360KB). This will not give you anything smaller if your source file contains e.g. a scanned image, because the whole image would span the area from within the crop area to outside of the crop area, so such an image cannot be removed buy this fixup. In this case, the “remove hidden information” function may give you better results.

  38. Asterix1968 says:

    Dear Mr. Kremer, Thank you so much for offering this wonderful solution, it does precisely what I need. However, I do have one question. I often scan A3 examination papers being a teacher and when running the split action I end up with scans with pages out of order. Is there anyway, I can set the action to reorder the pages based on the number of pages entered. I can do it manually but would like to automate the process. Many thanks.

  39. Karl Heinz Kremer says:

    What is the desired order of the pages? If you process a document that has pages in a certain order (e.g. for a booklet), and want to order them back into a sequential page order, then that certainly can be done, but it would require a bit more JavaScript programming. What I published here is something that works for probably 95% of all users, and I am leaving the customizations for the remaining 5% up to those users. If you would like my professional help with this, feel free to contact me via email – may email address is on the “About” page.

  40. MK says:

    Mr. Kremer,
    Everything works. I’ve got a 17.85 x 11.0 Tri-fold PDF and when I use this it splits the PDF into only two PDF’s, 8.92 x 11.0. How can I get this to split into three equal parts? What am I doing wrong? Thanks!

  41. Karl Heinz Kremer says:

    Hi MK, the software as presented in this (and the earlier) post only handles splitting a PDF page into two. You can however modify the script to handle trifold documents as well: This would require that you end up with three copies of each page instead of just two, and then crop out one third of the page instead of half. This does require some programming, but it’s certainly possible. If you need professional help with this, feel free to get in touch with me via email.

  42. Dave says:

    Amazing. Thanks! Works as advertised in Acrobat XI Pro.

  43. Chris says:

    Thank you for a fantastic script and tutorial! Exactly what I needed 🙂

  44. Kevin Hulburt says:

    Wow. Thank you. This worked perfectly.

  45. Henri says:

    This is a very helpful tool! Thank you for that!

    I had no issues when I was using split pages on Acrobat Pro, but now with Acrobat DC 2018, after I split pages, I no longer see the split pages in the crop mode (page thumbnails). Instead, I see the original page (before splitting).

    Why is this and is there something I can do?

  46. Karl Heinz Kremer says:

    Henri, I have not tried the script with the latest version of Acrobat. When I find a free minute, I’ll give that a try and let you know.

Leave a Reply

Your email address will not be published. Required fields are marked *