Hi
I just wanted to inform about an experience of mine. Maybe others can profit.
I have extracted the SVG group from a div rendered by MathJax and used it in another SVG diagram.
So far I have been downloading those SVG diagrams using
PHP and ImageMagick. Basically I send the SVG html code to a file containing the following:
<?php
$svg_data_as_string = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'.filter_input(INPUT_POST, 'svghtml');
$title = filter_input(INPUT_POST, 'svgtitle');
$image = new IMagick();
$image->setBackgroundColor(new ImagickPixel('transparent'));
$image->readImageBlob($svg_data_as_string);
$image->setImageFormat('png32');
$filename = $title.'.png';
header('Content-Type: application/png');
header("Content-Disposition: attachment; filename=\"$filename\"");
echo $image;
This worked fine so far. However none of the MathJax was showing up on the so downloaded png file.
The culprit of this was that the MathJax group contained attributes
fill and
stroke both set to
currentColor. Removal of these attributes solved the problem.
Best,
Daniel