【问题标题】:Am I doing something wrong in gswin64c sDEVICE=pdfwrite?我在 gswin64c sDEVICE=pdfwrite 中做错了吗?
【发布时间】:2021-12-22 01:07:42
【问题描述】:

我一直在命令行中使用 Ghostscript

gswin64c sDEVICE=pdfwrite -o out.pdf in.pdf

现在很长一段时间都取得了巨大的成功。 Ghostscript 的位置已添加到 Windows 10 中的 Path 变量设置中。今天它突然停止工作,并给出以下错误消息:

GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Error: /undefinedfilename in (sDEVICE=pdfwrite)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:762/1123(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1

到目前为止我已经尝试过什么

  • 将 Ghostscript 从 9.54 更新到 9.55.0
  • 不同的输入文件
  • 重命名输入文件
  • 包含输入文件的不同文件夹
  • 将输入文件复制到\gs9.55.0\bin\文件夹
  • 使用管理员权限运行命令行
  • 以管理员身份运行窗口

一切都没有成功,总是给我同样的错误信息。所有尝试过的文件都可以在任何 pdf 查看器中正确显示。

我在这里做错了什么?为什么突然?

【问题讨论】:

    标签: pdf ghostscript


    【解决方案1】:

    轻松完成,但读取错误undefinedfilename in (sDEVICE=pdfwrite)

    虽然不是很清楚,但它认为您要求处理该文件。

    但是,您应该为 -o 输出文件开关添加开关 - 信号。

    如果没有IN文件,则消息改变

    gswin64c -sDEVICE=pdfwrite -o out.pdf in.pdf
    
    GPL Ghostscript 9.55.0 (2021-09-27)
    Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
    This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
    see the file COPYING for details.
    

    错误:/undefinedfilename in (in.pdf)

    Operand stack:
    
    Execution stack:
       %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
    Dictionary stack:
       --dict:764/1123(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--
    Current allocation mode is local
    Last OS error: No such file or directory
    GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1
    

    请注意,如果您养成使用习惯,它有时可以减少以后的问题

    gswin64c -sDEVICE=pdfwrite -o"out.pdf" -f"in.pdf"

    【讨论】:

    • 非常感谢。所以又是第 8 层错误。错过了我笔记中的开关信号。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-07
    • 1970-01-01
    相关资源
    最近更新 更多