Conversions
Grayscale (GS)
gs \
-sOutputFile=output.pdf \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=Gray \
-dProcessColorModel=/DeviceGray \
-dCompatibilityLevel=1.4 \
-dNOPAUSE \
-dBATCH \
input.pdf
Optimisation (GS)
gs \
-o output.pdf \
-dNOPAUSE \
-dBATCH \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/printer \
-sPAPERSIZE=a4 \
-dFIXEDMEDIA \
-dCompressPages=true \
input.pdf
Remove alpha (IM)
convert -density 300 -background white -alpha remove (-alpha off) IN.pdf OUT.pdf
+ -flatten
😻
Join 2 pages into 1
convert -density 150 $(ls -rt *pdf) -flatten 3.pdf
References:
https://legacy.imagemagick.org/Usage/masking/#alpha_remove
https://www.imagemagick.org/script/command-line-options.php#layers