简体   繁体   English

转换加盖页面时,PDF到PostScript的转换速度很慢

[英]PDF to PostScript conversion slow while converting stamped pages

I have been using Ghostscript to convert PDF documents into PS. 我一直在使用Ghostscript将PDF文档转换为PS。 The conversion speed was near instantaneous until I began to stamp a signature on the PDF pages. 转换速度接近瞬间,直到我开始在PDF页面上标记签名。 Now each stamped page adds 2-3 seconds resulting in a tremendous bottleneck. 现在每个加盖的页面都会增加2-3秒,从而导致巨大的瓶颈。

  1. Are there any ways to possibly make the conversion more efficient via GS commands? 有没有什么方法可以通过GS命令提高转换效率?
  2. Is there a better way to stamp PDF documents? 是否有更好的方式来标记PDF文档?

I don't know exactly what is going on, but I am guessing the stamp adds a layer to the PDF which results in more work once it converts to PS? 我不确切知道发生了什么,但我猜这个标记为PDF添加了一层,一旦转换为PS就会产生更多的工作?

I am using C#, iTextSharp to add the stamp. 我正在使用C#,iTextSharp来添加图章。

I have tried to add the stamp with FormFlattening = true. 我试图用FormFlattening = true添加图章。
I have tried following in suggestions in this question [ Any tips for speeding up GhostScript? 我在这个问题中尝试过以下建议[ 有关加速GhostScript的任何提示吗? ] to no avail. ]无济于事。

If the 'stamp' involves transparency then the area of the stamp (at least) cannot be represented in PostScript as PostScript has no transparency. 如果'标记'涉及透明度,则标记的区域(至少)无法在PostScript中表示,因为PostScript没有透明度。 This will result in at least a portion of the page being rendered to an image. 这将导致页面的至少一部分被渲染成图像。 Depending on how the transparency is used, this could result in the entire page being rendered. 根据透明度的使用方式,这可能会导致整个页面被渲染。

The default resolution for conversion is 720 dpi, it may well take some considerable time to render large areas at that resolution. 转换的默认分辨率为720 dpi,在该分辨率下渲染大区域可能需要相当长的时间。 You can use the -r switch to reduce the resolution. 您可以使用-r开关来降低分辨率。 Presumably you are converting to PostScript in order to print the document, you can reduce the resolution to that of the printer without loss, and probably to as low as 1/4 the resolution of the printer without any appreciable loss of quality. 据推测,为了打印文档,您要转换为PostScript,您可以将打印机的分辨率降低到不损失的程度,并且可能低至打印机分辨率的1/4而不会有任何明显的质量损失。 Reducing the resolution will result in faster conversion to PostScript, and a smaller PostScript file which will transmit to the printer faster and print more quickly. 降低分辨率将导致更快地转换为PostScript,以及更小的PostScript文件,可以更快地传输到打印机并更快地打印。

Of course without seeing an example file this is supposition. 当然,如果没有看到示例文件,这就是假设。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM