What the classes in codec package do is maintain, if possible, the same
colorspace as the original. If the PNG is indexed, then the result will be
indexed. The actual image data will be used as is if supported by the pdf or
will be shuffled and recompressed. This will happen if there are 16 bit
components, alpha channel or progressive display.
To use PngImage do:
Image img = PngImage.getImage("my file name");
Best Regards,
Paulo Soares
> -----Original Message-----
> From: Chris Faulkner [SMTP:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 7:41
> To: [EMAIL PROTECTED]
> Subject: RE: [iText-questions] Sizing of a pdf
>
> I am not sure I understand your response in terms of what it means for me.
> I
> need to maintain the image compression. How can I do this in iText ?
> Whilst
> I am working with JPGs now, I could also create TIFFs or PNGs. Are you
> saying that if I have a PNG image, I can create a
>
> com.lowagie.text.pdf.codec.PngImage
>
> instead of loading it via java.awt.Toolkit and then make a
> com.lowagie.text.Image to add to my document and that would maintain the
> compression in the PNG ?
>
> eg
> // pis is an input stream made from my PNG image
> com.lowagie.text.pdf.codec.PngImage pi = new
> com.lowagie.text.pdf.codec.PngImage ( pis );
> Image myim = Image.getInstance( );
>
> How do I use getInstance with my decoded PngImage so as to maintain
> compression ?
>
> Thanks
>
> Chris
>
> -----Original Message-----
> From: Paulo Soares [mailto:[EMAIL PROTECTED]
> Sent: 05 June 2003 10:31
> To: 'Chris Faulkner'; [EMAIL PROTECTED]
> Subject: RE: [iText-questions] Sizing of a pdf
>
>
> In iText the reading of images from java.awt.Toolkit is always done by
> first
> converting the image to RGB. Images such as gif use a palette and are a
> lot
> smaller than the expanded RGB result. You can use the classes in
> com.lowagie.text.pdf.codec to read all the image types that awt supports
> (and some others), in the most efficient way. The next version will have a
> way to get all type of images using a single interface in
> com.lowagie.text.Image.
>
> Best Regards,
> Paulo Soares
>
> > -----Original Message-----
> > From: Chris Faulkner [SMTP:[EMAIL PROTECTED]
> > Sent: Thursday, June 05, 2003 8:35
> > To: [EMAIL PROTECTED]
> > Subject: [iText-questions] Sizing of a pdf
> >
> > Hello
> >
> > I have a PDF to which I am adding some imagery. There were initially two
> > images in the document, one of which was about 100K and the other about
> > 600K. The PDF wass approximately 1.4MB and was composed on only a single
> > page with some other text on it. So I have long wondered why the PDF is
> > much
> > bigger than the two images which go to make it up but I wasn't too
> > concerned.
> >
> > This morning I added a third image ( a 1K PNG ) on top of the larger
> image
> > and the file size shot up to 2MB. Can anyone explain the mechanics of
> > this
> > internally or advise of a way of keeping the size down ? I am adding the
> > images, using java.awt.Toolkit, as outlined in the tutorial in the
> > following
> > way
> >
> > Image image =
> > Image.getInstance(Toolkit.getDefaultToolkit().createImage("H.gif"),
> null);
> > image.setAbsolutePosition(100, 200);
> > cb.addImage(image);
> >
> > Previously, I was using SVG and Batik to composite the two overlapping
> > images but i wanted to remove this and just add the images together with
> > iText.
> >
> > Thanks
> >
> > Chris
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Etnus, makers of TotalView, The best
> > thread debugger on the planet. Designed with thread debugging features
> > you've never dreamed of, try TotalView 6 free at www.etnus.com.
> > _______________________________________________
> > iText-questions mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The best
> thread debugger on the planet. Designed with thread debugging features
> you've never dreamed of, try TotalView 6 free at www.etnus.com.
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions