Skip to content

Commit 58289ee

Browse files
committed
Fix Rendering of SVG -> PDF issue
Fixes #767
1 parent 7a27012 commit 58289ee

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tcpdf.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23726,9 +23726,9 @@ protected function SVGPath($d, $style='') {
2372623726
}
2372723727
$params = array();
2372823728
if (isset($val[2])) {
23729-
// get curve parameters
23730-
preg_match_all('/-?\d*\.?\d+/', trim($val[2]), $matches);
23731-
$rawparams = $matches[0];
23729+
// get curve parameters, see https://github.com/tecnickcom/TCPDF/issues/767
23730+
$rawparams = preg_split('/([\,\s]+)/si', trim($val[2]));
23731+
$rawparams = array_filter($rawparams, fn ($p) => trim($p) != '');
2373223732
$params = array();
2373323733
foreach ($rawparams as $ck => $cp) {
2373423734
$params[$ck] = $this->getHTMLUnitToUnits($cp, 0, $this->svgunit, false);

0 commit comments

Comments
 (0)