xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justus-b...@Piater.name
Subject Re: pdf file size with image scaled/resized
Date Wed, 14 Jan 2009 08:30:12 GMT
david <overtaker@gmail.com> wrote on Wed, 14 Jan 2009 03:36:58 +0000
(UTC):

> I notice that after I resize a 40008 x 3112 image (which is 2.5mb in
> size) to 66m width and scale:uniform set, the resulting pdf size is
> 2.5mb too

This is because FOP (as probably most page rendering engines) does not
contain any image processing capabilities; it just includes the
original image data and scales their rendering as specified.

> but if i resize the image using paint.net to half of the original
> size, the file size become 800kb and if i create the same pdf using
> that image, the pdf file size goes down to 800kb

Here you reduce the original image data (by smoothing and
subsampling).

> is there anyway I can achieve that resizing using fop

This would probably be considered outside the scope of FOP.

If your PDF is intended for printing, you should use images (scaled
using your favorite image processing program) that come out to about
600dpi (here, pixels per inch), or whatever the physical resolution of
your printer is. Less looks visibly worse; more needlessly increases
file size and printing time.

If your PDF is only intended for on-screen viewing, similar reasoning
applies; here the resolution can be much lower.

On the other hand, it would indeed be cool if FOP had a command-line
switch to specify the target resolution of raster content in PDF
output. Then, FOP could do such downscaling internally.

> or/and combined with some other java library?

Check out the J2SE packages javax.imageio and java.awt.image.

Justus

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


Mime
View raw message