[texhax] Smaller image-heavy pdf

Bob Tennent rdtennent at gmail.com
Mon Nov 26 15:11:28 CET 2018


 >|> Apart from "image-heavy" you haven't told us much about
 >|> this. Can the images be compressed (for example, if they
 >|> are pngs)? Can the resolution be decreased? What fonts are
 >|> embedded? If they are "standard" fonts they need not be
 >|> embedded.
 >|
 >|Fair point. In this PDF there are 36 images, mostly jpegs, one
 >|png, one or two PDFs, and their total average filesize is
 >|2.6M. Yes, I could reduce their filesize prior to compilation, but
 >|I would prefer not to for the following reasons:
 >|
 >|1) The (Lua)LaTeX is being produced by a number of editors in
 >|Overleaf. I can only think of how to reduce the image filesizes in
 >|bash (eg with `convert`) so doing this would require sharing the
 >|files with a server I have control over (Overleaf supports
 >|dropbox/owncloud folder). I'm not against this route, but would
 >|prefer a simpler way. Maybe it's possible to reduce filesizes via
 >|Lua? (must admit I have never written a line of lua code!) Or
 >|maybe, arara (which i only learned about in the latest TUGboat and
 >|still don't know very much about!)
 >|
 >|2) Another problem is that because images are cropped within LaTeX
 >|by means of, eg \includegraphics[trim={1cm 0 0 0},clip]{foo.jpg},
 >|they would appear in the PDF massively over-cropped if their
 >|resolution is shrunk, unless there's a way that I'm not aware of
 >|to apply a relative crop-size (eg 20%) rather than an absolute one
 >|in cm or px?
 >|
 >|As for fonts, we do indeed embed three ttf fonts (Noto, PT sans,
 >|Lato). Are fonts which are not used but are loaded with fontspec's
 >|\newfontfamily embeded in the pdf? We might be calling a couple of
 >|ligatures where that is the case. Looks like `pdfsizeopt` could
 >|compress the fonts effectively, but still, the real problem is all
 >|the huge images.

I think your best option is to re-think your approach to
distribution. Does it have to be e-mail?

Bob T.


More information about the texhax mailing list