opt-pdf(1) opt-pdf(1)
NAME
opt-pdf - optimize PDF image files using Ghostscript
SYNOPSIS
opt-pdf [ -b(ackup) ] [ -c(olor) DPI ] [ -f(orce) ] [ -g(ray) DPI ] [ -h(elp) ] [ -m(ono) DPI ] [ -o(ptimize_for_web) ] [ -q(uiet) ] [ -v(erbose) ] file...
DESCRIPTION
opt-pdf runs existing PDF files through Ghostscript in order to make them smaller. This is accomplished using the filesize, gs, and temp- name utilities.
OPTIONS
-b Retain the original file by adding a ".bak" suffix. -c DPI Downsample color bitmap images inside the PDF file to a pixel resolution of DPI. -f Force an overwrite of input files, even if the new version is larger. This is useful when the goal of an opt-pdf run is to create more proper PDF files rather than smaller ones. -g DPI Downsample grayscale bitmap images inside the PDF file to a pixel resolution of DPI. -h Print help and quit. -m DPI Downsample monochrome bitmap images inside the PDF file to a pixel resolution of DPI. -o Write "optimized" PDF documents, which puts elements of the file into a more linear order and adds "hint" pointers, much like Ghostscript's pdfopt utility. Note that this option will actu- ally make the PDF file slightly larger. -q Quiet output. No output commentary will be printed. -v Print debugging output from Ghostscript.
EXAMPLES
Process a couple of PDF files: opt-pdf image001.pdf image002.pdf Process all PDF images in an entire directory tree: find . -name "*.pdf" -exec opt-pdf {} \; Or alternatively, process all PDF images this way: find . -name "*.pdf" -print0 | xargs -0 opt-pdf Fully utilize a quad-core system while process all PDF images: find . -name "*.pdf" -print0 | xargs -0 -n 1 -P 4 opt-pdf find . -name "*.pdf" | parallel -j+0 opt-pdf
NOTES
The opt-pdf utility was originally written to reduce the size of overly-large PDF files generated by certain programs (here's looking at you, Open/LibreOffice and Pro/Engineer). Additionally, it can some- times correct files that are not fully compliant with PDF standards.
CAVEATS
The opt-pdf is not strictly lossless like the opt-gif, opt-jpg, and opt-png utilities. It completely rewrites the PDF file by running it through Ghostscript, and it is possible that this will introduce subtle changes. Additionally, repeated runs of opt-pdf will sometimes yields repeatedly shrunk files. Ghostscript is far more complex than utili- ties that handle only bitmapped images. You have been warned.
SEE ALSO
filesize(1), gs(1), pdfopt(1), tempname(1)
COPYRIGHT
Copyright (C) 2013 by Brian Lindholm. This program is free software; you can use it, redistribute it, and/or modify it under the terms of the GNU General Public License as published by the Free Software Foun- dation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. littleutils 2013 Aug 06 opt-pdf(1)
littleutils 1.0.31 - Generated Sat Feb 22 06:41:13 CST 2014