lost and found ( for me ? )

How to use k2pdfopt on Ubuntu 13.10 ( optimize PDF for e-reader devices )

In short, k2pdfopt allow you to optimize PDF for e-reader devices, such as Amazon kindle, Rakuten readers, Sony readers etc.

download k2pdfopt from http://www.willus.com/k2pdfopt/
root@ubuntu:/home/hattori# file k2pdfopt
k2pdfopt: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped

root@ubuntu:/home/hattori# chmod u+x k2pdfopt

Here are procedures to optmize PDF for Amazon Kindle paperwhite.

./k2pdfopt name.pdf
enter d ( device selection )
enter 3 ( kindle paper white )
enter ( do the optimization for kindle paper )
root@ubuntu:/home/hattori# ./k2pdfopt /home/hattori/PDF_docs/foobar.pdf

k2pdfopt v2.10 (w/MuPDF,DjVuLibre,OCR) (c) 2013, GPLv3, http://willus.com
   Compiled Nov 23 2013 with Gnu C v4.7.2 for Linux on x64.

a. Autostraighten (-as)                 n. Native PDF output (-n)
b. Bitmap type (-jpg,-png,-bpc)         o. Output name (-o)
bp. Break pages (-bp,-f2p)              oc. OCR (-ocr,-ocrvis,...)
c. Color/Negative output (-c, -neg)    om. Output margins (-om)
co. Column detection (-col,-ch,...)      p. Page range (-p)
cs. Contrast/Sharpen (-cmax,-g,-s,-wt)  pd. Padding/Marking (-p[lrbt],-mc)
d. Device selection (-dev,-h,-w,-dpi)   r. Right-to-left page scans (-r)
ds. Document scale factor (-ds)         rt. Rotate source page (-sr)
f. Fit to single column (-fc)           s. Special (-de,-evl,-gs)
gt. Gap thresholds (-gt...)             sm. Show marked source (-sm)
j. Justification (-j)                   u. Usage (command line opts)
l. Landscape mode (-ls)                 v. Vertical spacing (-vb,-vs)
m. Margin to ignore (-m)                w. Wrap/Reflow text (-wrap,-ws)
mo. Mode (-mode)                         x. Exit on completion (-x)

Selected options:  /home/hattori/PDF_docs/foobar.pdf

Enter option above (h=help, q=quit): d

Select your e-reader type:
    1. Kindle 1-5 (k2)
    2. Kindle DX (dx)
    3. Kindle Paperwhite (kpw)
    4. Nook Simple Touch (nookst)
    5. Kobo Touch (kbt)
    6. Kobo Glo (kbg)
    7. Other (specify width, height, etc.)

Enter selection [1]: 3

a. Autostraighten (-as)                 n. Native PDF output (-n)
b. Bitmap type (-jpg,-png,-bpc)         o. Output name (-o)
bp. Break pages (-bp,-f2p)              oc. OCR (-ocr,-ocrvis,...)
c. Color/Negative output (-c, -neg)    om. Output margins (-om)
co. Column detection (-col,-ch,...)      p. Page range (-p)
cs. Contrast/Sharpen (-cmax,-g,-s,-wt)  pd. Padding/Marking (-p[lrbt],-mc)
d. Device selection (-dev,-h,-w,-dpi)   r. Right-to-left page scans (-r)
ds. Document scale factor (-ds)         rt. Rotate source page (-sr)
f. Fit to single column (-fc)           s. Special (-de,-evl,-gs)
gt. Gap thresholds (-gt...)             sm. Show marked source (-sm)
j. Justification (-j)                   u. Usage (command line opts)
l. Landscape mode (-ls)                 v. Vertical spacing (-vb,-vs)
m. Margin to ignore (-m)                w. Wrap/Reflow text (-wrap,-ws)
mo. Mode (-mode)                         x. Exit on completion (-x)

Selected options:  /home/hattori/PDF_docs/foobar.pdf -dev
   kpw

Enter option above (h=help, q=quit):  ( <- click Enter key )

Reading 451 pages from /home/hattori/PDF_docs/foobar.pdf ...

Detecting document orientation ... No rotation necessary.

SOURCE PAGE 1 of 451 (8.3 x 11.7 in) ... 0 new pages saved.

SOURCE PAGE 2 of 451 (8.3 x 11.7 in) ... 4 new pages saved.

SOURCE PAGE 3 of 451 (8.3 x 11.7 in) ... 3 new pages saved.

1636 pages (116990 words) written to /home/hattori/PDF_docs/foobar.pdf_k2opt.pdf (62.4 MB).

Press <ENTER> to exit.
root@ubuntu:/home/hattori#

The PDF file being optmized for kindle paperwhite will be saved under the same directory where the original PDF is.
# ls /home/hattori/PDF_docs/foobar.pdf*
/home/hattori/PDF_docs/foobar.pdf
/home/hattori/PDF_docs/foobar.pdf_k2opt.pdf

To manage Kindle devices on Ubuntu box, install cablire via apt-get.
# sudo apt-get install calibre

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.