xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommy Reynolds <Tommy.Reyno...@MegaCoder.com>
Subject Help with external SVG graphic
Date Fri, 01 Apr 2005 01:15:19 GMT
I have an XSL-FO snippet:

<fo:block xmlns:xlink="http://www.w3.org/1999/xlink" space-after="14pt">
	<fo:external-graphic src="syscall.svg" left="6pt" right="6pt" 
		width="4in" height="1.6in" />
</fo:block>

with this SVG file:

<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
              "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
          <!ENTITY  bgColor "rgb( 19, 67, 97 )"                       >
          <!ENTITY  fgColor "rgb( 198, 173, 39 )"                     >
          <!ENTITY  canvas  "white"                                   >
]>
<svg viewBox="0 0 725 250" xmlns="http://www.w3.org/2000/svg" version="1.1">
  <title>System Calls</title>
  <desc>Us versus them.</desc>
  <defs>
    <path d="M 0,0 l 25,-10 0,20 z" fill="&fgColor;" id="arrowhead"/>
    <path id="arc" d="m 0,0 a 250,250, 0 0 1 200,0"/>
    <path id="darc" d="m 0,0 a 250,250 0 0 0 200,0"/>
  </defs>
  <!-- background canvas outline    -->
  <path d="M 0,0 l 725,0 0,250 -725,0 z" fill="&canvas;" stroke="none"/>

  <!-- content -->
  <g fill="none" stroke="&fgColor;" stroke-width="4">
    <path d="M 1,1 l 250,0 0,200 -250,0 z" />
    <path d="M 450,1 l 250,0 0,200 -250,0 z" />
    <use xlink:href="#arc" transform="translate( 250, 50 )"/>
    <use xlink:href="#arrowhead" transform="translate( 450,50 ) rotate( 200 )"/>
    <use xlink:href="#darc" transform="translate( 250, 75 )"/>
    <use xlink:href="#arrowhead" transform="translate( 250,70 ) rotate( 30 )"/>
    <use xlink:href="#darc" transform="translate( 250, 180 )"/>
    <use xlink:href="#arrowhead" transform="translate( 250,175 ) rotate( 30 )"/>
  </g>
  <g font-family="&apos;Courier New&apos;, Courier, Verdana, Helvetica, sans-serif"
font-size="64" fill="&fgColor;" stroke="&fgColor;" stroke-width="0.5">
    <text text-anchor="middle" x="120" y="120">APP</text>
    <text text-anchor="middle" x="575" y="120">KERNEL</text>
  </g>
  <g fill="&fgColor;" font-family="Courier New, Courier, Verdana" font-size="32" stroke="&fgColor;"
stroke-width="0.5">
    <text transform="translate( 250, 40 )">
      <textPath xlink:href="#arc" startOffset="18%">
      SYSCALL
      </textPath>
    </text>
    <text transform="translate( 250, 110 )">
      <textPath xlink:href="#darc" startOffset="20%">
        Return
      </textPath>
    </text>
    <text transform="translate( 250, 210 )">
      <textPath xlink:href="#darc" startOffset="25%">
        Signal
      </textPath>
    </text>
  </g>
</svg>

The problem is that FOP renders this as an extremely tiny graphic.  If I try to import the
.PNG version of this (rendered by either batik or rsvg) the bounding box is square instead
of having the aspect ratio of the real graphic.

Can anybody suggest how to fix either the SVG or PNG import using FOP?

Thanks!

Mime
View raw message