PDF File Processing Tools¶
Ghostscript (gs
)¶
Free and Cross Platform Software Suite
gs
is an interpreter for the PostScript® and PDF files
- Use
-sDEVICE=pdfwrite
to work with PDF files
Useful Examples
-
extracting pages (e.g., in this case the first five pages) from a source file
source-file.pdf
to outputpages-1-5.pdf
-
combining multiple PDF files (e.g.,
!!! tip "Regular Expression (regex) Match" The expressionpart-1.pdf
,part-2.pdf
, andpart-3.pdf
) to form acombine.pdf
part-[1-3].pdf
in the above example corresponds to a regular expression that identifies files with name ofpart-1.pdf
,part-2.pdf
, andpart-3.pdf
.
Frequently Used Arguments
arguments | effect |
---|---|
-dNOPAUSE | no pause after page |
-g<width>x<height> | page size in pixels |
-sDEVICE=<devname> | select device |
-q | "quiet", fewer messages |
-r<res> | pixels/inch resolution |
-dBATCH | exit after last file |
-sOutputFile=<file> | select output file |