我一直在命令列中使用 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\ 檔案夾
- 使用管理員權限運行命令列
- 以管理員身份登錄運行 Windows
一切都沒有成功,總是給我同樣的錯誤資訊。所有嘗試的檔案都在任何 pdf 查看器中正確顯示。
我在這里做錯了什么?為什么突然?
uj5u.com熱心網友回復:
輕松完成,但閱讀錯誤 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"
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/354881.html
