I was able to achieve great compression ratios for scanned/photographed documents (depending on the settings).
#Shrink pdf 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
#Shrink pdf pdf#
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.
If there are no errors, you are good to go! Simply type the below command from opt/densify to invoke the GUI, or open it from your dashboard.Use the following ghostscript command: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \ Please add /opt/Densify to your PATH" fi fi # Export to PATH if then if test -f $HOME/.zshrc then echo 'export PATH=/opt/Densify:$PATH' > $HOME/.zshrcĮlse echo "No zshrc Found! Please create a zsh config file and try again" fi else if then if test -f $HOME/.bashrc then echo 'export PATH=/opt/Densify:$PATH' > $HOME/.bashrcĮlse if test -f $HOME/.bash_profile then echo 'export PATH=/opt/Densify:$PATH' > $HOME/.bash_profileĮlse echo "No bashrc Found! Please create a bash config file and try again" fi fi else echo "Default Shell is not zsh or bash. # Create the symlink to /opt sudo ln -s $PWD /opt/Densify # Will not work otherwise sed -i 's/Queue/queue/g' $PWD/densify # Queue must be changed to queue in the file.
#Shrink pdf download#
#!/bin/bash #- HELPER SCRIPT FOR DENSIFY #- original package #- script author Vijay Ramachandran #- site #- # Go to your home directory (preferred) cd $HOME # Download the package git clone Run this bash script as root, to link and download necessary files. I have created a simple bash script to do all the necessary work. This package is called Densify, and is available here(Link to github). This is a GUI front end to ghostscript, which can be installed in any Linux distribution, since it uses Python3 and it’s GTK modules. If you are uncomfortable with using command line tools, there is a GUI alternative as well. GUI Utilities to Reduce PDF File Size in Linux I have tried this on a 73MB PDF and it had the same results as the ghostscript command, the compressed PDF having only 14MB! Ps2pdf Reduce Pdf Size ps2pdf -dPDFSETTINGS =/ebook input.pdf output.pdf It is recommended that you use the -dPDFSETTINGS=/ebooks setting to get the best performance, as ebooks have the best size for readability and also are small enough in size. It may not always work, but it can give very good results. This command ps2pdf converts a PDF to PS and then again back, compressing it efficiently as a result. I have used the above command to achieve a compression from 73MB to 14MB! Ghostscript Reduce Pdf Size Selects the output which is useful for multiple purposes.
Output is of a printer type quality ( 300 dpi) Output is of a higher size and quality ( 300 dpi) Has a better quality, but has a slightly larger size ( 150 dpi)