GhostScript Command
This doc describes tips on how to utilize command line Ghostscript client. Ghostscript is usually utilized like a standard engine on the inside different purposes (for seeing data files pertaining to example). Remember to consider the particular certification for anyone purposes pertaining to using Ghostscript throughout different contexts.
The command range for you to invoke Ghostscript is basically a similar upon almost all techniques, although the title from the executable system per se could differ among techniques. As an illustration, for you to invoke Ghostscript upon unix-like techniques sort.
Use following commands to convert pdf:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -dAutoRotatePages=/None -sOutputFile=/DESTINATION/OUTPUT.pdf /SOURCE/INPUT.pdf
gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \ -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray \ -sOutputFile=/DESTINATION/OUTPUT.pdf /SOURCE/INPUT.pdf
gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \ -sColorConversionStrategy=CMYK -dProcessColorModel=/DeviceCMYK \ -sOutputFile=/DESTINATION/OUTPUT.pdf /SOURCE/INPUT.pdf
gs -q -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -sDEVICE=jpeg \ -r
gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=/DESTINATION/OUTPUT.pdf /SOURCE/INPUT.pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOwnerPassword=password -sUserPassword=passowrd -dAutoRotatePages=/None -sOutputFile=/DESTINATION/OUTPUT.pdf /SOURCE/INPUT.pdf
Note: We can open pdf using both (-sUserPassword & -sOwnerPassword) password. So If we want to give same password then we can set.