Newbie: Problems with SVG

  • Thread starter =?ISO-8859-1?Q?Michael_Br=E4uer?=
  • Start date
?

=?ISO-8859-1?Q?Michael_Br=E4uer?=

Hi,

I'm a Newbie in using FOP. I wrote some simple XSL-FO Files and created
some nice PDFs. Now I want to embed a SVG in the XSL-FO file.
My XSL-FO:
<fo:instream-foreign-object>
<svg width="150" height="150" xmlns="http://www.w3.org/2000/svg">
<polygon points="10,10 50,50 100,10" stroke="red"
stroke-width="2"/>
</svg>
</fo:instream-foreign-object>

FOP stops with the following message:
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.batik.dom.AbstractAttr: method isReadonly()Z not found
atorg.apache.batik.dom.AbstractAttr.setNodeValue(AbstractAttr.java,
Compiled Code)
at
org.apache.batik.dom.AbstractAttr.setValue(AbstractAttr.java:177)
at
org.apache.batik.dom.svg.AbstractElement$ExtendedNamedNodeHashMap.setUnspecifiedAttribute(AbstractElement.java:238)
at
org.apache.batik.dom.svg.AbstractElement.setUnspecifiedAttribute(AbstractElement.java:149)
at
org.apache.batik.dom.svg.AttributeInitializer.resetAttribute(AttributeInitializer.java:94)
at
org.apache.batik.dom.svg.AttributeInitializer.initializeAttributes(AttributeInitializer.java,
Compiled Code)
at
org.apache.batik.dom.svg.AbstractElement.initializeAttributes(AbstractElement.java:115)
at
org.apache.batik.dom.svg.AbstractElement.<init>(AbstractElement.java:59)
at
org.apache.batik.dom.svg.SVGOMElement.<init>(SVGOMElement.java:72)
at
org.apache.batik.dom.svg.SVGStylableElement.<init>(SVGStylableElement.java:70)
at
org.apache.batik.dom.svg.SVGOMSVGElement.<init>(SVGOMSVGElement.java:103)
at
org.apache.batik.dom.svg.SVGDOMImplementation$SvgElementFactory.create(SVGDOMImplementation.java:1508)
at
org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(SVGDOMImplementation.java:255)
at
org.apache.batik.dom.svg.SVGOMDocument.createElementNS(SVGOMDocument.java:338)
at
org.apache.batik.dom.svg.SVGDOMImplementation.createDocument(SVGDOMImplementation.java:175)
at org.apache.fop.svg.SVGElement.init(SVGElement.java:255)
at org.apache.fop.svg.SVGElement.<init>(SVGElement.java:120)
at
org.apache.fop.svg.SVGElement$Maker.make(SVGElement.java:95)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:352)
at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at org.apache.fop.apps.Driver.render(Driver.java:498)
at
org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:106)
at org.apache.fop.apps.Fop.main(Fop.java:62)

With other graphics like gif or jpeg it worked well. So I think the
problem is the SVG.

My System: WINNT 4.0 (SP6), FOP0.20.5, JDK1.4

I think the Classpath in the fop.bat is correct:
@echo OFF

rem %~dp0 is the expanded pathname of the current script under NT
set LOCAL_FOP_HOME=
if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME=%~dp0

set LIBDIR=%LOCAL_FOP_HOME%lib
set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.2.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.4.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik.jar
set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-cvs-20020806.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar
java -cp "%LOCALCLASSPATH%" org.apache.fop.apps.Fop %1 %2 %3 %4 %5 %6
%7 %8

I tried to install an other version of batik, or the JRE, but it didn't
work.

I hope someone has an idea, I'm a Newbie with Java, too, so it's very
hard for me to follow the discussion on this board.

Hopefully
Michael Braeuer
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top