I just wanted to show the utility of k2pdfopt for a recent project. I am reading Asimov’s “A Short History of Chemistry” in paperback, but I’d prefer to read it on my iPad, white text on black background, to minimize the light so I don’t disturb my wife when reading at night. I started by scanning the pages 2-up format at 300 dpi (see first attachment). I then ran two passes of k2pdfopt on this scanned file as shown below. The first k2pdfopt command rotates the PDF and crops out each page from the 2-up format, creating a temp.pdf file used by the second command. The second straightens each page, converts it to a negative image for white on black text, applies some contrast and gamma adjustment, applies an OCR layer (using Tesseract), and fits it to the format of my iPad screen. The result is attached both as the PDF and as a screenshot on my iPad. Several parameters can be adjusted per individual preferences—the dpi of the scan, the contrast adjustment, the gamma adjustment. It’s a compromise between scan time, converted file size (in bytes), and readability on the end device.
N.B. If you'd like to make the text yellow instead of white in order to reduce blue light emission (studies have shown that reducing blue light emission helps you fall asleep easier), you can add this option to the second command:
-colorbg ffff00
Command #1
Code:
k2pdfopt -mode crop -rt 90 -cbox- -ibox- -cbox 0.43in,0.23in,3.56in,6.5in -cbox 4.5in,0.27in,3.56in,6.5in asimov_short_hist_of_chem_sample_300dpi_scan.pdf -o temp.pdf
Command #2 (iPad viewable area in ibooks is 1004 x 768)
Code:
k2pdfopt -wrap- -col 1 -fc- -n- -bpc 8 -as -cmax -3 -g 0.3 -neg+ -ocr t -odpi 300 -w 3.3in -h 4.314in temp.pdf -o asimov_short_hist_of_chem_sample_ipad.pdf