[Tex/LaTex] pdf crop utility for windows that will give smaller files

fancytooltipsfile sizepdfcropwindows

The answers to this question contain pdf cropping utilities that will give smaller files than Eric Doviak's original, but as far as I can tell they only work in Linux.

Is there a way to make them work in Windows, or an equivalent native utility? I also need to be able to run it from command line.

(Motivation: I managed to get fancy-preview running for my dissertation, but it turns my 50-page dissertation from a compact 1MB into 10MB. I understand this as due to a large number of uncompressed tooltips being embedded, and would like to avoid that.)

Best Answer

Check out PDF manipulation tips, Part 1. I haven't used this functionality before myself, but ghostscript can apparently handle this from the command line with:

gswin32c.exe -sDEVICE=pdfwrite -dMaxSubsetPct=100 -dPDFSETTINGS=/ebook -sOutputFile="outfile.pdf" -dNOPAUSE -dBATCH "infile.pdf"

where -dPDFSETTINGS is used to define how images are resampled. Using -dPDFSETTINGS=/screen will yield dpi=72. I just tried this with a sample pdf and it seems to work fine.