On 14.01.2009 09:30:12 Justus-bulk wrote:
> david <[email protected]> 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.

Not necessarily. Help is welcome if anyone finds this is important.
However, this is not going to be trivial to integrate in FOP. But I'll
help with pointers if anyone wants to try.

> 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.

Well, the setting is already there (used for other purposes mostly).
Only for PCL this setting already results in downsampling because it
doesn't work otherwise. But enabling image downsampling for PDF, PS & Co.
should be a separate setting. Image downsampling costs a lot of CPU
power. Currently, we try to optimize image processing. For example, JPEG
and certain TIFF images don't even get decompressed when you create PDF.
That allows for lightning-fast image processing. Downsampling requires
decoding, downsampling and re-encoding the image.

> > or/and combined with some other java library?
> 
> Check out the J2SE packages javax.imageio and java.awt.image.
> 
> Justus



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to