繁体   English   中英

pdf2dsc错误:invalidaccess-。locksafe--

[英]pdf2dsc error: invalidaccess --.locksafe--

这是我在AUCTeX的预览版乳胶版中遇到的问题。 但是我相信问题应该是由ghostscript引起的,尤其是pdf2dsc工具。

在Shell环境中执行的命令

pdf2dsc input.pdf output.dsc

(其中input.pdf是pdflatex成功生成的)将生成一个空的output.dsc和以下错误消息,从而中断了预览命令链,

Error: /invalidaccess in --.locksafe--
Operand stack:
   true   --nostringval--   --dict:1152/1684(ro)(G)--   getenv   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_pop   1845   1   3   %oparray_pop   1739   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1870   0   3   %oparray_pop   1869   0   3   %oparray_pop   --nostringval--
Dictionary stack:
   --dict:1152/1684(ro)(G)--   --dict:0/20(G)--   --dict:72/200(L)--
Current allocation mode is local
Current file position is 2063
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
Error: /invalidaccess in --.locksafe--
Operand stack:
   true   --nostringval--   --dict:1152/1684(ro)(G)--   getenv   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_pop   1845   1   3   %oparray_pop   1739   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1870   0   3   %oparray_pop   1869   0   3   %oparray_pop   --nostringval--
Dictionary stack:
   --dict:1152/1684(ro)(G)--   --dict:0/20(G)--   --dict:72/200(L)--
Current allocation mode is local
Current file position is 2063
GPL Ghostscript 8.70: Unrecoverable error, exit code 1

手册页和google搜索很少提供有关此“ locksafe”错误消息的信息,因此,如果你们有办法解决该问题,我会徘徊。

谢谢。

编辑输入文件是通过编译以下最小tex文件生成的

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}

\begin{equation}
1 + 1 = 2
\end{equation}
\end{document}

pdf版本3.14159265-2.6-1.40.15。

pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014)
kpathsea version 6.2.0
Copyright 2014 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.10; using libpng 1.6.10
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with xpdf version 3.03

我怀疑实际上任何pdf输入(例如,由Latex-> dvipdf生成)都会产生相同的错误。 我正在~/Deskop/input路径中执行此操作。

我也使用建议的命令

gs -sDEVICE=ps2write -o out.dsc input.pdf

并且它确实会成功生成一个out.dsc文件。 下一步产生的png图

gs -sDEVICE=png16m -o out.png out.dsc 

很模糊。

无论如何,我自定义了AUCTeX变量,从dsc到png的最后一步不起作用,这是输出

Preview-LaTeX exited as expected with code 1 at Sun Jan  8 12:14:19
Running `Preview-PDF2DSC' with ``gs -sDEVICE=ps2write -o _region_.prv/tmp19812cJl/preview.dsc _region_.pdf''
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1

Preview-PDF2DSC finished at Sun Jan  8 12:14:19
Running `Preview-Ghostscript' with ``gs -dOutputFile\=\(_region_.prv/tmp19812cJl/pr1-\%d.png\) -q -dNOSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r200.255x200.074''
Ghostscript filter: Args out of range: [(1 102368)], 1

编辑

我向Bugzilla提交了错误报告。

同时,升级到ghostscript 9.20(最新)和AUCTeX 11.89(最新)确实可以解决该问题。

谢谢@KenS。

好吧,简单的答案是,没有人真的可以使用7年旧版本的Ghostscript提供帮助,也不会看不到输入文件。

该错误很简单,在执行'.locksafe'运算符(由于Linux用户的安全性考虑而提供了非标准的Ghostscript扩展名)时,该程序尝试禁止访问对象。

pdf2dsc PostScript程序(较为复杂)不会直接执行.locksafe运算符。 它的确调用.setsafe,而.setsafe调用.locksafe,因此可能是引起问题的路由。

但是,正如您确定的那样,您一定要知道,调试软件几乎需要我们在相同条件下运行该软件,以了解其采用的路径。 由于您尚未提供原始输入文件,因此无法执行此操作。 我也不会尝试调试旧版本。

老实说,如果您想要兼容DSC的PostScript,最好使用当前版本的Ghostscript和ps2write设备。

gs -sDEVICE=ps2write -o out.dsc input.pdf

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM