On Jan 20, 2007, at 2:59 PM, Steven Case wrote:
> There is, however, a disadvantage that I have encountered. For
> quite a few
> users, the iText generated documents are also significantly
> larger. Most of
> the documents contain a large number of images.
Distiller has a bunch of code in there for image optimization.
Everything from simple downsampling (reducing resolution) to
quantization to color conversions - as defined by the preferences and
settings.
All of these things could be done using Java Advanced Imaging or
similar toolkits - if you wanted to integrate those into the image
handling methods of iText.
> I can generate PDF files that are nearly identical in size to
> those generated by Acrobat Distiller, provided that I create a
> Graphics2D
> object that is set to convert images to JPEG format so that the
> images are
> compressed
>
Right, because JPEG is a lossy format and compresses well.
> Unfortunately, I cannot use this specific Graphics2D feature for
> all of the
> images. Many of the images are png files that have transparent pixels
> within the images (such as icons). Internally, the images use ARGB
> format.
> I'm wondering if there is any way to dynamically enable and disable
> the
> conversion of images to JPEG?
As already discussed, this isn't an option - but would be very easy
to add!
> Alternatively, a Graphics2D object that would convert to
> another compressed image format that retains the transparent pixels
> (such as
> PNG) would also work.
>
There are only two native "image formats" for PDF - JPEG and "PDF
bitmap". So for images with transparency, it would be converted into
the latter.
Leonard
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/