View Single Post
Old 11-24-2021, 08:03 PM   #5
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 rupeshforu3 View Post
Can anyone of you suggest how to compress the pdf file by internally compressing the images present in the pdf file.
It is unclear what will give you the best reading experience on your tablet and/or what you want to do. I'm guessing the issue is that your PDF uses JPX compression which is notoriously CPU intensive to render. In that case, simply converting to JPEG or Flate compressions may be all you need, but it will make the file much larger, as you have discovered.

Did you want to actually change the resolution of the PDF images in your document so that they have fewer pixels? You can use k2pdfopt to do that:

k2pdfopt myfile.pdf -mode copy -dpi 200 -o outfile.pdf
(This will change every page of your PDF to a bitmap image at 200 dpi but will retain text searchability if your document has text.)

You can adjust the dpi to whatever suits you. 200 is usually reasonable. This will default to Flate compression (aka PNG). If you want to use JPEG compression instead of PNG, you can add this option:

-jpg <quality> (where quality = 1 to 100 specifies the JPEG quality)

You can use k2pdfopt with the -i option to see what compression is being used on the images in your PDF (or from the GUI, select "PDF File Info" from the help menu).

Last edited by willus; 11-24-2021 at 08:06 PM.
willus is offline   Reply With Quote