I am using Ghostscript from command line to reduce the size of a PDF file. The command I m trying is
gswin64c -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 ^
-dPDFSETTINGS=/screen -dNOPAUSE -dQUIET ^
-dBATCH -sOutputFile=C:\output.pdf C:\input.pdf
The input.pdf is in my C:\ drive
I am getting the following error
Could not open file C:\output.pdf
Unable to open the initial device, quitting
Anyone encoutered this problem before can help me ?
The solution to the above error is the permissions where you are outputting your file. If you dont have the write permission in output.pdf deirectory you will encounter the above error. So before executing the command be sure you have the write access.
Hope it will help someone
Thanks