我的将多页 TIFF 转换为 PDF 的程序不再在 Windows 7 下运行。该程序包含遍历 TIFF 页面的代码,将每个页面转换为具有 CCITT Group4 压缩的 TIFF 并将位图数据插入生成的 PDF文件。
转换通过以下方式完成(c#):
ImageCodecInfo tiffCodecInfo = GetEncoderInfo("image/tiff");
EncoderParameters myEncoderParameters = new EncoderParameters(2);
// Save the bitmap as a TIFF file with CCITT group4 compression.
myEncoderParameters.Param[0] = new EncoderParameter System.Drawing.Imaging.Encoder.Compression, (long)EncoderValue..CompressionCCITT4);
myEncoderParameters.Param[1] = new EncoderParameter(System.Drawing.Imaging.Encoder.ColorDepth, 1L);
image.Save(source, tiffCodecInfo, myEncoderParameters);
似乎 GDI+ 的行为在 Windows 7 中发生了变化:生成的 CCITT 位图数据不再编码在单个条带中。因此,我无法在我的 PDF 文件中使用此位图数据。
问题:有人知道我如何告诉 GDI+ 将位图数据编码在一个条带中吗?