Thanks all, I will try it.
Vasek
John Burgess wrote:
Vasek
below is a message I sent a couple
of hours ago which was refused because of the jar. This time I've just
attached the source file - it will need to go in a
com\riskdecisions\utils folder.
John
Vasek
I attach the jar which you need to put on your class path or otherwise =
make available to your xslt engine.
Then what follows is some simplified extracts from my xslt.
!-- first we need to declare the imagesize class --
xsl:stylesheet version=3D"1.0"
xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
xmlns:fo=3D"http://www.w3.org/1999/XSL/Format"
=
xmlns:imgsize=3D"http://xml.apache.org/xslt/Java/com.riskdecisions.utils.=
imagesize.imageSize"
!-- this variable is used to keep the desired dpi setting for
images =
in one place --
xsl:variable name=3D"dpi" select=3D"150" /
!-- we're looking for image source=3D"filename" / -- there
are =
actually lots of other attributes but I've removed the code for them =
from what follows --
xsl:template match=3D"image"
xsl:variable name=3D"ifile"
xsl:textsrc/images//xsl:text xsl:value-of =
select=3D"@source"/xsl:text.jpg/xsl:text
/xsl:variable
fo:block space-before=3D"10pt" space-after=3D"10pt" =
text-align=3D"center"
fo:external-graphic scaling-method=3D"integer-pixels" =
src="">
xsl:attribute name=3D"width"
xsl:variable name=3D"imgt"
select=3D'imgsize:new($ifile)'/ =
!-- instantiate imgsize --
xsl:variable name=3D"img_width" select=3D'imgsize:getWidth( =
$imgt )'/ !-- call getwidth --
xsl:value-of select=3D'$img_width div $dpi'/in
!--convert =
the pixels to inches--
/xsl:attribute
/fo:external-graphic
/xsl:template
-
Original Message -
From:
Vaclav PEROUTKA
To:
[EMAIL PROTECTED]
Sent:
Monday, September 13, 2004 3:24 PM
Subject:
Re: How to write equations for FOP ?
John,
it would be nice to have it. Then I could use width and height in
percent to recompute the scale don't I ?
Anyway I am not sure if I am able to integrate it into FOP because I
started with XML and XSLT week ago what my colleagues did not finish...
Thanks,
Vasek
John Burgess wrote:
Vasek
By default fop assumes bitmaps are 72dpi so it will spread a 144x144 pixel
bitmap across 2 inches in width and height.
However, if you tell it the size you want
ie width="1cm" height="1cm"
then it will produce the bitmap at that size.
If your bitmaps are all of different sizes then I have written a java class
for use as an xslt extension that reads the bitmap and reports back the
width and height in pixels. I can submit the source code and the jar if
there's interest - I've only tested it with jpegs but it should work with
any bitmap type supported by the javax.imageio package. I believe there is
a plug in that will do GIFs though it's not part of the standard
distribution because of the lzw patent problem.
John
- Original Message -
From: "Vaclav PEROUTKA" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 13, 2004 2:17 PM
Subject: Re: How to write equations for FOP ?
Hi Pascal,
thanks for an answer but I am not sure if it solves my problem. It still
generates GIF images with resolution of 72dpi. And for this resolution I
see pixels - formulas are very rough. For SVG it looks it is only the
bitmap wrapper, isn't it ?
Vasek
Pascal Sancho wrote:
I have found elsewhere that J.Pietschmann then Jeremias Maerki wrote
respectively following info about MATHML:
There is a FOP MathML extension using JEuclid in the CVS repository.
You can check it out (from the maintenance branch), build FOP and create
a servicec entry for the MathML element mapping (there should be a sample),
it should work then.
The MathML extension is in CVS HEAD under examples/mathml, not in the
maintenance branch. And it will probably take a bit to adjust it for FOP
0.20.5.
http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/mathml/
Pascal
-Message d'origine-
De : Pascal Sancho
Envoy : lundi 13 septembre 2004 14:47
: [EMAIL PROTECTED]
Objet : RE: How to write equations for FOP ?
Hi,
I think that a good way is to generate svg code embedded in a
fo:instream-foreign-object.
You can visit
http://xml.apache.org/fop/graphics.html#svg-pdf-graphics.
Pascal
-Message d'origine-
De : Vaclav PEROUTKA [mailto:[EMAIL PROTECTED]] Envoy
: lundi 13