embedded SVG in FO

Discussion in 'XML' started by jehanzeb.hameed@gmail.com, Apr 5, 2005.

  1. Guest

    Hello

    I am trying to draw a horizontal line in xsl-fo using svg. However, the
    line appears a few units below the place where I want it to be. For
    example in the following code, the line is drawn around 43mm from the
    top, instead of at 40mm.

    <fo:block-container position="absolute" left="10mm" top="40mm"
    width="20.001mm"
    height="0.169mm">
    <fo:block>
    <fo:instream-foreign-object content-width="20.001mm"
    content-height="0.169mm">
    <svg width="20.001mm" height="0.169mm">
    <line x1="20.001mm" y1="0.085mm" x2="0.000mm" y2="0.085mm"
    stroke-width="0.169mm" fill="none" stroke="rgb(0,0,0)"/>
    </svg>
    </fo:instream-foreign-object>
    </fo:block>
    </fo:block-container>

    Zeb
     
    , Apr 5, 2005
    #1
    1. Advertisements

  2. Your problem is in the line stacking. XSL-FO formatter stack all
    inline elements (fo:instream-foreign-object is inline-level element)
    into lines. Minimal line height is controled by several attributes
    such as line-height, line-stacking-strategy and etc. And, typically,
    for 10pt font minimal line height is 12pt or so. Thus, your SVG is
    placed to the bottom of the line and it is lower than expected. To
    avoid this you should specify font-size="0pt" and line-height="0pt".

    I suggest using freeware Altsoft XSL-FO Debugger
    (http://alt-soft.com/products_xsl-fo_debugger.jsp) to analyze your
    output and find what causes unexpected spaces. It can paint line and
    formatting objects bounding boxes. So you can see the structure of
    your file.


    Best regards,
    Altsoft Xml2PDF Team
    http://alt-soft.com/products_xml2pdf.jsp



    wrote in message news:<>...
    > Hello
    >
    > I am trying to draw a horizontal line in xsl-fo using svg. However, the
    > line appears a few units below the place where I want it to be. For
    > example in the following code, the line is drawn around 43mm from the
    > top, instead of at 40mm.
    >
    > <fo:block-container position="absolute" left="10mm" top="40mm"
    > width="20.001mm"
    > height="0.169mm">
    > <fo:block>
    > <fo:instream-foreign-object content-width="20.001mm"
    > content-height="0.169mm">
    > <svg width="20.001mm" height="0.169mm">
    > <line x1="20.001mm" y1="0.085mm" x2="0.000mm" y2="0.085mm"
    > stroke-width="0.169mm" fill="none" stroke="rgb(0,0,0)"/>
    > </svg>
    > </fo:instream-foreign-object>
    > </fo:block>
    > </fo:block-container>
    >
    > Zeb
     
    Altsoft Xml2PDF, Apr 14, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. saggmannen

    encoding in embedded svg in FOP

    saggmannen, Dec 13, 2003, in forum: XML
    Replies:
    0
    Views:
    579
    saggmannen
    Dec 13, 2003
  2. Pretty woman
    Replies:
    0
    Views:
    738
    Pretty woman
    Dec 17, 2003
  3. Arne Nordmann
    Replies:
    0
    Views:
    687
    Arne Nordmann
    Jun 28, 2004
  4. Mardagg
    Replies:
    0
    Views:
    1,002
    Mardagg
    May 12, 2006
  5. Mardagg
    Replies:
    0
    Views:
    852
    Mardagg
    May 12, 2006
  6. milof83

    svg to svg saving problem

    milof83, Aug 18, 2006, in forum: Java
    Replies:
    1
    Views:
    1,175
    Roland de Ruiter
    Aug 18, 2006
  7. Williams, Chris

    Problem with Rails and embedded SVG?

    Williams, Chris, Dec 2, 2004, in forum: Ruby
    Replies:
    2
    Views:
    178
    Florian Gross
    Dec 2, 2004
  8. Julius Mong

    Print an embedded SVG

    Julius Mong, Apr 12, 2004, in forum: Javascript
    Replies:
    0
    Views:
    121
    Julius Mong
    Apr 12, 2004
Loading...