augui Posted September 24, 2009 Share Posted September 24, 2009 Hi,When i use "BatikRenderer.getInstance()" for svg file who don't have inline file that works fine.but when i need to show a svg image with inline file image :<image scaleImage="RealSize"> <reportElement x="102" y="0" width="188" height="234"/> <imageExpression class="net.sf.jasperreports.engine.JRRenderable"> <![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File("test.svg"))]]> </imageExpression></image>I have this ireport error message :The URI "data:image/png;base64, ... " on element <image> can't be opened because: URL data in unsupported format or corruptorg.apache.batik.bridge.BridgeException: null:0 The URI "data:image/png;base64, ..."on element <image> can't be opened because:URL data in unsupported format or corrupt at org.apache.batik.bridge.UserAgentAdapter.getBrokenLinkDocument(UserAgentAdapter.java:449) at org.apache.batik.bridge.SVGImageElementBridge.createRasterImageNode(SVGImageElementBridge.java:604) at org.apache.batik.bridge.SVGImageElementBridge.createImageGraphicsNode(SVGImageElementBridge.java:327) at org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(SVGImageElementBridge.java:177) at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:119) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213) at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219) at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219) at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171) at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82) at net.sf.jasperreports.renderers.BatikRenderer.ensureSvg(BatikRenderer.java:192) at net.sf.jasperreports.renderers.BatikRenderer.getDimension(BatikRenderer.java:141) at net.sf.jasperreports.engine.fill.JRFillImage.fitImage(JRFillImage.java:1138) at net.sf.jasperreports.engine.fill.JRFillImage.prepare(JRFillImage.java:1060) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:327) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:402) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:361) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1425) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:725) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:252) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:908) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:830) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:85) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:540) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:887) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)Print not filled. Try to use an EmptyDataSource...This is not a batik problem because i use the same svg file with batik 1.7 stand aloneand i don't have any problemBest Regards,Regis Augui Link to comment Share on other sites More sharing options...
sundari-experts Posted February 24, 2011 Share Posted February 24, 2011 Did you ever find a solution? Link to comment Share on other sites More sharing options...
augui Posted February 26, 2011 Author Share Posted February 26, 2011 Hi,No, I have a workaround:in jasperreports : src/net/sf/jasperreports/renderers/BatikRenderer.javaI replace the line (in ensureSvg) :// document = documentFactory.createSVGDocument(null, document = documentFactory.createSVGDocument("file://",The report generator runs but when enlargingpng interior does not follow.It's not great but better than nothing ... Best Regards,Regis Augui Link to comment Share on other sites More sharing options...
cgoetz Posted October 22, 2012 Share Posted October 22, 2012 The error can be resolved by adding batik-codec.jar to the classpath...http://mvnrepository.com/artifact/org.apache.xmlgraphics/batik-codec Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now