簡體   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