向 ghostscipt 运行 配置添加允许的路径

add a permitted path to ghostscipt running configuration

在使用 ps2pdf 使其成为可读的 pdf 之前,我使用了一个创建我的 postscript 文件的程序,我制作了一个程序,它添加了一些字符串来覆盖公司的新徽标。 (第一个程序无法导入图像文件本身)。

我在文件的最后一行之前添加了字符串(“showpage”)。 运行宁我的程序添加徽标时没有错误。 使用选项 -dNOSAFER 一切都很好,但默认情况下它设置为 -dSAFER,并且弹出 invalidfileaccess 错误消息,文件在其目录中只有 6 张 jpg 图像。

我不想 运行 启用 -dNOSAFER 选项。因为它将完全打开文件系统。

在文档中我看到有一个 "permitted path" 设置,但我找不到设置它的地方。它只是在启动程序的命令中设置的命令行选项吗?或者是否有 GhostScript / ps2pdf 的配置文件,我可以在其中将此目录的路径作为允许的路径。

在本文档中: http://www.ghostscript.com/doc/current/Use.htm

我只找到

-dTTYPAUSE

Causes Ghostscript to read a character from /dev/tty, rather than standard input, at the end of each page. This may be useful if input is coming from a pipe. Note that -dTTYPAUSE overrides -dNOPAUSE. Also note that -dTTYPAUSE requires opening the terminal device directly, and may cause problems in combination with -dSAFER. Permission errors can be avoided by adding the device to the permitted reading list before invoking safer mode

gs -dTTYPAUSE -dDELAYSAFER -c '<< /PermitFileReading [ (/dev/tty)] >> setuserparams .locksafe' -dSAFER

引用仅用于上下文,但这是放置允许路径的一种方式吗? 当 gs 以只读方式自动启动完整系统时,会有什么区别吗?此页面中没有 PermitFile 的其他查找结果。

尝试使用 -I(包含)将所需路径添加到搜索路径中,请参阅 Use.htm,第 8 节 Ghostscript 如何查找文件。如果您使用 'run' 或类似的方法从另一个位置读取文件,这应该只是一个问题。

关于 TTYPAUSE 的部分不相关。