【发布时间】:2021-09-15 18:35:11
【问题描述】:
我正在尝试使用 ghost 脚本将 jpg 转换为 pdf。我使用的命令是
C:\Users\kbged\Desktop\XAMPP\php\bin\gs\gs9.54.0\bin\gswin64c -sDEVICE=pdfwrite -sOutputFile=C:\Users\kbged\Pictures\php48D4.pdf C:\Users\kbged\Desktop\XAMPP\php\bin\gs\gs9.54.0\lib\viewjpeg.ps -c (C:\Users\kbged\Pictures\group_image.jpg) viewJPEG
但是,这以以下错误结束:
GPL Ghostscript 9.54.0 (2021-03-30)
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: /stackunderflow in --dup--
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval--
Dictionary stack:
--dict:732/1123(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)-- --dict:8/20(L)--
Current allocation mode is local
GPL Ghostscript 9.54.0: Unrecoverable error, exit code 1
我试图查看那个 viewjpeg.ps 文件,几乎看到了结尾
% This lets you do stuff on the command line like:
% gs -sDEVICE=pdfwrite -o stuff%03d.pdf viewjpeg.ps -c "(image.jpg) << /PageSize 2 index viewJPEGgetsize 2 array astore >> setpagedevice viewJPEG"
% so the output size matches the original image.
我实际上不明白错误在哪里...... 任何帮助,将不胜感激!谢谢!
【问题讨论】:
标签: pdf jpeg ghostscript