Compressing pdf
Type the following command (source)
$ gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=setting -sOutputFile=output.pdf input.pdf
Set the input file name properly as well as the output file name if wanted.
in
-dPDFSETTINGS
use:/screen
for lowest quality/ebook
for medium quality/printer
and /prepress for high quality
Modifying a pdf
command
$ convert input.pdf output.pdf
Options:
density
image resolutionrotate
rotation angle degreesattenuate
noise additionnoise
noise peak reductionflatten
no virtual offline across layerssharpen
Gaussin operator to sharpen the image
Example (source):
$ convert -density 150 input.pdf -rotate "$([ $((RANDOM % 2)) -eq 1 ] && echo -)0.$(($RANDOM % 3))" -attenuate 0.15 +noise Multiplicative -flatten -attenuate 0.02 +noise Multiplicative -sharpen 0x1.0 output.pdf
Metadata info of a pdf
command pdfinfo:
$ pdfinfo file.pdf
Last updated
Was this helpful?