You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Diane <dh...@hotmail.com> on 2007/03/19 12:09:40 UTC

Disproportionate increase in size of PDF when inserting graphics

I'm generating a PDF using FOP 0.20.5 which has some text in and some jpegs 
using the fo:external-graphic tag.
Without the jpegs, i.e. if I put fo:external-graphic src='', the resultant 
output PDF is approx. 3k.
When I insert the details of the location of the jpegs (640k each on local 
machine), the output size of the PDF is 3mb.  I would have expected it to be 
more in the region of just under 2mb?

Is something in FOP increasing the resolution of the output if the images are 
inserted?
Or is this something which is fixed in fop 0.93?

Or is this more of a graphics question, if you have three images, extra 
overhead has to be included for some reason?

Any answers, even if it can't be fixed, would be appreciated.

Regards,

Diane


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Disproportionate increase in size of PDF when inserting graphics

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Diane sent me some files off-list, and the discrepancy between the JPEG
size and the PDF size is now easily explained:

The JPEG images are CMYK JPEGs with an embedded ICC color profile. A
678KB JPEG file contains 480KB worth of color profile data which is
duplicated in the PDF. The JPEG is simply embedded as is in the PDF plus
the color profile has to be added separately. The color profile is flate
compressed and encoded using ASCII85 while the JPEG image is embedded as
is with no additional encoding using FOP's default settings.

I can't tell off-hand if the color profile could be removed from the
embedded JPEG file without damaging anything. At any rate there's
currently no way to bring down the PDF size other than not using a color
profile when saving the JPEG image.

On 21.03.2007 09:19:10 Jeremias Maerki wrote:
> 
> On 20.03.2007 11:35:38 Diane wrote:
> > Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:
> > 
> > 
> > > 
> > > It depends on your settings. If 0.20.5 is run at default settings, I
> > > would expect the PDF to be just under 2MB. A short test of my own
> > > confirms that (one JPEG of 929'406 bytes results in a PDF of 930'622 bytes).
> > > Maybe not all your images are really JPEGs or maybe you configured an
> > > ASCII85 filter for JPEG images or FOP, for some reason, decodes your
> > > JPEG images which can make them bigger. Without seeing the resulting PDF
> > > I cannot say what has happened on your side.
> > > 
> > 
> > I'm running with a specific user config file with our clients proprietary 
> > fonts in, but I've just tried running through a stripped down file with one of 
> > their images and one from my phone camera.  The phone camera image produces a 
> > PDF much closer in size.
> > The images are being produced by a third party from within Photoshop - would 
> > this be where you would save in any ASCII filters?
> 
> It really depends exactly on your configuration file and the images. If
> you want you can send me those off-list and I'll check what the problem
> is. I can only explain the increase in file size if those Photoshop
> images are not real JPEG images or if somethin in the config file is set
> accordingly.
> 
> Jeremias Maerki



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Disproportionate increase in size of PDF when inserting graphics

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 20.03.2007 11:35:38 Diane wrote:
> Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:
> 
> 
> > 
> > It depends on your settings. If 0.20.5 is run at default settings, I
> > would expect the PDF to be just under 2MB. A short test of my own
> > confirms that (one JPEG of 929'406 bytes results in a PDF of 930'622 bytes).
> > Maybe not all your images are really JPEGs or maybe you configured an
> > ASCII85 filter for JPEG images or FOP, for some reason, decodes your
> > JPEG images which can make them bigger. Without seeing the resulting PDF
> > I cannot say what has happened on your side.
> > 
> 
> I'm running with a specific user config file with our clients proprietary 
> fonts in, but I've just tried running through a stripped down file with one of 
> their images and one from my phone camera.  The phone camera image produces a 
> PDF much closer in size.
> The images are being produced by a third party from within Photoshop - would 
> this be where you would save in any ASCII filters?

It really depends exactly on your configuration file and the images. If
you want you can send me those off-list and I'll check what the problem
is. I can only explain the increase in file size if those Photoshop
images are not real JPEG images or if somethin in the config file is set
accordingly.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Disproportionate increase in size of PDF when inserting graphics

Posted by Diane <dh...@hotmail.com>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:


> 
> It depends on your settings. If 0.20.5 is run at default settings, I
> would expect the PDF to be just under 2MB. A short test of my own
> confirms that (one JPEG of 929'406 bytes results in a PDF of 930'622 bytes).
> Maybe not all your images are really JPEGs or maybe you configured an
> ASCII85 filter for JPEG images or FOP, for some reason, decodes your
> JPEG images which can make them bigger. Without seeing the resulting PDF
> I cannot say what has happened on your side.
> 

I'm running with a specific user config file with our clients proprietary 
fonts in, but I've just tried running through a stripped down file with one of 
their images and one from my phone camera.  The phone camera image produces a 
PDF much closer in size.
The images are being produced by a third party from within Photoshop - would 
this be where you would save in any ASCII filters?

> 
> Jeremias Maerki
> 





---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Disproportionate increase in size of PDF when inserting graphics

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 19.03.2007 12:09:40 Diane wrote:
> I'm generating a PDF using FOP 0.20.5 which has some text in and some jpegs 
> using the fo:external-graphic tag.
> Without the jpegs, i.e. if I put fo:external-graphic src='', the resultant 
> output PDF is approx. 3k.
> When I insert the details of the location of the jpegs (640k each on local 
> machine), the output size of the PDF is 3mb.  I would have expected it to be 
> more in the region of just under 2mb?

It depends on your settings. If 0.20.5 is run at default settings, I
would expect the PDF to be just under 2MB. A short test of my own
confirms that (one JPEG of 929'406 bytes results in a PDF of 930'622 bytes).
Maybe not all your images are really JPEGs or maybe you configured an
ASCII85 filter for JPEG images or FOP, for some reason, decodes your
JPEG images which can make them bigger. Without seeing the resulting PDF
I cannot say what has happened on your side.

> Is something in FOP increasing the resolution of the output if the images are 
> inserted?

No, FOP inserts all images as is with no up- or downscaling.

> Or is this something which is fixed in fop 0.93?

I don't think it's a bug if you think in that direction.

> Or is this more of a graphics question, if you have three images, extra 
> overhead has to be included for some reason?

No.

> Any answers, even if it can't be fixed, would be appreciated.
> 
> Regards,
> 
> Diane


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org