Showing posts with label pdf. Show all posts
Showing posts with label pdf. Show all posts

Tuesday, March 19, 2013

gs: Merging Multiple PDFs

Preparation

sudo apt-get install gs pdftk

The Command

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=done.pdf ./*.pdf

A Sketch of GhostScript.

gs
    starts the Ghostscript program.
-dBATCH
    once Ghostscript processes the PDF files, it should exit.
    If you don't include this option, Ghostscript will just keep running.
-dNOPAUSE
    forces Ghostscript to process each page without pausing for user interaction.
-q 
    stops Ghostscript from displaying messages while it works
-sDEVICE=pdfwrite 
    tells Ghostscript to use its built-in PDF writer to process the files.
-sOutputFile=finished.pdf
    tells Ghostscript to save the combined PDF file with the specified name.

Saturday, December 15, 2012

graphicsmagick: *.jpg to .pdf in one line

To convert multiple .jpg files into one single pdf file

sudo apt-get install graphicsmagick
gm convert *.jpg foo.pdf

To reduce rise in cost of quality:

gm convert -quality 60 *.jpg foo.pdf