【问题标题】:ps2pdf Unrecoverable errorps2pdf 不可恢复的错误
【发布时间】:2012-10-25 10:22:07
【问题描述】:

当我尝试将 .ps 文件转换为 pdf 时,出现了 unrecoverable error, exit code 1。大约半小时前它工作了,现在它不会了。文件在那里

Error: /undefinedfilename in (10132012a.ps)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1161/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 9.04: Unrecoverable error, exit code 1

这是我的命令:

ps2pdf 10132012a.ps 10132012b.pdf

ps 文件是使用latex 创建的。

我正在运行 Ubuntu 11.10。

【问题讨论】:

  • 您可以使用pdflatex 跳过dvi/ps 步骤吗?
  • @lhf 不。我正在使用 eps 数字。因此我需要使用乳胶而不是 pdflatex
  • 尝试dvipdfmdvipdfmx 跳过dvips 步骤。
  • @lhf 很快就会这样做!谢谢。

标签: unix latex ghostscript postscript ubuntu-11.10


【解决方案1】:

您可以尝试直接运行 Ghostscript,而不是使用脚本:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -o 10132012b.pdf 10132012a.ps

甚至:

gs -sDEVICE=pdfwrite -o 10132012b.pdf -

“便利”脚本(ps2pdf、pdf2ps 等)使用的选项可能会妨碍(尽管它们确实不应该)。

【讨论】:

  • 叹息!这也不起作用。不过谢谢。我应该看看我的乳胶文件,看看是否有什么不正常的事情发生。
【解决方案2】:

我刚刚找到了解决此/undefinedfilename 错误的绝妙方法。我花了大约 15 分钟才弄明白。

首先我是这样做的。

user@host> dvips test1
This is dvips(k) 5.98 Copyright 2009 Radical Eye Software (www.radicaleye.com)
' TeX output 2015.08.04:2315' -> test1.ps
</usr/lib/texmf/dvips/base/tex.pro></usr/lib/texmf/dvips/base/texps.pro>. 
</usr/share/texmf/fonts/type1/public/amsfonts/cm/cmr10.pfb>[-1] [-2] [1] [2] 

然后我就这样做了。

user@host> ps2pdf text1.ps
Error: /undefinedfilename in (text1.ps)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1172/3371(ro)(G)--   --dict:0/20(G)--   --dict:70/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.70: Unrecoverable error, exit code 1

然后它终于击中了我。这是文件名中的拼写错误。所以ps2pdf 的命令行参数是一个不存在的文件。

在我看来,更好的错误消息是Cannot find file test1.ps,而不是Error: /undefinedfilename in (text1.ps)

【讨论】:

    【解决方案3】:

    错误表示ps2pdf找不到文件10132012a.ps

    latex 不创建 ps 文件:它创建的 dvi 文件可以使用dvips 转换为 ps。

    也许你忘了运行dvips

    【讨论】:

    • 我确实运行了dvips,发现创建了10132012a.ps。
    猜你喜欢
    • 1970-01-01
    • 2022-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-23
    • 1970-01-01
    相关资源
    最近更新 更多