Re: How to write equations for FOP ?

2004-09-14 Thread Vaclav PEROUTKA




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




  

RE: How to write equations for FOP ?

2004-09-13 Thread Pascal Sancho
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 septembre 2004 14:24
 À : [EMAIL PROTECTED]
 Objet : How to write equations for FOP ?
 
 Hello list,
 
 I would like to know how can I use FOP with math equations 
 correctly. I currently process equations in LaTeX and insert 
 images but FOP has 72dpi resolution. For PDF documents it is 
 useless. How can I set at least 300dpi resolution or is there 
 any better approach to generate equations in XML ?
 
 Thanks,
 Vasek
 
 -
 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]



RE: How to write equations for FOP ?

2004-09-13 Thread Pascal Sancho
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 
  septembre 2004 14:24 À : [EMAIL PROTECTED] Objet : 
 How to write 
  equations for FOP ?
  
  Hello list,
  
  I would like to know how can I use FOP with math equations 
 correctly. 
  I currently process equations in LaTeX and insert images 
 but FOP has 
  72dpi resolution. For PDF documents it is useless. How can I set at 
  least 300dpi resolution or is there any better approach to generate 
  equations in XML ?
  
  Thanks,
  Vasek
  
  
 -
  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]
 
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to write equations for FOP ?

2004-09-13 Thread Vaclav PEROUTKA
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 
   

septembre 2004 14:24 À : [EMAIL PROTECTED] Objet : 
 

How to write 
   

equations for FOP ?
Hello list,
I would like to know how can I use FOP with math equations 
 

correctly. 
   

I currently process equations in LaTeX and insert images 
 

but FOP has 
   

72dpi resolution. For PDF documents it is useless. How can I set at 
least 300dpi resolution or is there any better approach to generate 
equations in XML ?

Thanks,
Vasek
 

 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to write equations for FOP ?

2004-09-13 Thread John Burgess
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
 
 
 septembre 2004 14:24 À : [EMAIL PROTECTED] Objet :
 
 
 How to write
 
 
 equations for FOP ?
 
 Hello list,
 
 I would like to know how can I use FOP with math equations
 
 
 correctly.
 
 
 I currently process equations in LaTeX and insert images
 
 
 but FOP has
 
 
 72dpi resolution. For PDF documents it is useless. How can I set at
 least 300dpi resolution or is there any better approach to generate
 equations in XML ?
 
 Thanks,
 Vasek
 
 
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.747 / Virus Database: 499 - Release Date: 08/09/04



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to write equations for FOP ?

2004-09-13 Thread Clay Leeds
On Sep 13, 2004, at 7:12 AM, John Burgess wrote:
snip
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
This looks like the kind of thing that would fit nicely with the new 
Objects for Formatting Objects[1] SourceForge project started by Simon 
Pepping. Perhaps you can contact him directly about adding it to the 
project (assuming you're willing to meet the licensing needs and/or 
donate it to the Apache Software Foundation).

Web Maestro Clay
[1]
http://offo.sourceforge.net/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to write equations for FOP ?

2004-09-13 Thread John Burgess
I'll get in touch with him.  I've no problems licensing wise, but I'd like
to do things like add a few comments etc before too many people see it.

I'm surprised it doesn't exist already - I couldn't find anything when I
searched before writing this, but had a horrible feeling all the time that I
must be re-inventing the wheel.

- Original Message -
From: Clay Leeds [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 13, 2004 4:45 PM
Subject: Re: How to write equations for FOP ?


 On Sep 13, 2004, at 7:12 AM, John Burgess wrote:

 snip

  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

 This looks like the kind of thing that would fit nicely with the new
 Objects for Formatting Objects[1] SourceForge project started by Simon
 Pepping. Perhaps you can contact him directly about adding it to the
 project (assuming you're willing to meet the licensing needs and/or
 donate it to the Apache Software Foundation).

 Web Maestro Clay

 [1]
 http://offo.sourceforge.net/


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.747 / Virus Database: 499 - Release Date: 08/09/04



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]