7

Assume you have a PDF file resulting from a scan of multiple pages of a book (in a format smaller than the scanner default format (e.g. 10cm x 20cm and DIN A4)) and that the person who scanned placed the book rather at arbitrary positions on the scanner. Is there a tool which either

  • allows autoremoval of those margins (miscalculations of the margin are rather unlikely, but have to be accepted)
  • allows to go from page to page and remove the dark margins based on proposals of the program (I don't want to have to use any sort of editing tools beyond that, maybe correct the proposal, but not define the margin from the start by dragging a frame, moving split lines or something similar)

The transformation PDF -> image(s) -> PDF shouldn't be the problem and one can do that with two or three commands on command line, so if a batchable solution exists for images, I'd consider it a solution.

  • Looks like the PDF is all images. One 'medium level of work' I can think of is: export the images then batch process them with OCR software. But then you'd have text instead of images, and that may go too far for you. – Jan Doggen Jul 8 '14 at 7:18
  • Photoshop? It's capable of handling PDF files and you can remove those unwanted dark areas easily with it I suppose? – Neeku Jul 8 '14 at 9:02
  • @Neeku Yes, but Photoshop doesn't have the automation I described ("I don't want to have to use any sort of editing tools beyond [the auto-generated proposal of the software]"). I could use any image editing software, even much less sophisticated and/or free alternatives to Photoshop. – Karl Richter Jul 8 '14 at 10:25
  • Right. Not sure if I get what you mean by the automation, but you can make macros (Actions) in Photoshop to do the repetitive actions for you. But again, yep! I understand that PS is more for images than PDFs. Also, I could manage to remember the name of the app I used years ago on Windows, Nitro PDF. Not sure if I should put it down there as an answer, since I can't remember if it had that feature, but I was usually very happy editing PDFs with it. – Neeku Jul 8 '14 at 10:31
  • 1
    I guess that GIMP and blender have also a lot of possibilities to script (great Python API and/or bindings), but it's rather non-trivial and I cannot imagine this to be easier in Photoshop. Furthermore I assume that macro recording based on GUI actions (in any application) won't spare you the implementation of the margin recognition logic. – Karl Richter Jul 8 '14 at 10:58
2

Try the following software:

  • Unpaper [cmd-line tool, Cross-Platform]

    Post-processing tool for scanned sheets of paper, especially for book pages that have been scanned from previously created photocopies. The main purpose is to make scanned book pages better readable on screen after conversion to PDF. Additionally, unpaper might be useful to enhance the quality of scanned pages before performing optical character recognition (OCR). unpaper tries to clean scanned images by removing dark edges that appeared through scanning or copying on areas outside the actual page content (e.g. dark areas between the left-hand-side and the right-hand-side of a double- sided book-page scan).

    OSX installation via Homebrew: brew install unpaper

  • Scan Tailor (GitHub) [Windows/OSX/Linux]

    Interactive post-processing tool for scanned pages. It performs operations such as page splitting, deskewing, adding/removing borders, and others.

    OSX installation via Homebrew: brew install scantailor

  • Book Scan Wizard [Java/Cross-Platform]

    A utility to help with Book scanning using cameras as a scanner. It will automate things such as cropping, rotating, fixing keystoning, fixing the DPI, and outputing it to tiff files that can be changed into PDF's or ebooks.

  • DIY Book Scanner Image Postprocessor

    An image postprocessor for the DIY Book Scanner described on instructables.com and DIY Book Scanner. Gets images ready for OCR or for PDF. Written in Java based on a partial port of the Leptonica image processing library.

Related posts:

1

You may try ImBatch program. It is a batch image processing tool for Windows. It can take multipage PDF file as an input, each page can be processed as image with "Autocrop" task, then add "Save to PDF..." task, making sure "Separate PDF file for teh each image" option is turned off.

It should work for you. However, I am not sure if "Autocrop" task can process your pages correctly. This tool has "Deskew text" batch task too, in case the pages were scanned a bit rotated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.