View Single Post
Old 06-25-2017, 10:25 AM   #1405
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 1,303
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by loviedovie View Post
Can k2pdfopt optimize pdfs without changing the files? ...
Yes. The files from archive.org are viewer killers because they use JPEG-2000 compression (JPX encoding), which is very efficient, but more resource intensive for viewers to render. You can convert those PDFs to faster-rendering .png or .jpg with this command:

k2pdfopt -mode copy -odpi 300 sourcefile.pdf

You can adjust the output DPI to suit your preference. The above command does "Flate" (.png) compression. If you prefer .jpg compression, you can add, for example, -jpeg 90 (90 specifying the quality level, 1 - 100). I've attached an example source and conversion using .png compression. You'll notice the converted file is much larger (5x) than the source file. This is the price you pay for the faster viewing.

Also, by default k2pdfopt tries to optimize contrast and changes the gamma factor of the text to make it darker on e-books. If you want to disable this "tinkering" with the source file, add these options: -cmax -1 -g 1

If you want to see what encoding is being used in a PDF file, you can use the -i option (or the INFO button or 'i' or CTRL-D in the MS Windows GUI):

k2pdfopt -i sourcefile.pdf
Attached Files
File Type: pdf ts.pdf (339.6 KB, 382 views)
File Type: pdf ts_k2opt.pdf (1.65 MB, 274 views)

Last edited by willus; 06-25-2017 at 10:32 AM.
willus is offline   Reply With Quote