----- Original Message ----- 
From: "Jerold Sampson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 16:23
Subject: [iText-questions] PDF File Image Sizes


> Greetings,
> 
> I have been creating PDF files containing images converted from
> another format.  The results are good but I have some performance
> related questions.
> 
> I create the image using either of the two following methods:
> 
> // 8-bit logic
>     int transparency[] = {255, 255};
>     byte[] ib = new byte[tkn.hs*tkn.vs];
>     //Tp.binToBytes(tkn.iData,ib,tkn.hs,255,0);
>     Tp.binToBytes(tkn.iData,ib,tkn.hs);
>     pdfImage = 
> com.lowagie.text.Image.getInstance(tkn.hs,tkn.vs,1,8,ib,transparency);
> 
> // 1-bit logic
>     int transparency[] = {1, 1};
>     pdfImage = 
> com.lowagie.text.Image.getInstance(tkn.hs,tkn.vs,1,1,tkn.iData,transpare
> ncy);
> 
> The image data source it always 1-bit (black and white) data.
> 
> As one would expect the 1-bit logic runs faster since I don't have to
> translate
> binary image data to 8-bit.  However the resulting PDF uses CCITT 
> compression which
> for some reason actually results in larger PDF files than the 8-bit
> logic.

That's surprising but possible if there are many bw transitions.

> The 8-bit logic uses the standard flatedecode.  Also, using something
> other 
> than
> CCITT compression may by faster . . . maybe!
> 
> These results are to say the least counter intuitive!
> 
> Is there a way to tell iText to use flatedecode or some other
> compression 
> scheme with
> the 1 bit image?  We are trying to get the best combination of
> performance 
> and file
> size we can.

Use ImgRaw() directly.

Best Regards,
Paulo Soares

> 
> Can anyone shed some light on this subject? . . . I'm abit baffled by
> this!
> 
> Thanks,
> Jerold Sampson
> 
> 
> 
> 
> 
> 
> Jerold R Sampson
> TallPine Technologies, Inc.
> 
> www.tallpine.com
> 303-415-1203
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
> same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to