- # I've been successful setting width and/or height on the
external-graphic element.
The snippet below shows the relevant bit of our xslt -- if the source
img tag has a width attribute then use it as is (it's assumed to be in
inches).
Otherwise imgsize references a java class I wrote to extract the size in
pixels of the image.
This is then divided by a global variable giving the desired dots per
inch for the output device
(150 in our case, as a classic 300 dpi setting made the images too
small, and anyway I think our
colour laser actually produces 600 dpi).
fo:external-graphic scaling-method=*integer-pixels* src=*{$ifile}*
- # xsl:attribute name=*width*
- # xsl:choose
- # xsl:when test=[EMAIL PROTECTED]
xsl:value-of select=[EMAIL PROTECTED] /
/xsl:when
- # xsl:otherwise
xsl:variable name=*imgt* select=*imgsize:new($ifile)* /
xsl:variable name=*img_width* select=*imgsize:getWidth( $imgt )* /
xsl:value-of select=*$img_width div $dpi* /
in
/xsl:otherwise
/xsl:choose
/xsl:attribute
/fo:external-graphic
Matthias Wessendorf wrote:
Jörg and others,
thanks for your emails, but since
content-width and content-height aren't supported by FOP
using content-width = .5in (for example) has no desired result.
In http://xml.apache.org/fop/graphics.html#resolution I saw using inch.
But I guess I'm still missing something to ensure that my image is
100 x 30 size.
Any idea?
-Matthias
-Original Message-
From: J.Pietschmann [mailto:[EMAIL PROTECTED]
Sent: Monday, June 13, 2005 10:32 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: problem with size(width height) on using
fo:external-graphic
Matthias Wessendorf wrote:
I have an external graphic that I load from WWW like:
fo:external-graphic src=url('http://www.foo.com/bar.gif') /
The file(graphic) is visible inside of my PDF file, but the
size is not correct.
This is a FAQ
http://xml.apache.org/fop/faq.html#graphic-resolution
So I added
width=100px
height=30px
attributes, but the same result.
Do *not* use pixels as measurement unless you render the FO
to a bitmap image.
J.Pietschmann
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.7.1 - Release Date: 13/06/2005
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]