Ghostscript On windows leads to Invalid option for -dPDFSETTINGS

ぃ、小莉子 提交于 2021-02-05 07:45:08

问题


To solve my problem here with compressing/down-sizing a PDF file generated by MikTeX on Windows, I am trying this bash script on Cmder as:

shrinkpdf.sh in.pdf > out.pdf

However I get the error:

Invalid value for option -dPDFSETTINGS=C:/Program Files/Git/screen, use -sNAME= to define string constants

which I suppose has to do with the line

-dPDFSETTINGS=/screen

I would appreciate it if you could help me know what is the problem and how I can solve it.

My environment is:

  • Windows OS: 1809
  • Cmder: 1.3.14
  • Ghostscript: 9.27

回答1:


I ran into the same issue and I fixed it using a double slash: "//screen" instead of "/screen". This is due to mingw that is trying to be smart and replace "/" with GIT home directory.

Reference: https://github.com/moby/moby/issues/24029#issuecomment-250412919




回答2:


This does not appear to be a Ghostscript problem. It seems to be something to do with your script, presumably some kind of argument replacement or expansion.

Claearly this:

-dPDFSETTINGS=C:/Program Files/Git/screen

is incorrect, but that's nothing to do with Ghostscript. I suspect you neeed to quote that argument or something like that, so that your shell doesn't meddle with it.



来源:https://stackoverflow.com/questions/59900205/ghostscript-on-windows-leads-to-invalid-option-for-dpdfsettings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!