gpt4 book ai didi

pdf - 使用 ghostscript 将 png 转换为 pdf

转载 作者:行者123 更新时间:2023-12-03 23:44:03 28 4
gpt4 key购买 nike

正如标题所说,我正在尝试将 png 转换为 pdf。
我在任何地方都找不到关于此的描述良好的示例。

我用过这个命令

gs sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -sOutputFile=test.pdf test.png

但我得到的只是
Error: /syntaxerror in (binary token, type=137)
Operand stack:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1894 1 3 %oparray_pop 1893 1 3 %oparray_pop 1877 1 3 %oparray_pop 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push
Dictionary stack:
--dict:1161/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
Current allocation mode is local
GPL Ghostscript 9.07: Unrecoverable error, exit code 1

这个错误信息。现在我开始怀疑在 ghostscript 中是否可以使用这种功能。我应该使用其他软件吗?
** 我运行的是最新的 9.07 版本

最佳答案

Ghostscript 可以输出多种格式(包括 png),但我不相信它能够将 png 作为输入。您可以使用类似 imagemagick 的 convert 之类的工具来实现您的目标。实用程序,虽然:convert test.png test.pdf

关于pdf - 使用 ghostscript 将 png 转换为 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20483600/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com