-->

Monday, September 24, 2012

Handling pdfs

# Joining multiple pdf files :

pdfjoin  *.pdf --outfile concat.pdf  --paper A3

 Lots of options are available!


# compress pdfs

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output_screen.pdf  input.pdf

other options


-dPDFSETTINGS=/screen   (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook    (low quality, 150 dpi images)
-dPDFSETTINGS=/printer  (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default  (almost identical to /screen)


another more complicated command

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dColorImageResolution=38 -dColorImageDownsampleType=/Average -dGrayImageDownsampleType=/Average -dGrayImageResolution=38 -dMonoImageResolution=38 -dMonoImageDownsampleType=/Average -dOptimize=true -dDownsampleColorImages=true -dDownsampleGrayImages=true -dDownsampleMonoImages=true -dUseCIEColor -dColorConversionStrategy=/sRGB -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

what follows is from http://milan.kupcevic.net/ghostscript-ps-pdf/

Convert PostScript to PDF:
gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=fileout.pdf \
    filein.ps
Merge/combine PDF and/or PostScript files:
gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=fileout.pdf \
    filein.ps filein2.pdf
Extract a page from a PostScript or a PDF document:
gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=3 -dLastPage=3 \
    -sOutputFile=fileout.pdf filein.ps

No comments:

Post a Comment