- HOW TO REDUCE SIZE OF PDF DOCUMENT FOR MAC
- HOW TO REDUCE SIZE OF PDF DOCUMENT SOFTWARE
- HOW TO REDUCE SIZE OF PDF DOCUMENT ZIP
Loading NimbusSans-Regular font from /usr/share/ghostscript/9.50/Resource/Font/NimbusSans-Regular.
HOW TO REDUCE SIZE OF PDF DOCUMENT SOFTWARE
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY: Sample output: $ time gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sOutputFile=out.pdf in.pdfĬopyright (C) 2019 Artifex Software, Inc. You can also add time in front of the command to see how long it takes (this works with any Linux command). Gs -sDEVICE=pdfwrite -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH \ High compression: 72 dpi (small file size-may produce grainy or unreadable results in some cases, so try it and give it a shot).Gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH \ Medium compression (recommended): 150 dpi (medium file size).Gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dNOPAUSE -dBATCH \ Low compression: 300 dpi (large file size).Note: you may also add -dQUIET to suppress all output to stdout. Use Ghostscript ( gs) to compress input.pdf into output.pdf
2020), and there's no need to override those values. Note that I've removed the -dCompatibilityLevel=1.4 part of the command used in some other answers here because this table indicates that 1.5 or 1.7 are automatically used for this setting today (27 Dec. Referencing this answer and this answer, and after trying a bunch of the answers here, and doing a bunch of research and experimenting, I've come up with the following.
HOW TO REDUCE SIZE OF PDF DOCUMENT FOR MAC
Note for mac users finding this post (or Linuxbrew users): there is a Homebrew install formula: brew install -HEAD pts/utils/pdfsizeopt (Note: I tend to use it after having first done a vectorization-OCR in Adobe Acrobat, which can have a dramatical size impact on some scanned text documents.)ĭownload and install the executable: curl -L -o Ĭp pdfsizeopt.single /usr/local/bin/pdfsizeopt degrading images to a point of unreadability), it might not be the tool you need, but as an always-working go-to solution, to reduce unnecessary big sizes in PDFs without loosing in readability, information and acceptable image quality, I think it is the best option. Now, if you need to attain a certain size whatever the consequences (inc. It is much more efficient in terms of size reduction than any of the previous CLI and GUI software that I have tried (including convert, gs, pdftk, etc.) - although possibly slower with pngout activated -, and does not have some of their issues (no heavily pixelated/degraded images, no loss of metadata such as table of contents, etc.). Depending on the document source, you might want to reduce the color depth ( -depth argument). I was able to achieve great compression ratios for scanned/photographed documents (depending on the settings).
HOW TO REDUCE SIZE OF PDF DOCUMENT ZIP
You have the choice between BZip, Fax, Group4, JPEG, JPEG2000, Lossless, LZW, RLE or Zip as alternate compression methods (some only allow b/w images). jpeg compression might not be the best choice due to compression artifacts. For jpg it is between 1 to 100 with 100 the best quality, but lowest compression Higher pixel densities increase quality and size -density: the pixel density in dpi (e.g.If you have a pdf with scanned images, you can use convert (ImageMagick) to create a pdf with jpeg compression (You can use this method on any pdf, but you'll loose all text informations).įor example: convert -density 200x200 -quality 60 -compress jpeg input.pdf output.pdf The exact settings for each of these, including their DPI values, are shown in the dozens of options in this table. /default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file./prepress selects output similar to Acrobat Distiller "Prepress Optimized" (up to version X) setting./printer selects output similar to the Acrobat Distiller "Print Optimized" (up to version X) setting./ebook selects medium-resolution output similar to the Acrobat Distiller (up to version X) "eBook" setting./screen selects low-resolution output similar to the Acrobat Distiller (up to version X) "Screen Optimized" setting.Presets the "distiller parameters" to one of four predefined settings: Reference: : Controls and features specific to PostScript and PDF input -dPDFSETTINGS=/default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.-dPDFSETTINGS=/printer selects output similar to the Acrobat Distiller "Print Optimized" setting ( 300 dpi).-dPDFSETTINGS=/prepress output similar to Acrobat Distiller "Prepress Optimized" setting ( 300 dpi).-dPDFSETTINGS=/ebook for better quality, but slightly larger pdfs.-dPDFSETTINGS=/screen lower quality, smaller size.dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Use the following ghostscript command: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \