ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Scan with JPEG compression results in empty PDF
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

proethl

1 Posts

Posted - Oct 28 2020 :  06:02:57  Show Profile  Reply
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?

xequte

38176 Posts

Posted - Oct 29 2020 :  01:58:07  Show Profile  Reply
Hi

It does seem like there is an issue there. We'll need to investigate when we do our next IEvolution update.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: