View Single Post
Old 02-27-2020, 10:16 PM   #13
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,273
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by ctop View Post
The internet archive at archive has a lot of interesting books for borrowing and downloading. I have some downloads of older books, that are difficult to read on E-Ink devices because they include the background of the page, which has become yellow. So the contrast is low and the text becomes unclear, also the files are quite big. So I wonder if somebody knows a good way to trim the PDFs for ereaders. I would prefer to use a commandline on a Linux based system, if such a tool is available here.
An example of the PDFs I am looking at is this:

https://archive.org/details/smtliche...ge/n8/mode/2up

(This is the item page, the download link is here

https://archive.org/download/smtlich...r16goet_bw.pdf

Any help appreciated, Ctop
The k2pdfopt app fits most of what you want (e.g. command-line, linux). It has a thread here in the PDF forum on MR. The command-line options below worked pretty well with your link above:

k2pdfopt -mode fitwidth -bpc 2 -n- -ls- -ac example1.pdf

If you want to try it on just a few pages first, add something like:

-p 1-40

Example conversion of pages 30-39 is attached.

The only thing is that the file size of the converted PDF will be even bigger because the original is actually very well compressed (fitting 900 bitmapped pages into 30 MB is no small trick--it uses JPEG 2000 JPX compression, whereas k2pdfopt converts it to .png lossless compression, which is not as compact). I used -bpc 2 to get the converted file size down a little.
Attached Files
File Type: pdf example1_k2opt.pdf (1.15 MB, 590 views)

Last edited by willus; 02-27-2020 at 10:21 PM.
willus is offline   Reply With Quote