How to include svg for user with jasper report library, run from java

0

I am trying to include an svg image into a jasper report.  I thought it would be simple

Jasper Report Library Version 6.3 and version 6.11

I wanted to load off the classpath as a strream but getting different errors

 

    parameters.put("Image", loadImageAsStream("com/services/reportgencore/api/fincalc/primerica-color-logo.svg"));
            

            parameters.put("Image", loadImageAsBatikRenderer("com/services/reportgencore/api/fincalc/primerica-color-logo.svg"));
            
            Caused by: java.lang.ClassCastException: net.sf.jasperreports.renderers.BatikRenderer cannot be cast to java.awt.Image
    at mobileFna_1596548402682_188567.evaluate(mobileFna_1596548402682_188567:348

import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.renderers.BatikRenderer;

How can I load a SVG in this approach?

Also, loading to the correct size with stretching

berlin.brown's picture
Joined: Feb 12 2019 - 10:18am
Last seen: 1 month 2 weeks ago

0 Answers:

No answers yet
Feedback
randomness