From 3f9b3701b6dd2e842177e1b63f6153d4dbe81b93 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 9 Mar 2022 15:31:41 +0000 Subject: [PATCH] wip #5153 @0.75 --- inc/ws/Util/class.ws.pdf.convert.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/inc/ws/Util/class.ws.pdf.convert.php b/inc/ws/Util/class.ws.pdf.convert.php index 58f6333fc..e308f63cc 100644 --- a/inc/ws/Util/class.ws.pdf.convert.php +++ b/inc/ws/Util/class.ws.pdf.convert.php @@ -146,7 +146,6 @@ no-reuse-images } - public static function PDFToSVG($in, $page, $out, $textsOnly = true, $method = 'pdftocairo', $clean = true) { $tmp = CubeIT_Files::tempnam() . '.svg'; @@ -221,7 +220,16 @@ no-reuse-images } } } - file_put_contents($out, $svg->saveXML()); + $res = $svg->saveXML(); + $res = preg_replace('//', '', $res); + while (true) { + $res = preg_replace('/<\/g>/', '', $res, -1, $count); + if (!$count) { + break; + } + } + + file_put_contents($out, $res); } public static function makeShot($in, $out, $page, $prefix = '', $resolution = 72, $quality = 90, $antialiasing = 4, $method = 'PNM', $width = null, $height = null, $format = 'jpg') -- 2.39.5