After updating from IEvolution 3.1.1.0 to 8.0.0.0 the following code results in empty PDFs
using (var imgTool = new IEImage())
{
var ext = Path.GetExtension(filename).ToLower();
img.IOParams.FileFormat = IEFileFormats.PDF;
var resolution = Math.Max(TwainParams.XResolution.CurrentValue, TwainParams.YResolution.CurrentValue)
img.IOParams.JPEG_ColorSpace = IOParams.JPEGColorSpace.RGB;
if (resolution <= 150)
{
img.IOParams.JPEG_Quality = 50;
}
else if (resolution <= 300)
{
img.IOParams.JPEG_Quality = 65;
}
else
{
img.IOParams.JPEG_Quality = 80;
}
img.IOParams.PDF_Compression = IOParams.PDFCompression.JPEG;
imgTool.CreatePDFFile(filename);
for (var i = 0; i < _imgThumbnails.ImageList.ImageCount; i++)
{
_imgThumbnails.ImageList.CopyTo(i, imgTool);
imgTool.SaveToPDF();
}
imgTool.ClosePDFFile();
}
Changing the compression from IOParams.PDFCompression.JPEG to IOParams.PDFCompression.LZW works, but the resulting files are much larger.
Is JPEG compression broken? Any hints?