Description
SVG images with either given dimensions or images with no given dimensions are not rendered with the right size. Reason for that is, that BatikSVGImage.parseLength does not handle double values nor handles css units.
Simple example:
<html` xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<title>Test</title>
</head>
<body>
<div id="content" class="content">
<div id="logo" style="margin-top:3mm;">
<img src="some_fancy.svg" alt="here comes the SVG" title="" />
</div>
<div id="main" style="font-size:15px;">Some text below the SVG</div>
</div>
</body>
</html>
The images is rendered correctly, but the space around the image is too big. The text should be exactly below the image and the image should be 3mm away from the top. You can find the following warning messages in the output after the rendering:
com.openhtmltopdf.general WARNING:: Invalid integer passed as dimension for SVG: 850.39px
com.openhtmltopdf.general WARNING:: Invalid integer passed as dimension for SVG: 183.035px
As mentioned I am using the BatikSVGDrawer from the openhtmltopdf-svg-support plugin.
Since I have already fixed this issue for my project I will make a pull request later if you like.