html2pdf icon indicating copy to clipboard operation
html2pdf copied to clipboard

SVG path preparation for Inkscape files

Open CWBudde opened this issue 4 years ago • 0 comments

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.

CWBudde avatar Jan 10 '21 13:01 CWBudde