I'm having issues to export a SVG code to JPG with PHP and Imagick, because it contains the tag 'textpath'. The complete SVG is:
<svg id="svg_export" viewBox="0 0 800 533 " style=" pointer-events: none;">
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="533" version="1.1">
<svg id="svg-tree">
<svg id="tree_title">
<path id="path_title" d="M 282 478 q 120 20 240 0" stroke="blue" stroke-width="1" fill="none"></path>
<text class="tspan_title_tree" style="font-size: 20px; font-family: Times;">
<textPath id="text_title_svg" startOffset="50%" href="#path_title">Título</textPath>
</text>
</svg>
<svg id="cell_1" x="381" y="432" height="31" width="41">
<text id="text_cell_1" font-size="7" x="50%" alignment-baseline="middle" y="10.640625">
<tspan class="tspan_cell_tree" x="50%" dy="1.2em" font-family="Times" style="font-family: Times;">
Plain Text
</tspan>
</text>
</svg>
</svg>
</svg>
The code I am using to export the image is:
$im_cells = new \Imagick();
$im_cells->setBackgroundColor(new \ImagickPixel('transparent'));
$svg = $this->svgScale($this->svg, $width, $height);
$im_cells->readImageBlob($svg);
$im_cells->scaleImage($width, 0);
$im_cells->setImageFormat("png32");
$tree = new \Imagick($this->getBackgroundFile());
$tree->scaleImage($width, 0);
$result = new \Imagick();
$result->newImage($width, $height, new \ImagickPixel('red'), 'png');
$result->addImage($tree);
$result->addImage($im_cells);
$result = $result->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
$result->writeImage(base_path('orders/image.jpg"));
Once it is exported it only shows the curved line, without the text. I've read that imagick doesn't support this tag, so is there any way to do this?
I'd need to do it with this tool because in the process I overlay different layers, but if there are other ways please tell me, it will be helpful.
I've also tried to install Inkscape, but now any text is visible.
Thanks in advance!