Rendering SVG's from scripted backgroundImage-Property
See original GitHub issueHow is it possible to output an SVG file rendered into PDF when the backgroundImage-Property is assigned in OnCreate-Script?
The Image-Item works with embedded and external resources, but this is not a good option for us, because we have to change many big reports.
Steps to reproduce:
Using runtime org.eclipse.birt.runtime_4.9.0-20220308
• Create an empty report with a grid item.
• Optional: Add a report variable “X” with contains the <PATH TO YOUR SVG>
• In the OnCreate-Script of the Grid-Cell put following line:
this.getStyle().backgroundImage="<PATH-TO-YOUR-SVG>";
Replace <PATH-TO-YOUR-SVG>
with your own SVG file.
Optional: this.getStyle().backgroundImage=vars["X"];
• Run the report
Comment:
In the old runtime org.eclipse.birt.runtime_4.3.2.v20140225-1404 which runs on JRE8 it all worked fine. I read that from Java11 and upwards SVG rendering is not 100% compatible with the actual BIRT runtime. Also there may be a relation with #805 ?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (8 by maintainers)
Top GitHub Comments
You are right. I’m too busy to be really focused, it seems. Some text with OSGI catched my eye, so I thought you fixed only the OSGI runtime. But looking at your commit more closely, you added it to the POJO runtime as well (and the artifact contains the expected JAR file in ReportEngine/lib.
About the different runtimes: AFAIK the code base is exactly the same. The difference seems to be just a single environment variable (BIRT_HOME IIRC), which is used to decide in the code to switch to OSGI mode or not. And the layout of the libraries is different.
Hi @claesrosell, I just testend the build. The rendering of svg background definition now works as expected.