You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Alex McLintock <al...@my-deja.com> on 2000/10/11 19:02:51 UTC

Compression of Images (was XSL Formatting Objects Chapter Updated)

Since posting my original question I spotted a month old posting of Eric's in the archives.

I am using FOP version 0.13 (with a patch I think) but Eric basically says (on 7th Sept) that to use the ZLib encoding of images one needs to get a version out of CVS. He said this after the release of 0.14 so I have to assume that 0.14 didn't have the ZLib stuff in it.

Is version 0.15 expected to be released soon? Should I not wait for it and get the current CVS version?  I think I might have a hard time explaining that I didn't use an official release of FOP, just the CVS snapshot from day N in October 2000. 

Oh - and sorry to Eric - I can't post the code for the in-memory image fetch protocol as 

a) it isn't mine.
b) my boss will shout at me.


PS Anyone going to Apache Con Europe? It is happening twenty 
minutes walk from my flat. I'm desperately looking for someone 
to sell some t-shirts for me. 

Alex


 From:             Eric SCHAEFFER
 Date:             Thu, 07 Sep 2000 08:50:24 GMT
 To:               <fo...@xml.apache.org>, <la...@patroids.com>
 Subject:          Re: Reduce pdf size
 Message:
                   Use the CVS version.
                   Images are compressed using ZLib.

                   Eric.


                   ----- Original Message -----
                   From: "Khim" <la...@patroids.com>
                   To: <fo...@xml.apache.org>
                   Sent: Thursday, September 07, 2000 10:39 AM
                   Subject: Reduce pdf size


> Hi there,
> is there a way to reduce the pdf file size with a image file. it is about 3MB but it only consist of few words and a image with resolution 300X 300 and the image size is about 400KB but when I embed it the pdf the pdf file created size is about 3MB. I use <fo:external-graphic> to embed the image.
> Thanx a lot. Khim


>Reply-To: fop-dev@xml.apache.org
>From: "Eric SCHAEFFER" <es...@posterconseil.com>
>To: <fo...@xml.apache.org>
>Subject: Re: XSL Formatting Objects Chapter Updated
>Date: Wed, 11 Oct 2000 17:47:58 +0200
>
>
>----- Original Message -----
>From: "Carlos Villegas" <ca...@uniscope.co.jp>
>To: <fo...@xml.apache.org>
>Sent: Wednesday, October 11, 2000 5:32 PM
>Subject: Re: XSL Formatting Objects Chapter Updated
>
>
>> Eric SCHAEFFER wrote:
>> > Can you send me your code ?
>> >
>> > > I am generating some images and including them in a FOP generated PDF
>file
>> > using such a fake URLConnection class. Unfortunately the image at the
>moment
>> > is of class "Image" which seems to be uncompressed and the PDF file is
>> > around 2Mb because of it.
>> > >
>> > > If I can do this with an uncompressed Image I should be able to do the
>> > same thing with a GIF. Surely if I supply FOP with a GIF it wont
>uncompress
>> > it before putting it into the PDF file will it?
>> > >
>> >
>> > All images are uncompressed, because compression is different in PDF.
>> > But they are compressed again, using ZLib algo.
>> >
>> > The only difference there can be is that images are converted to RGB
>color
>> > space.
>>
>> As I understand JPEG images and indexed images are treated the same way;
>> uncompressed to RGB color and compressed again with Zlib.
>> For bitmaps this is fine, but in case of JPEG, it's a waste to throw
>> away the 10:1 typical compression ratio of a JPEG image. Zlib can't
>> get those ratios. Wouldn't be possible to "just" include the JPEG image
>> in the
>> PDF. I don't know much about PDF, but it supports JPEG, version 1.3 even
>> support progressive JPEG and reading from external image files.
>> I know it may not be "just" including it, you might need to do some
>> manipulation, but I think it might be possible to extract the JPEG
>> data without modifying it. Just a thought...
>
>Needs to be done...
>Eric.
>
>>
>> Carlos Villegas
>>



www.DiverseBooks.com www.zz9.org www.charming-underclothes.org.uk
www.SFLink.net www.inversity.co.uk

------------------------------------------------------------
--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.



Re: Compression of Images (was XSL Formatting Objects Chapter Updated)

Posted by Eric SCHAEFFER <es...@posterconseil.com>.
----- Original Message -----
From: "Alex McLintock" <al...@my-deja.com>
To: <fo...@xml.apache.org>
Sent: Wednesday, October 11, 2000 7:02 PM
Subject: Compression of Images (was XSL Formatting Objects Chapter Updated)


> Oh - and sorry to Eric - I can't post the code for the in-memory image
fetch protocol as
>
> a) it isn't mine.
> b) my boss will shout at me.
>

You're wellcomed.

Eric.