Open bomb12138 opened 4 years ago
If it shows in a browser correctly, it is probably a bug. @rototor might be able to help, but I think he is pretty busy.
That's likely a bug in Apache Batik, some missing .dispose() call on a child Graphics2D. You can call createGraphics() on a Graphics2D object, to obtain a "child" Graphics2D, in which you can change all states without affecting the parent. You should dispose() it after using it. Especially in the PdfBoxGraphics2D adapter this is important, as it's required to correctly manage the save/restore state in the PDF stream. If the PdfBoxGraphics2D adapter would not throw this exception you would have an invalid PDF stream... (i.e. Acrobat might refuse to render it...)
What Batik version are you using? 1.12? Or the new released 1.13?
I assume that this will make no difference, but you could try anyway. I'll try to look into this, but I can not say when I find time...
Now i use the 1.12.thanks.I'll try what you say.
Finally i have solved the problem.I find that it can work if i just remove the opacity setting.So setting the opacity to 1 and the fill-opacity to 0.4 can resolve.This way just bypasses the bug and it still exists.
This is a bug in Batik, I've opened an issue there (https://issues.apache.org/jira/browse/BATIK-1290)
I try to remove the clip-path or style in the path tag and it can work completely.Is this a bug or my problem?