Closed ljadrbln closed 7 months ago
Hello,
We faced the same bug. The solution proposed by ljadrbln fixes the bug.
DomPDF is an excellent library and we hope that the definitive fix will be released soon :) .
Thank you for found a solution.
We can wait somes week for a perfect rendering, but an exception "Division by zero" create global problem in a application
So, I think i'll be great and save headache if you create quickly an hotfix release
Thank you for your great work
The issue appears to be caused by a path command defining an arc where one or both of the radii are zero. You can reproduce the error with the following simple example:
<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
<path d="M 25 25 a 5 0 5 0 0 50 50" stroke="orange" stroke-width="5" fill="none"/>
</svg>
Without a radius the arc is actually just a line. That makes for a simple solution to the issue, render a line instead of an arc.
Note that I would definitely not recommend using the suggested workaround. Changing a radius from 0 to .1 can have a significant impact on the rendering, as you can see when the radius in the above sample is changed.
<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
<path d="M 25 25 a 5 .1 5 0 0 50 50" stroke="orange" stroke-width="5" fill="none"/>
</svg>
Hello,
I have «Division by zero» error with next svg file:
The rough workaround is to modify arcToSegments function in the Svg\Surface\SurfaceInterface\Path:
But maybe more elegant solution exists?