question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rendering SVG's from scripted backgroundImage-Property

See original GitHub issue

How 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:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
hvbtupcommented, Mar 16, 2022

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.

0reactions
more-vikrcommented, Apr 4, 2022

@more-vikr, can you test the builds from #866 to see if this fix works? Available here : https://github.com/eclipse/birt/actions/runs/1989569533

Hi @claesrosell, I just testend the build. The rendering of svg background definition now works as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add SVGs with CSS (background-image)
Let's look at how to add SVGs into the CSS property background-image and how the related background properties can transform the results.
Read more >
The Billion Ways to Display an SVG - KIRUPA
We are going to look at the variety of ways we have across HTML, CSS, and JavaScript for getting our SVGs to actually...
Read more >
How to serve SVG using C# so that it will render as a CSS ...
I have a server side script that generates an SVG output. ... and can confirm that normal SVG files render normally as a...
Read more >
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
Given the flexibility of SVG images, there's a lot to keep in mind when using them as background images with the background-image property, ......
Read more >
Cross-Site Scripting attacks via crafted SVG images | by Ax ...
Most websites are smart enough to display SVGs using the <img> tag, or CSS background-image property, rendering them useless. These techniques block execution ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found