1

我正在使用 ghostscriptSharp 将 PDF 文件转换为 TIFF 文件以进行传真。PDF 文件有时包含收据的复印件。

我正在使用高度 x 宽度为 400 x 400 的 tiffg3 驱动程序。我注意到包含影印件的 PDF 在转换为 TIFF 时往往会扩大尺寸,而没有影印件的 PDF 会缩小。我看到的典型增长是从 1 MB 增加到 25 MB。

我尝试向 TIFF 添加压缩,但传真进程无法读取它。有没有办法在不降低分辨率的情况下减小 ghostscriptSharp 中的输出大小?

4

3 回答 3

1

Creating a bitmap, even a low resolution monochrome bitmap, is likely to be larger than a vector-based description language.

Consider:

(Hello World) Tj

That's 16 bytes in a PDF file, and it doens't change if you change the font size. If you turn it into a bitmap, even at low resolution and compressed, it probably exceeds that size.

That's why rendering a page description language to a bitmap produces larger files and is one of the reasons for using a page description language for printing, instead of sending large bitmaps around.

The tiffg3 and tiffg4 devices in Ghostscript only produce monochrome output, because that's all you can encode with G3 and G4 encoding. TIFF G3 is already compressed using the Fax CCITT group 3 compression scheme (Group 3 = g3). If you try to compress that using some other scheme, then your fax software wont be able to read it.

You could try using CCITT Group 4 fax compression instead (the tiffg4 device) but if that doesn't help then basically that's what you get. Your only other option is to create the TIFF at a lower resolution. You don't say what resolution you are currently using. Fax normally supports 3 resolutions; 408x391, 204x196 and 204x98. If you are using superfine (408x391) then you could switch to a lower resolution.

I'm at a loss to see why this is a problem since you are sending the files by fax anyway, why do you care how large an intermediate TIFF file you get ?

于 2017-08-24T07:32:51.227 回答
0

如果压缩不起作用并且您不能降低分辨率,那么唯一剩下的选择就是颜色深度。当附上复印件时,转换可能使用更多颜色是合理的(因为阴影中的渐变,或纸张的特定颜色,或其他原因);然而,收据可能在没有所有颜色的情况下完全可读(只要“墨水”与“纸张”不同)。

如果您的转换工具具有用于选择颜色深度的设置,那么修改它可能是您最好的选择。

于 2017-08-23T19:25:24.243 回答
0

如果您的工具包允许编码选项,对于传真,您最好的选择是使用第 4 组编码生成一个双色调(黑白)tiff。该压缩方案的缺点是您拥有的“灰色”越多(通常将彩色图片转换为灰度),您的文件就越大,否则,对于大多数情况来说,压缩率会很好。

于 2017-08-23T23:48:30.737 回答