Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt
Last active August 29, 2015 14:24
Show Gist options
  • Save stefanschmidt/2e5b7e2ef14b4563aa4e to your computer and use it in GitHub Desktop.
Save stefanschmidt/2e5b7e2ef14b4563aa4e to your computer and use it in GitHub Desktop.
Concatenate PDFs with Ghostscript without decreasing image quality
# depends on Ghostscript (available via Homebrew)
# copied from: http://superuser.com/questions/360216
gs \
-o output.pdf \
-sDEVICE=pdfwrite \
-dColorConversionStrategy=/LeaveColorUnchanged \
-dDownsampleMonoImages=false \
-dDownsampleGrayImages=false \
-dDownsampleColorImages=false \
-dAutoFilterColorImages=false \
-dAutoFilterGrayImages=false \
-dColorImageFilter=/FlateEncode \
-dGrayImageFilter=/FlateEncode \
input1.pdf \
input2.pdf \
input3.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment