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
 .NET IEvolution2 and PDF or TIFF compression
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

rlange

Germany
26 Posts

Posted - Jul 02 2014 :  04:49:56  Show Profile  Reply
In the .NET Version (IEvolution2), setting the compression has no effect. The written file is always uncompressed in TIFF or PDF export.

C# code:


for (int i = 0; i < ieMulti1.ImageList.ImageCount; i++)
{
    ieMulti1.ImageList.GetIOParams(i).TIFF_Compression = AC.currentStack.ExportTIFFCompression;
}
ieMulti1.ImageList.SaveImages(tiffFileName);



IEImage img = new IEImage();
img.CreatePDFFile(pdfFileName);

for (int i = 0; i < ieMulti1.ImageList.ImageCount; i++)
{
    ieMulti1.ImageList.GetIOParams(i).PDF_Compression = AC.currentStack.ExportPDFCompression;
    ieMulti1.ImageList.CopyTo(i, img);
    img.IOParams.PDF_Compression = AC.currentStack.ExportPDFCompression;
    img.SaveToPDF();
}

img.ClosePDFFile();
img.Dispose();

xequte

39053 Posts

Posted - Jul 09 2014 :  22:51:38  Show Profile  Reply
Hi

Is the selected compression suitable for the image pixel format? (e.g. "jpeg" compression doesn’t work with black/white images, G3/G4 compressions do not work with RGB images, etc).

Please try:

      ieViewer1.Image.LoadImage(@"test.jpg");

      ieViewer1.Image.IOParams.PDF_Compression = IOParams.PDFCompression.JPEG;
      ieViewer1.Image.CreatePDFFile(@"test.pdf");
      ieViewer1.Image.SaveToPDF();
      ieViewer1.Image.ClosePDFFile();


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

rlange

Germany
26 Posts

Posted - Jul 28 2014 :  00:57:21  Show Profile  Reply
This seems to be the solution. When i use LZW compression it works for TIFF + PDF.
Thank you.
Go to Top of Page

rlange

Germany
26 Posts

Posted - Aug 12 2014 :  14:23:14  Show Profile  Reply
Now i know why the TIFF compression failed.
Maybe you can help me how i can solve this problem.

First i load a 1bit TIFF Image into ieMultiScan (IEMulti).
After this, i copy this image to another IEMulti, here ieMulti1.
When i try to write the ieMutli1 with TIFF compression G4FAX (see code above) it is not compressed. The pixel format of the output file is suddenly 24bit.
Why? And how can i keep the original format?

Here the source for copying the images between the two IEMulti:

IEImage sourceImage = ieMultiScan.ImageList.GetImage(i);
IEImage image = new IEImage(sourceImage);
image.DpiX = sourceImage.DpiX;
image.DpiY = sourceImage.DpiY;
ieMultiScan.ImageList.ReleaseImage(sourceImage, i);
ieMulti1.ImageList.AppendImage(image);


Thank you in advance.
Go to Top of Page

xequte

39053 Posts

Posted - Aug 20 2014 :  18:25:12  Show Profile  Reply
Hi

You need to ensure BitsPerSample and SamplesPerPixel contain the right values (1 bit per sample and 1 sample per pixel in this case):

for (int i = 0; i < ieMulti1.ImageList.ImageCount; i++) {
    ieMulti1.ImageList.GetIOParams(i).TIFF_Compression = AC.currentStack.ExportTIFFCompression;
    ieMulti1.ImageList.GetIOParams(i).BitsPerSample = 1;
    ieMulti1.ImageList.GetIOParams(i).SamplesPerPixel = 1; }
ieMulti1.ImageList.SaveImages(tiffFileName);



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