I won't be able to share example documents because the ones we are provided that can replicate the bug have sensitive customer data them, but we found that on some TIF documents (LZW compressed), converting them to PDF with JPEG2000 and MRC compression results in a GenericError returned by GdPicturePDF.AddImageFromGdPictureImage on certain pages of the TIF document. Some pages it works fine.
Here is how we have our conversion configured in code.
Code: Select all
p.NewPDF();
p.SetCompressionForColorImage(PdfCompression.PdfCompressionJPEG2000);
p.SetCompressionForBitonalImage(PdfCompression.PdfCompressionJBIG2);
p.SetJpegQuality(100);
p.EnableCompression(true);
And our call to add the page.
Code: Select all
p.AddImageFromGdPictureImage(pageId, PdfAdvancedImageCompression.PdfAdvancedImageCompressionMRC);
I tested this with versions 12.0.50-56 and all of them give the same error. For now we are switching to Flate compression with MRC which does not have this issue. We could have also switched to JPEG2000 and Color Detection instead which does not have the issue, but wanted to stick with MRC since the resulting file size is lower. I am thinking this is a bug because our code has successfully converted millions of TIF documents of various kinds to PDF, but we are seeing this in some circumstances.