You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by m_dieu <an...@gmx.net> on 2007/11/20 09:10:53 UTC

how to embed svg to fop?

Hi everybody,

I'm tring to involve a generated svg into a fop-document. but i still get an
error.
The svg is created by JFreeChart like this:

JFreeChart chart = ChartFactory.createPieChart(
          getChartTitle(),			// chart title
          dataset,				// data
          false,				// include legend
          true,
          false
);
DOMImplementation domImpl= GenericDOMImplementation.getDOMImplementation();
Document document=domImpl.createDocument(null,"svg",null);
SVGGraphics2D svgGenrator=new SVGGraphics2D(document);
chart.draw(svgGenrator,new Rectangle2D.Double(0,0,400,300),null);
Writer writer=new OutputStreamWriter(new FileOutputStream(new
File("test.svg")),"UTF-8");
svgGenrator.stream(writer,true);

And my attempt to include this into a fop looks like this:

<fo:block>
        <fo:instream-foreign-object>
            <svg:svg width="170mm" height="130mm"
xmlns:xlink="http://www.w3.org/2000/svg">
                <svg:image width="170mm" height="130mm"
link:href="test.svg"/></svg:image>
            </svg:svg>
       </fo:instream-foreign-object>
</fo:block>

But when I wants to generate the pdf I get this error: [Fatal Error]
:1:32817: The prefix "svg" for element "svg:svg" is not bound.
System-ID unbekannt; Zeilennummer1; Spaltennummer32817;
org.xml.sax.SAXParseException: The prefix "svg" for element "svg:svg" is not
bound.

Can somebody help me?
Thanks in advance!
-- 
View this message in context: http://www.nabble.com/how-to-embed-svg-to-fop--tf4841833.html#a13852537
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: how to embed svg to fop?

Posted by m_dieu <an...@gmx.net>.
thanks for the hint...i'll try this out...


Andreas L Delmelle wrote:
> 
> On Nov 20, 2007, at 09:10, m_dieu wrote:
> 
> Hi
> 
>> <snip />
>> And my attempt to include this into a fop looks like this:
>>
>> <fo:block>
>>         <fo:instream-foreign-object>
>>             <svg:svg width="170mm" height="130mm"
>> xmlns:xlink="http://www.w3.org/2000/svg">
>         ^^^^^^
> 
> You might want to bind the SVG namespace to the svg: prefix. That  
> should solve the error below.
> 
>> <snip />
>> But when I wants to generate the pdf I get this error: [Fatal Error]
>> :1:32817: The prefix "svg" for element "svg:svg" is not bound.
>> System-ID unbekannt; Zeilennummer1; Spaltennummer32817;
>> org.xml.sax.SAXParseException: The prefix "svg" for element  
>> "svg:svg" is not
>> bound.
> 
> 
> HTH!
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-embed-svg-to-fop--tf4841833.html#a13853728
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: how to embed svg to fop?

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Nov 20, 2007, at 09:10, m_dieu wrote:

Hi

> <snip />
> And my attempt to include this into a fop looks like this:
>
> <fo:block>
>         <fo:instream-foreign-object>
>             <svg:svg width="170mm" height="130mm"
> xmlns:xlink="http://www.w3.org/2000/svg">
        ^^^^^^

You might want to bind the SVG namespace to the svg: prefix. That  
should solve the error below.

> <snip />
> But when I wants to generate the pdf I get this error: [Fatal Error]
> :1:32817: The prefix "svg" for element "svg:svg" is not bound.
> System-ID unbekannt; Zeilennummer1; Spaltennummer32817;
> org.xml.sax.SAXParseException: The prefix "svg" for element  
> "svg:svg" is not
> bound.


HTH!

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org