我正在 Ubuntu 中寻找一种方法来减小 pdf 的大小(通过降低图像的质量)。
我知道这可以通过在终端中键入以下命令在 Ghostscript 中完成:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Run Code Online (Sandbox Code Playgroud)
问题是我无法准确地指定质量。参数-dPDFSETTINGS=/screen
是决定质量的参数;但替代方案是非常严格的(例如,可以-dPDFSETTINGS=/ebook
为稍微好一点的质量做)。
我正在寻找一种方法来减小 pdf 的大小,使我能够以数字方式指定所需的质量。
我有一个大约 20MB 的扫描文档的 PDF,我需要大幅减小文件大小才能通过电子邮件发送它。我试过了
gs -sDevice=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Run Code Online (Sandbox Code Playgroud)
但output.pdf
没有创建。相反,我简要地获得了 Ghostscript 的 X 查看器。我哪里错了?
我的 Ubuntu 10.04 服务器上有 Ghostscript 版本 8。
安装版本 9 的最简单方法是什么?源码安装?聚丙烯酰胺?还有什么?
我的 ghostscript 配置出了点问题,例如,在使用 epstopdf 时出现以下错误
./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_gray.icc
| ./base/gsicc_manage.c:1914: gsicc_init_iccmanager(): cannot find default icc profile
./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_rgb.icc
| ./base/gsicc_manage.c:1708: gsicc_set_device_profile(): cannot find device profile
**** Unable to open the initial device, quitting.
./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_gray.icc
| ./base/gsicc_manage.c:1708: gsicc_set_device_profile(): cannot find device profile
Unrecoverable error: unknownerror in .special_op
./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_gray.icc
+ ./base/gsicc_manage.c:2650: gs_setdefaultgrayicc(): cannot find default gray icc profile
Run Code Online (Sandbox Code Playgroud)
我想出了以下解决方法(插入到我的 .bashrc 中)
alias gs='gs -sICCProfilesDir=/usr/share/color/icc/ghostscript/'<br>
alias …
Run Code Online (Sandbox Code Playgroud) 最近,我们不断收到在打印时以 100% CPU 挂起 Ghostscript 的 PDF。由于在办公室,我们仍在使用 Lucid,因此我尝试从 Precise VM 打印相同的 PDF 作为测试,它们运行良好。
遗憾的是我们现在不能迁移到 Precise,所以我想只升级 Ghostscript(Lucid 有 8.71,而 Precise 9.x),我可以使用 PPA 吗?
我有一个 65 页的 PDF 文件,其中包含深灰色文本。(实际文本,而不是图片/文本图像。)在我的黑白打印机上打印时,文本变得模糊不清,因为打印机试图使它小于黑色。我可以通过将页面导入inkscape,选择所有路径,单击“黑色”,将所有颜色(包括灰色调)转换为纯黑色,然后导出回PDF来逐页解决这个问题。
有没有办法在命令行中的inkscape中执行这些步骤(用于批处理)?
有没有办法在没有inkscape的情况下实现相同的结果(将pdf转换为黑白,1位灰度)?
编辑。在使用 Ghostscript 的Unix.SE和superuser上也有类似的问题。但是,这些只能通过选项将文件转换为灰度 -sColorConversionStrategy=Gray
。该选项-sColorConversionStrategy=/Mono
导致错误Unrecoverable error: rangecheck in .putdeviceprops
。由于我的文件已经是灰度的,这些并不能解决我的问题。
我最近安装了 Ubuntu 18.04(不是升级,全新安装)。在 Ubuntu 18.04 中,Inkscape 中的渲染 LaTeX 功能不起作用。以下是错误输出:
*** WARNING - the DELAYBIND command has been deprecated, and will be
removed in the next version. For now you can restore
the behaviour by using -dREALLYDEALYBIND but if you
require continued use of this command you should contact
the Ghostscript developers. Commercial customers of
Artifex should email their support contact, free users
are encouraged to talk to us on the #ghostscript IRC
channel on irc.freenode.net.
Unrecoverable error: undefined in DELAYBIND …
Run Code Online (Sandbox Code Playgroud) 这是我第二次在尝试使用 pdfwrite 在任何 PDF 文件上运行 GhostScript 时遇到分段错误错误
第一次是我以前的 Ubuntu 11.04 发行版,之后我完全删除(不是因为 gs),格式化我的驱动器等,然后再次安装 11.04
我不知道可能是什么问题。我经常与 GS 合作,现在突然间我开始在任何文件上收到此错误,例如此包或其某些依赖项出现问题。
如果最近的更新可能导致 GS 瘫痪,我搜索了 Synaptic 历史,但什么也没有
我过去在 GS Launchpad 分支上报告过问题(至少两次),但甚至没有人回复,事实上,我发布的任何报告都没有在 Launchpad 上回复我,所以我想完全删除 ghostscript并安装一些其他版本。
起初我想添加 Debian 稳定存储库,并安装更好的测试版本,但结果证明这可能不是一个好主意 - 在 Ubuntu 中添加 Debian 存储库。
由于我无法“强制”使用 Synaptic 以前的某个 GS 版本(因为它似乎只有一个 - 有问题的一个)我不知道如何解决这个问题,想问问如何安装以前的版本,最好是 8.71,因为这是 Debian 稳定版中的最后一个版本。
更新:
我删除了 GS 9.01(以及途中的一堆其他软件包)并遵循了 Boris 的建议,因为我不知道我还能做什么。
我安装了:
libgs8_8.71~dfsg2-9_i386.deb
ghostscript_8.71~dfsg2-9_i386.deb
Run Code Online (Sandbox Code Playgroud)
并测试了 GS 解释器,一切正常。
现在我想放回 GS 9.01 删除后删除的所有软件包,我需要先安装ghostscript-x
:
ghostscript-x_8.71~dfsg2-9_i386.deb
Run Code Online (Sandbox Code Playgroud)
这是问题开始的地方:
错误:
破坏现有的包 'gsfonts' 冲突:'gs'。
但是“/home/zetah/gs/ghostscript-x_8.71~dfsg2-9_i386.deb”通过以下方式提供:“gs,gs-afpl,gs-esp,gs-gpl”
我不想刹车,所以我删除了刚刚安装的东西libgs8
,ghostscript
并尝试删除gsfonts …
我正在运行 Ubuntu 18.04LTS。我有一台 HP Photosmart C7280 彩色打印机。打印机通过本地网络连接。很长一段时间以来,这对我来说效果很好。
但是今天,突然间,我打印的所有内容都变成了纯蓝色背景。我仍然可以阅读文本,但整个页面背景都是蓝色的。其他电脑可以打印到同一台打印机没有问题;蓝色背景仅添加到一台计算机上。
我试过重新启动计算机和打印机。我已经从我的 Linux 配置中删除了打印机并重新添加了它。结果总是一样的。甚至打印机安装程序的打印测试页功能也添加了蓝色背景。
我能做什么?
编辑
该问题似乎是由对 ghostscript 的更新引起的。我的 ghostscript 9.26 今天更新了。我尝试了另一个带有旧版 ghostscript 9.26 的 Linux 系统,它运行良好。然后我在该系统上更新了 ghostscript,然后我得到了蓝色背景。
如何强制系统返回到 Ghostscript 的旧(工作)版本?
编辑2
这绝对是一个错误。其他人已在 Ubuntu 错误跟踪器中报告:https : //bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/1817308
我正在尝试通过 Ghostscript 在 pdf 中添加徽标。目前,我正在使用此 Postscript .ps 文件添加文本:
<<
/EndPage
{
2 eq { pop false }
{
gsave
/NimbusSanL-Reg 12 selectfont
55 20 moveto (Sample) show
grestore
true
} ifelse
} bind
>> setpagedevice
Run Code Online (Sandbox Code Playgroud)
要调用 ps 文件,我使用以下命令行:
gs -dBATCH -dNOPAUSE -dAutoRotatePages=/None -sDEVICE=pdfwrite -sOutputFile=out.pdf stamp.ps -f in.pdf
Run Code Online (Sandbox Code Playgroud)
我想知道您是否可以使用类似的 .ps 文件来添加图像,例如小徽标。谢谢
我需要将服务器上的 Ghostscript 版本从 9.22 升级到 9.25。我正在数字海洋上运行 Laravel Forge Droplet。
我已经尝试过以下方法:
sudo apt-get update
sudo apt-get install ghostscript
Run Code Online (Sandbox Code Playgroud)
按照这个帖子。
然而,正如第二个答案表明您可能需要比这给您提供的版本更新的版本。就我而言,这样做可以得到 9.22,但我需要 9.25。那么我该如何仅使用终端在服务器上安装较新的版本呢?
首先,我很清楚这个问题:升级Ghostscript最简单的方法是什么?.
不幸的是,没有一个答案奏效。我可以deb
从这个列表中找到文件。在那里,我惊讶地看到适用于 Ubuntu 14.04 的 Ghostscript 的最新版本是 9.10 版。当我为 Ubuntu 15.04 下载 9.15 版本并运行它(以 root 身份)时,出现错误:
错误:依赖项无法满足libgs9
我检查了 ( apt-get install libgs9
) 并安装了最新的 libgs9。此外,该站点似乎确认最后是 14.04 的 9.10 版。
这是否意味着无法升级 Ghostscript?
ghostscript ×12
pdf ×4
inkscape ×2
printing ×2
10.04 ×1
11.04 ×1
14.04 ×1
16.04 ×1
apt ×1
command-line ×1
compression ×1
downgrade ×1
hp ×1
installation ×1
updates ×1
upgrade ×1