gs
Ghostscript PostScript and PDF interpreter
TLDR
View a PDF file
SYNOPSIS
gs [options] [files]...
DESCRIPTION
gs (Ghostscript) is an interpreter for Adobe PostScript and PDF languages. It can convert between formats, render to various output devices, and process PDF and PostScript files.
Ghostscript is widely used for PDF manipulation including merging, splitting, compressing, and converting to image formats. The -dPDFSETTINGS preset controls quality and file size: /screen (lowest), /ebook, /printer, /prepress (highest).
PARAMETERS
-sDEVICE=DEVICE
Select output device (pdfwrite, jpeg, png16m, etc.)-sOutputFile=FILE
Specify output filename (use %d for page numbers)-r RES or -rXRESxYRES
Set output resolution in DPI-dPDFSETTINGS=SETTING
PDF quality preset (/screen, /ebook, /printer, /prepress)-dNOPAUSE
Do not pause between pages-dBATCH
Exit after processing files-dQUIET or -q
Suppress normal output messages-dSAFER
Restrict file operations (default)-dFirstPage=N
Start from page N-dLastPage=N
Process through page N-sPAPERSIZE=SIZE
Set paper size (a4, letter, legal, etc.)-I DIRECTORIES
Add library search paths-h or -?
Display help and available devices
CAVEATS
The available devices depend on your Ghostscript installation. Use gs -h to see installed devices. PDFSETTINGS presets affect quality and file size significantly.
HISTORY
Ghostscript has been developed since 1986, providing free PostScript and PDF interpretation. It is widely used for PDF manipulation on Linux systems.
