PDF - Extract pages from pdf files, make greyscale, print to PDF from acroread, merge pdfs
Install pdftk and use it to extract: sudo bash apt-get install pdftk exit pdftk input.pdf cat 1-15 output output.pdf (where 1-15 are the pages to output) An alternative way is to use a pdf viewer like Atril or a web browser with support for pdf:s like Chrome and print the pdf file to a new pdf with selected pages specified. More ways to do it can be found here: http://www.linuxjournal.com/content/tech-tip-extract-pages-pdf To make PDF:s greyscale and therefore smaller: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dNOPAUSE -dBATCH -sOutputFile="output.pdf" "input.pdf" To compress PDF:s: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile="output.pdf" "input.pdf" Combine greyscale and compression: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dNOPAUSE -dBATCH -sOutputFile="output.pdf" "merged.pdf"
Acrobat Reader 9 (acroread) - Print to PDF For some reason you cannot (re)print directly to PDF from within acroread in Debian (8.6). Here is a workaround. Install cups-pdf: sudo apt-get install cups-pdf List printer names - PDF will be shown here and also installed printers: lpstat -p -d Open the PDF you want to print in acroread Go to File -> Print Select PDF as the output Or use Custom... and enter this in the command field to the right: lpr -P PDF Printed files will appear in your home folder/PDF (~/PDF/)
Merge PDFs
pdftk *.pdf cat output output.pdf
Beware and steps to get compressed files
Beware of Mozilla Firefox Save to PDF and PDF, both appear to save texts on pages with non-standard fonts as images which increases file size. Chromium does not do this, but print to PDF option produces smaller files than the Save to PDF option. 1. Use Chromium to avoid 2. In the print dialog select PDF instead of Save as PDF 3. Under More settings, lower DPI to 150 4. Check scale and disable background images 5. Print, files will appear in your user folder under the PDF directory 6. Repeat and print pages as needed, merge if needed using command above 7. Grayscale and shrink using command above 8. Run shrinkpdf.sh with 150 dpi setting on it: https://github.com/aklomp/shrinkpdf
This is a personal note. Last updated: 2025-06-26 00:46:43.