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 "Levesque, Gary R" <ga...@boeing.com> on 2005/05/20 23:36:35 UTC

Background Image Rendering

I have been struggling with the getting a background image (jpeg) to
display properly in the PDF output using fop 0.20.5 on Windows XP.

I am inserting a background jpeg image ("watermark") and placing a table
over the top of it.  When I view the image and table in a tool such as
XSLFormatterV3.2 the size of the jpeg image is appropriate (the image is
a form that basically fills in the entire 8.5in X11.0in boundary).
However when I process the file in FOP the size of the JPEG image gets
increased by approximately 400% such that the PDF file only contains the
top left portion of my form image.


Below is the command line I am using to insert the image.

<fo:region-body column-count="1" margin-bottom=".25in"
margin-left="0.0in" margin-right=".25in" margin-top=".1in"
region-name="region-body"
background-image="url(C:\FOP\images\rrform.jpg)"
background-repeat="no-repeat"/>

I was able to get the JPEG to display the correct size in the PDF output
by using another program to resize the file from 1700 X 2200 pixels to
610 X 789, however the clarity of the image has gone to hell.

Any guidance is appreciated.

GARY LEVESQUE



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


Re: Background Image Rendering

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Levesque, Gary R wrote:
> over the top of it.  When I view the image and table in a tool such as
> XSLFormatterV3.2 the size of the jpeg image is appropriate (the image is
> a form that basically fills in the entire 8.5in X11.0in boundary).
> However when I process the file in FOP the size of the JPEG image gets
> increased by approximately 400%

JPEG images are bitmaps. FOP renders bitmaps at a fixed resolution of
72dpi in absence of an explicit widht/height specification, which
unfortunately can't be provided for background images. Any metadata in
the bitmap file indicating another resolution is ignored. Your only
option to get FOP to display your JPEG background as intended is to
create a 72 dpi image. Alternatively, use SVG graphics.

J.Pietschmann

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