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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 SaveToFilePDF creating huge PDFs

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
EricNat Posted - Sep 26 2011 : 14:12:41
I am using TImageEnMView to acquire a scan using TWAIN and then save the acquired image as a PDF using SaveToFilePDF. The issue is that it is creating huge PDF files. A 4 page B&W scan at 200dpi is about 45MB. When I open it in Acrobat and "optimize" it, the file shrinks to 600kb. Here is what I am doing:

ScanView->MIO->SelectAcquireSource(ieaTWain);
if (ScanView->MIO->Acquire(ieaTWain)) {
ScanView->MIO->SaveToFilePDF("testscan.pdf");
}

I have tried adjusting the PDF_Compression value for each page, but that doesn't seem to affect anything.

Any thoughts?

Thanks,
Eric
6   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Oct 11 2011 : 08:56:09
Hello,
please re-check your code, because version 3.1.2 has DuplicateCompressionInfo method.
Otherwise please post your code.
rogmartins Posted - Oct 11 2011 : 05:20:48
Hi !
Iīm having the same related trouble with both tif and pdf formats using the version 3.1.2
I canīt compile the code you suggested because it doesnīt have the DuplicateCompresseionInfo method.

How can i correct this anyway ?

My clients are so annoyed.

Thanks
EricNat Posted - Sep 28 2011 : 23:41:30
Thank you Fabrizio. I ended up getting it to work by doing two things -- I updated the component to the latest version (I was using an older version) and I had to also either scan in B&W or run ConvertToBW_FloydSteinberg() on each page before compressing and saving. That did the trick. Thank you.
fab Posted - Sep 27 2011 : 04:57:25
It must work. I just re-tested it.
Make sure that:
1) BitsPerSample and SamplesPerPixel are both "1"
2) the input/output parameters are assigned at index "0"
3) you call DuplicateCompressionInfo()
4) you always reference the embedded "MIO" object, instead of a possible external TImageEnMIO object

Four common US Letter (at 200 dpi) pages should require about 15KB (while uncompressed is about 45MB).
This is the code I used for the test:

ImageEnMView1->MIO->SelectAcquireSource();
ImageEnMView1->MIO->Acquire();
ImageEnMView1->MIO->Params[0]->PDF_Compression = ioPDF_G4FAX;
ImageEnMView1->MIO->Params[0]->BitsPerSample = 1;
ImageEnMView1->MIO->Params[0]->SamplesPerPixel = 1;
ImageEnMView1->MIO->DuplicateCompressionInfo();
ImageEnMView1->MIO->SaveToFilePDF("test.pdf");
EricNat Posted - Sep 26 2011 : 23:11:52
I have tried adding that code, but I still get large PDF files. Setting the compression doesn't seem to affect anything. Each page results in about 10MB in the PDF. Do you have any other thoughts?

Thank you.
fab Posted - Sep 26 2011 : 22:23:32
Hello,
you have to specify a compression method.
For example, for B&W images, the best is G4FAX, so you should write:

ScanView->MIO->Params[0]->PDF_Compression  = ioPDF_G4FAX;
ScanView->MIO->Params[0]->SamplesPerPixel = 1;
ScanView->MIO->Params[0]->BitsPerSample = 1;
ScanView->MIO->DuplicateCompressionInfo();
ScanView->MIO->SaveToFilePDF("testscan.pdf");