How can the answer be improved? The Portable Document Format (PDF) was created by Adobe to promote a paperless working environment. PDFs can be viewed on any platform, but can't always be edited to remove or add pages. To do any kind of editing with the PDF, including splitting the file into separate pages, you must have Adobe Acrobat.
The most recent version of can do this too. Here is the commandline to be used inside a cmd.exe 'DOS-Box' window on a 32-bit Windows system: gswin32c.exe ^ -o originalpage%03d.pdf ^ -sDEVICE=pdfwrite ^ -sPDFSETTINGS=/prepress ^ original-multipage.pdf -o.: this indicates the name of the output file(s).%03d: this part of the filename will be translated into 3-digit numbers, padded by leading 0s, starting from 001 for the first page.sPDFSETTINGS=.: is an optional parameter; if used will ensure that all used fonts are embedded and some other settings which in general ensure a high quality output. Ghostscript is available for Windows. (The link above leads you to the installers: gs906w32.exe and gs906w64.exe.
Scroll down to find them.).
This is wonderful script. I´m struggling (and few million other InDesign CS5 users) with inDesign CS5´s new interactive PDF.
It makes all PDF by spreads. Cover page (and usually last page too) is single page and rest of the pages comes as pairs so page 1 is single page, but pages 2 and 3 are in PDF´s page 2, pages 4 and 5 in PDF´s page 3 and so on so you script is very usefull. There´s few things still that I would like to ask.
1) would it be hard to change it so that it didn´t split first page, because it´s practically always single page. Last page is also very often single page.
2) Now it seems to leave some interactive objects “floating” outside of page after splittind. For instance if I have a button in page 3 (page 2 in original PDF). After splitting, that button is exactly right place in page 3, but it´s also in page 2, but outside of the page, in a grey area. I´d like to ecommend this script anyway to InDesign users really great job. Script works for me under Acrobat XI standard as far as splitting the pages is concerned. But the bookmarks in the original document are lost.
Any way to retain those? The existing bookmarks point to a page with two pages on it. In most cases, a bookmark is meant for the “left” or “right” page. The script would have no way of knowing which page is the correct page. If the script could duplicate the bookmark for both split pages, I think it would be easier to delete the duplicate/incorrect bookmark rather than create all of the bookmarks from scratch. Because we are creating a new document, the bookmarks are lost. Here is the problem with bookmarks: A bookmark does not necessarily point to a PDF page.
It can point to a web site, it can be a trigger for something else, it can submit a form, And, to make things even more complicated, we don’t have access to whatever action is configured for a bookmark from within JavaScript. This means that there is no simple way to recreate the bookmarks tree in the target document. If you know that all your bookmarks are pointing to PDF pages, you can try to figure out what they are by executing the bookmark action using JavaScript, and then determine what page you are on. This allows you to at least create a new bookmark that goes to that target page (or, when you create it in the new document, to one of the pages it originally pointed to). I just stumbled across this and found the Split javascript very useful. (Thanks!) Is there a way to “unsplit” them — that is, to rejoin the two halves back into whole pages, as they were in the original document?
(That is, impose them 2-up.) I thought that was what the “reorder” script was meant to do, but it seems to be for some other purpose: when I use it on Acrobat XI, the resulting document has half pages, but now in a very mixed up order. (Not sure what sequence it’s meant to emulate.) Thanks. Victor, “unsplitting” these pages would be considered “imposing” them.
This is best done using dedicated imposition software. I use Quite Imposing Plus for this purpose. This is an Acrobat plug-in that requires Acrobat to be installed. There are also stand-alone tools you can use. Unfortunately, there is nothing that’s built into Acrobat that would allow you to do that without having to “refry” your PDF documents (that’s what printing a PDF file to another PDF file is called, and it’s usually a bad idea). This is fantastic stuff! I’m getting very close to finding a solution to a project I’m working on.
I’m trying to build a personal database of my PDF textbooks (text-editable, non OCR) and manuscripts, and I’m looking for automated workflow to create smaller chunks of text from larger documents. I can easily split using ‘Top-level bookmarks’ so a 20 chapter textbook gets sectioned into manageable bits. Taking this idea further, I’m wonding if I can apply a bookmark to subheadings and thereby split the chapter into new even smaller documents consisting of only a few paragraphs.
I’m not so interested in the illustrations, but capturing the text that goes along with, even if it’s filtered separately would be fine. What I am interested in is keeping separate columns and paragraphs that move from one page to another, together. Ultimately I’m going to put all of these smaller snippets into my DevonThink database, and if I do a search, and pull up a file, I would like the naming scheme for that file to maintain the hierarchy of the chapter, heading, subheading, and page number, from the original source.
Can you point me in the right direction? Thanks Karl, I’m happy I found it as well, thanks for writing! One more question, I have a funny batch of PDFs that I am splitting and need to move the page that comes out as the first page be the last page.
All other pages stay the same. I am curious if there is a way to tweek the two supplementary java scripts posted above (the ReversePages or Reorder script) to suit this function. This would be a separate item, and something that I would implement after the page split script. Thanks for any pointers, I am pretty new to this game. Hi Karl, I’ve been reading through your site, trying to help myself, and found the JavaScript Security “Enable Menu Items” was not checked. (It’s worked in the past, but again I don’t use it a lot and I may not have run it since installing Acrobat XI and I’ve also installed Windows 10 recently.
So quite a few things may have changed.) Anyway, I’ve rerun the script after enabling the security option and I no longer get the Internal Error. It took quite some time to run the script, but it did finish.
Saving the resulting file didn’t seem to work though. I saved the file to the desktop, the window stayed up for a while, then disappeared, but the pdf file never appeared on the desktop. (Voodoo, because it did show up when I did a search. I dragged it from the search window to the desktop and it was there.
I’ll have to try that again later.) More Voodoo – I then tried running the action which I also found while poking around. That took a much longer time to complete – but it did complete. The resulting file was 22GB – the original was only 115MB, so it created a file that was about 200 times larger than the original – I’ve never used the action before, and I’m not likely to if that happens a lot. (The javascript created a file roughly the same size) It’s late here, I’ll look into it some more tomorrow if I have time, For now I got a useable file so thanks again for the script. Cheers, Mario. I re-ran the action and again it produced a filed that was 200 times larger than the original.
I them used the “Audit Space Usage” button on the new file as you suggested. Everything Grew in size: Images 117,021,776 to 1,460,985,214 Content Streams 14,626 to 29, 573 Fonts 92 to 18, 754 Document Overhead 29,926 to 52, 242 X Object Forms 53,248 to 667,584 Cross Reference Table 11,860 to 792,581 Total 117,131,528 to 1,462,545,948 When I saved the optimized PDF it was back to the size it should have been. OH – BTW – I also figured out what went wrong with saving the file with the scriptI’ve got some issues with my library links it seemsso that’s a non-issue. Thanks, Mario.