开发者

How to vertically split a PDF e-book with collation (2-page per sheet to 1 sheet per page)

开发者 https://www.devze.com 2023-02-11 10:44 出处:网络
I have a scanned e-book with 2 pages per sheet. I was able to crop the e-book for the white borders on four sides. Since the two book sheets are on one single page, I am getting bad view on e-reader l

I have a scanned e-book with 2 pages per sheet. I was able to crop the e-book for the white borders on four sides. Since the two book sheets are on one single page, I am getting bad view on e-reader like kindle. I am trying to split the e-book to 1 page per sheet. Is the开发者_如何学JAVAre a way to to do this in acrobat professional?

I thought of cropping the pdf as two batches (left and right) and merging them together but the page collation will go off completely. the pages won't come adjacent to each other. I will get 1,3,5,7 upto 101 as one pdf and 2,4,6....100 as another PDF

 pLEASE provide me a solution in acrobat professional


You can merge the PDFs back together in script. When running from Acrobat, JS has access to quite a few functions that aren't available in Reader.

doc.insertPages(nPageInDoc, pathToOtherPDF, nStartPage, nEndPage)

So you could create a script in a button in one of your 1,3,5,7... files to import all the pages from the other. Something like:

var oddPagesDoc = app.openDoc("c:\\oddPages.pdf");
var evenPagesDoc = app.openDoc("c:\\evenPages.pdf");
var evenPageCount = evenPagesDoc.numPages;

for (var i = 0; i < evenPageCount; ++i) {
  oddPagesDoc.insertPages(i, "c:\\evenPages.pdf", i, i);
}

So insert a button into the "odd pages" file with the above script as the button's "mouse down" javascript action. Click. Delete the button.

It's entirely possible there's an "off by one" error in my script, so I don't recommend saving over the original until you're sure everything was assembled properly.


If you Adobe Acrobat Pro, there is a way to do this without scripting. It's quite tedious, but I'll explain:

I advise you to make a copy of the file first

  1. Crop the left part of the page: Select Crop pages, if it's an A4 sheet then for Margin Controls use Right = 14.85, for Page Range select All. Save as left.pdf
  2. Extract all the left pages as separate files: in the file left.pdf, select Extract pages, edit the From and To boxes to select all the pages, check the box Extract Pages As Separate Files. Now select a folder to save all the files in, it will name them left 1.pdf, left 2.pdf, left 3.pdf, etc
  3. Repeat step 1 for the right side of the page: open original file, crop at Left = 14.85 for all pages and save as right.pdf
  4. Repeat step 2 for right.pdf to extract all the pages into the same folder as right 1.pdf, right 2.pdf, right 3.pdf, etc
  5. In Acrobat choose Create -> Combine Files into a Single PDF, and navigate to the folder where you've saved all the separate pages. You can rearrange the files into the correct order, i.e. left 1.pdf, right 1.pdf, left 2.pdf, right 2.pdf, etc. Then click Combine Files and save your new ebook.

Tip: if you have many pages in the book, it can take quite long to rearrange the files when combining them. Acrobat arranges them alphabetically, so it would be better if the files were named, for instance for a PDF with 354 pages, 001left.pdf, 002right.pdf, ..., 354left.pdf, 354right.pdf. I can't find any setting in Acrobat to change the default name. But you could use this free tool to batch rename files: http://www.snapfiles.com/get/denrenamer.html


The following modified script (idea based on the previous answer) worked for me:

for (var i = 0; i < pageCount; i++) {
  this.insertPages({nPage:2*i,cPath:"/C/***/fileName.pdf",nStart: i,nEnd: i});
}

Multiplication by 2 is needed since when you're inserting pages, your page numbering shifts.

0

精彩评论

暂无评论...
验证码 换一张
取 消