[英]Ghostscript error when converting PostScript to PDF file
I convert a PDF with Ghostscript (9.20) to a PostScript File: 我将带有Ghostscript(9.20)的PDF转换为PostScript文件:
pdf2ps original.pdf optimized.ps
and then try to reconvert the PostScript to a smaller PDF file with the -dPDFSETTINGS=/screen or /ebook option to hopefully obtain a smaller PDF file size in the end: 然后尝试使用-dPDFSETTINGS = / screen或/ ebook选项将PostScript重新转换为较小的PDF文件,以期最终获得较小的PDF文件大小:
ps2pdf -dPDFSETTINGS=/screen optimized.ps optimized.pdf
But then I get the following error during conversion: 但是在转换过程中我遇到以下错误:
Subsample filter does not support non-integer downsample factor (2.400000)
Failed to initialise downsample filter, downsampling aborted
What's missing or what I'm doing wrong? 什么缺失或我做错了什么? Couldn't find any solutions yet… :-(
找不到任何解决方案...... :-(
Firstly you don't need to do a multiple step conversion PDF->PS->PDF, a simple PDF->PDF will work. 首先,您不需要进行多步转换PDF-> PS-> PDF,简单的PDF-> PDF将起作用。
The warning is due to trying to downsample images to a lower resolution, and the scale factor is not an integer. 警告是由于尝试将图像下采样到较低分辨率,并且比例因子不是整数。 So in this case, it won't downsample.
所以在这种情况下,它不会下采样。 If you insist on using the canned settings instead of setting the controls yourself, then I'm afraid you are pretty much always going to be in the dark.
如果你坚持使用固定设置而不是自己设置控件,那么我担心你几乎总是在黑暗中。 It would be much better to read the documentation and work out which controls to set, based on the type of input you have, and the compromises you are prepared to accept on quality.
根据您的输入类型以及您准备接受的有关质量的妥协,阅读文档并确定要设置的控件会更好。
In this case, you will almost certainly have to not downsample monochrome images. 在这种情况下,你将几乎肯定不降低采样单色图像。 See the documentation on how to achieve that.
请参阅有关如何实现这一目标的文档。
You have not stated the version of Ghostscript you are using which makes it even harder to comment here, however there is an open enhancement request regarding the downsampling filter here 你还没有说你正在使用的Ghostscript的版本,这使得它更难在这里发表评论,但有关于采样滤波器开放增强请求在这里
Which originated with a Stack Overflow question here 这源于一个堆栈溢出问题在这里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.