Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG rendering issues with batik-1.9 #99

Open
thekeenmonk opened this issue May 31, 2017 · 4 comments
Open

SVG rendering issues with batik-1.9 #99

thekeenmonk opened this issue May 31, 2017 · 4 comments

Comments

@thekeenmonk
Copy link

I found that the same SVG code that renders fine with batik 1.8 does not render properly with batik 1.9. No errors are visible in logs but the rendering is incomplete. I need to integrate with an existing project that uses batik-1.9 jars. Is there a known incompatibility with batik 1.9?

Output with batik-1.8 (correct):
screen shot 2017-05-31 at 5 01 19 pm

Output with batik-1.9 (incomplete):
screen shot 2017-05-31 at 5 01 27 pm

@danfickle
Copy link
Owner

Hi @ketanmpandya

The project hasn't been debugged with batik 1.9, although it looks like it could be a clipping problem. I'd suggest using the maven shade plugin to repackage batik in a custom svg-support pom. The closest I could come to find a guide on how to do this is at the below link.
https://www.elastic.co/blog/to-shade-or-not-to-shade

If you do get this working (or not), please let us know so others can learn. Good luck.

@rototor
Copy link
Contributor

rototor commented Jun 26, 2017

@ketanmpandya This is rather an issue with pdfbox-graphics2d than with openhtmltopdf, as the SVG rendering runs through pdfbox-graphics2d. I've opend an issue and will investigate whats going wrong here. A sample SVG file to reproduce the bug would awesome.

@rototor
Copy link
Contributor

rototor commented Jun 26, 2017

@ketanmpandya I can confirm that upgrading batik to 1.9 breaks the SVG rendering with pdfbox-graphics2d.

rototor added a commit to rototor/openhtmltopdf that referenced this issue Jun 26, 2017
…pgrade

Apache Batik to current version 1.9.
@rototor
Copy link
Contributor

rototor commented Jun 26, 2017

I've created the pull request #104 which fixes that bug. My PDFBox-Graphics2D adapter had a bug with getClip() and clip(Shape). I've released a fixed version 0.5. You can wait till @danfickle merges this pull request and releases a fixed version or you can just add this dependency to your project

<dependency>
	<groupId>de.rototor.pdfbox</groupId>
	<artifactId>graphics2d</artifactId>
	<version>0.5</version>
</dependency>

danfickle added a commit that referenced this issue Jun 28, 2017
#99 Upgrade PDFBox-Graphics2D to bugfixed version 0.5. And upgrade batik plus pdfbox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants