简体   繁体   English

将PostScript转换为PDF文件时出现Ghostscript错误

[英]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.

相关问题 使用GhostScript将PDF转换为PostScript时出错,Access被拒绝无法打开命令行文件_.at - Error in Converting PDF to PostScript with GhostScript, Access is denied Unable to open command line file _.at 将 pdf 转换为图像时出现 Ghostscript 错误 - getting error for Ghostscript when converting pdf to image 将Postscript文件转换为pdf不起作用 - Converting postscript file to pdf not working 将PostScript转换为PDF的Ghostscript似乎忽略了页面大小/ BoundingBox - Ghostscript converting PostScript to PDF seems to ignore the page size / BoundingBox PostScript - 使用Ghostscript时出错“pdfwrite” - PostScript - Error when Using Ghostscript “pdfwrite” 为什么在使用ImageMagick / Ghostscript时转换此PDF文件失败? - Why converting this PDF file fails when using ImageMagick/Ghostscript? Ghostscript 错误:使用 ghostscript 将 PDF 转换为 TIFF 时 /invalidrestore - Ghosctscript error: /invalidrestore when converting PDF to TIFF using ghostscript 在Postscript中添加编码,Ghostscript可以正确呈现文本,但是转换为PDF不会显示字符 - Adding encoding in postscript, ghostscript renders text correctly, but converting to PDF does not show the characters 将PDF转换为PNG时出错-Python 3.6和GhostScript - error Converting PDF to PNG - Python 3.6 and GhostScript 将postscript转换为pdf - Converting postscript to pdf
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM