I'm trying to use Ghostscript v9.52 on a Windows 10 machine, but I get a blank pdf and this error when I try to convert any jpg file to pdf:
Error: /undefined in Test-JPG.jpg
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:738/1123(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)--
Current allocation mode is local
GPL Ghostscript 9.52: Unrecoverable error, exit code 1
I've tried the following commands:
C:\Users\Work\Desktop>gswin64c -sDEVICE=pdfwrite -o myFile.pdf "C:\Program Files\gs\gs9.52\lib\viewjpeg.ps" -c Test-JPG.jpg viewJPEG
C:\Users\Work\Desktop>gswin64c -sDEVICE=pdfwrite -o out.pdf viewjpeg.ps -c "Test-JPG.jpg viewJPEG" -f
C:\Users\Work\Desktop>gswin64c -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output.pdf Test-JPG.jpg
What I've tried so far:
- Tried using ghostscript to combine two PDF files - no problems, so Ghostscript is working to some extent.
- Tried different JPG files - all give the same error
- Tried opening the JPG files in other Windows programs - no problems, so there shouldn't be anything wrong with the files themselves
The closest answer I've found otherwise is this question, however the answer there is the second command above, which doesn't work for me. Given it's happening with all jpgs I try, I wonder if there's something I've not set up correctly when installing ghostscript?