Hi,

Have you tried the svg standalone though batik.
The exception is being thrown by batik. It looks like a problem where 
batik causes a class cast exception when an image cannot be found (ie. 
file:///m:/overlay.txt is wrong). The problem is that batik tries to load 
a broken image svg from within batik. When it tries to load this image it 
uses the default xml parser (which is wrong) and then cannot load it, so 
it uses a simple svg instead. In another part it gets a graphics hint from 
the image's object but java incorrectly returns an Object instead of null 
then the class cast exception occurs as it expects another type of object 
that is only with the brocken link image.

So the result is that batik was fixed to handle this better and FOP sets 
the default xml parser on batik. If I remember correctly this was in the 
last release.


On 2001.11.30 16:15 James Richardson wrote:
> 
> Hi,
> 
> The following svg file crashes out the PDF renderer.... I hand wrote the 
> file, so I dont know if is a bug in the XML. Adobe's plugin seems to 
> render it OK.
> 
> 
> 
> <?xml version="1.0" encoding="iso-8859-1"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" 
> "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd"; >
> <svg xml-space="preserve" preserveAspectRatio="xMaxYMaxmeet"
>      xmlns:svg="http://www.w3.org/2000/svg"; >
>   <defs>                           <pattern id="pattern" x="0" y="0" 
> patternUnits="userSpaceOnUse" width="185" height="200">
>       <g transform="rotate(45 100 15) translate(50 50)" >
>       <g fill="#000066" stroke="#000066">
>         <text x="0" y="33.75" font-family="Helvetica" 
> font-size="20">Pattern Fill</text>
>       </g>
>       </g>
>     </pattern>
>   </defs>
> 
>   <g id="overlay" opacity="0.50">
>     <rect x="0" y="0" width="900" height="470" fill="url(#pattern)" 
> stroke="black" stroke-width="0">
>   </g>
> </svg>
> 
> 
> Heres the FO
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root font-family="Univers" font-size="9pt" text-align="center" 
> xmlns:fo
> ="http://www.w3.org/1999/XSL/Format";>
> <fo:layout-master-set>
> <fo:simple-page-master margin-bottom="25pt" margin-left="100pt"
> margin-right="50pt" margin-top="75pt" master-name="simple" page-height
> ="210mm" page-width="297mm">
> <fo:region-body margin-bottom="50pt"/>
> <fo:region-after extent="25pt"/>
> </fo:simple-page-master>
> </fo:layout-master-set>
> 
> <fo:page-sequence master-name="simple">
> <fo:static-content flow-name="xsl-region-after">
> <fo:block font-size="7pt" text-align-last="center">
> <fo:page-number/>
> </fo:block>
> </fo:static-content>
> 
> <fo:flow flow-name="xsl-region-body">
> <fo:block>
> <fo:instream-foreign-object>
> <svg:svg height="150mm" width="250mm" xmlns:svg
> ="http://www.w3.org/2000/svg";>
> <svg:image height="478" transform
> ="scale(0.6)" width="1145" xlink:href="file:///m:/overlay.txt"/>
> </svg:svg>
> </fo:instream-foreign-object>
> </fo:block>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
> 
> 
> 
> 
> 
> org.apache.fop.apps.Fop svgtest.fo svgtest.pdf
> [INFO]: FOP 0.20.2
> [INFO]: building formatting object tree
> [INFO]: [1]
> [ERROR]: unknown font Univers,normal,normal so defaulted font to any
> [ERROR]: unknown font Univers,normal,normal so defaulted font to any
> [ERROR]: unknown font Univers,normal,normal so defaulted font to any
> [ERROR]: unknown font Univers,normal,normal so defaulted font to any
> [ERROR]: unknown font Univers,normal,normal so defaulted font to any
> [ERROR]: unknown font Univers,normal,normal so defaulted font to any
> [ERROR]: svg graphic could not be built: java.lang.Object
> java.lang.ClassCastException: java.lang.Object
>      at
> 
>org.apache.batik.bridge.SVGImageElementBridge.createRasterImageNode(SVGImageElementBridge.java:167)
>      at
> 
>org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:109)
>      at
> org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:167)
>      at
> org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:133)
>      at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:66)
>      at
> org.apache.fop.render.pdf.PDFRenderer.renderSVGDocument(PDFRenderer.java:413)
>      at
> org.apache.fop.render.pdf.PDFRenderer.renderSVGArea(PDFRenderer.java:382)
>      at org.apache.fop.svg.SVGArea.render(SVGArea.java:58)
>      at
> org.apache.fop.render.pdf.PDFRenderer.renderForeignObjectArea(PDFRenderer.java:366)
>      at
> org.apache.fop.layout.inline.ForeignObjectArea.render(ForeignObjectArea.java:50)
>      at
> org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:223)
>      at org.apache.fop.layout.LineArea.render(LineArea.java:162)
>      at
> org.apache.fop.render.AbstractRenderer.renderBlockArea(AbstractRenderer.java:192)
>      at org.apache.fop.layout.BlockArea.render(BlockArea.java:82)
>      at
> org.apache.fop.render.AbstractRenderer.renderAreaContainer(AbstractRenderer.java:158)
>      at org.apache.fop.layout.ColumnArea.render(ColumnArea.java:33)
>      at
> org.apache.fop.render.AbstractRenderer.renderSpanArea(AbstractRenderer.java:58)
>      at org.apache.fop.layout.SpanArea.render(SpanArea.java:53)
>      at
> 
>org.apache.fop.render.AbstractRenderer.renderBodyAreaContainer(AbstractRenderer.java:114)
>      at
> org.apache.fop.render.pdf.PDFRenderer.renderPage(PDFRenderer.java:728)
>      at 
> org.apache.fop.render.pdf.PDFRenderer.render(PDFRenderer.java:696)
>      at
> org.apache.fop.apps.StreamRenderer.queuePage(StreamRenderer.java:206)
>      at org.apache.fop.layout.AreaTree.addPage(AreaTree.java:81)
>      at
> org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:305)
>      at 
> org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:191)
>      at 
> org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:178)
>      at 
> org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1398)
>      at
> 
>org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1019)
>      at
> 
>org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1256)
>      at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
>      at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)
>      at org.apache.fop.apps.Driver.render(Driver.java:459)
>      at
> org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:72)
>      at org.apache.fop.apps.Fop.main(Fop.java:19)
> [INFO]: Parsing of document complete, stopping renderer
> 
> 
> 
> 
> Best Regards,
> 
> James
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 

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

Reply via email to