I have been using Ghostscript to convert PDF documents into PS. The conversion speed was near instantaneous until I began to stamp a signature on the PDF pages. Now each stamped page adds 2-3 seconds resulting in a tremendous bottleneck.

  1. Are there any ways to possibly make the conversion more efficient via GS commands?
  2. Is there a better way to stamp PDF documents?

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?

I am using C#, iTextSharp to add the stamp.

I have tried to add the stamp with FormFlattening = true.
I have tried following in suggestions in this question [ Any tips for speeding up 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. 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. You can use the -r switch to reduce the resolution. 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. 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.

Of course without seeing an example file this is supposition.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top