Hi all,
I have been embedding svg inside html macro like this:
{{html}}
<svg ...>
...
</svg>
{{/html}}
and usually I can convert the resulting page to PDF without any problem.
However if I use *xmln:href* in the svg, the PDF converter throws an error
and renders a blank PDF.
Here's an example svg:
https://jsfiddle.net/9dt5guab/1/
Here's the stack trace:
ERROR o.a.f.a.FOUserAgent - SVG graphic could not be built.
Reason: org.apache.batik.bridge.BridgeException: file:/opt/web/base/./:-1
The attribute "xlink:href" of the element <use> is required
org.apache.batik.bridge.BridgeException: file:/opt/web/base/./:-1
The attribute "xlink:href" of the element <use> is required
at
org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(Unknown
Source)
at
org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(Unknown
Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
at
org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:104)
at
org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
at
org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
at
org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
at
org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingDocument(AbstractIFPainter.java:319)
at
org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:286)
at
org.apache.fop.render.intermediate.IFRenderer.renderForeignObject(IFRenderer.java:1314)
at
org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:862)
at
org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:832)
at
org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:864)
at
org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:715)
at
org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:928)
at
org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
at
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at
org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:457)
at
org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:785)
at
org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:434)
at
org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:358)
at
org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:305)
at
org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:739)
at
org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:270)
at
org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:243)
at
org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)
at
org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
at
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:315)
at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:216)
at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:140)
at
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
at
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
at
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(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.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at
com.xpn.xwiki.pdf.impl.PdfExportImpl.renderXSLFO(PdfExportImpl.java:357)
at
com.xpn.xwiki.pdf.impl.PdfExportImpl.exportXHTML(PdfExportImpl.java:304)
at
com.xpn.xwiki.pdf.impl.PdfExportImpl.exportHtml(PdfExportImpl.java:257)
at
com.xpn.xwiki.pdf.impl.PdfExportImpl.export(PdfExportImpl.java:243)
at com.xpn.xwiki.web.ExportAction.export(ExportAction.java:239)
at com.xpn.xwiki.web.ExportAction.render(ExportAction.java:81)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:432)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:193)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:115)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at
org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:137)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:523)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at
org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:202)
at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at
org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:745)
I guess this is a problem with the converting library. Any help?