html2pdf
html2pdf copied to clipboard
SVG path preparation for Inkscape files
When saving optimized Inkscape SVGs, it concatenates numbers only separated by a minus sign. So instead of
M 13.464 -10.953
becomes
M13.464-10.953
In this case the converter will spit out dozens of error messages such as:
A non well formed numeric value encountered in .\vendor\spipu\html2pdf\src\CssConverter.php on line 57
However, by adding the below line to the Path.php (in the preparation section)
$path = preg_replace('/([0-9\.])([-])([0-9\.])/', '$1 $2$3', $path);
the issue can get solved.