I just wanted to show the utility of k2pdfopt for a recent project. I am reading Asimovs A Short History of Chemistry in paperback, but Id prefer to read it on my iPad, white text on black background, to minimize the light so I dont 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 preferencesthe dpi of the scan, the contrast adjustment, the gamma adjustment. Its a compromise between scan time, converted file size (in bytes), and readability on the end device.
Command #1
Command #2 (iPad viewable area in ibooks is 1004 x 768)
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.pdfCode:
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







