On Friday 04 May 2007 09:51, John Pye wrote: > Helge Hafting wrote: > > John Pye wrote: > >> Hi all > >> > >> I would like to know if there's a way I can easily downsample (or > >> 'degrade') images in my LyX document when creating output using > >> pdflatex. I have a mix of PNGs, PDFs, EPS and JPG in my document, but my > >> PDF file is starting to become large and I'm sure there must be some > >> too-high resolution images in there. I found the graphics/degrade > >> package on CTAN but that seems to require that I use ERT for all my > >> images, which I'd rather avoid. > >> > >> If it's not possible from within LyX, perhaps there's a post-processing > >> tool that someone can recommend: one that does the downsampling of a PDF > >> file, without killing my hyperlinks and bookmarks, would be what I'd > >> want. > >> > >> Any suggestions? > > > > Just look at the size of your image files. Then, downsample > > the biggest ones. If you want to keep the originals, make new > > filenames for the downsampled files, and change the document > > accordingly. > > > > Helge Hafting > > Hi Helge, > > I was really looking for an automated approach. For example on Windows, > there is 'PDF Factory' (although I haven't tried it with hyperlinks). So > I was hoping for something similar on Linux. > > One reason why an automated approach would be good is that the file can > be big and appear big on the page: it /needs/ to be big. But if it's big > and appears /small/ on the page, then it needs to be downsampled. > > Another reason: a LyX document can embed PDFs, SVGs, and I imagine other > 'image' files, that can in turn embed bitmaps. One needs a tool that > examines the resulting PDF output, rather than the input files. > > Cheers JP
If I needed to do this, I would write a program in Ruby, Python or Perl to do the following: * Copy your original LyX to another filename. * Scan the new file for included pictures. * For each picture: 1. Use imagemagic convert to create a lower resolution copy 2. Change the LyX source to point to the new picture copy * Export to Latex * Run pdflatex Run one command, and your PDF is built with smaller pictures. HTH SteveT Steve Litt Author: Universal Troubleshooting Process books and courseware http://www.troubleshooters.com/