Open echaconairlan opened 4 years ago
any news regarding this feature request ? Thanks in advance
I briefly looked at this today together with a collegae.
We found out that:
\PhpOffice\PhpWord\Writer\Word2007\Element\Chart
than to \PhpOffice\PhpWord\Writer\Word2007\Element\Image
.\PhpOffice\PhpWord\Element\Image::checkImage()
uses PHP image functions that don't work for SVG images, like getimagesizefromstring()
. image_type_to_mime_type()
, used to determine the mime type of the image, has no listing for SVG, see https://www.php.net/image_type_to_mime_type.getData()
method on a \PhpOffice\PhpWord\Shared\XMLWriter object you can get an idea about what Word XML gets produced. I temporarily added var_dump($xmlWriter->getData());die();
to \PhpOffice\PhpWord\Writer\Word2007\Element\Image::writeImage()
to see what was getting outputted.That's how far as we got today.
Todo:
\PhpOffice\PhpWord\Writer\Word2007\Element\Chart
could probably be used as a starting point for this class.$phpWord->addSvgImage()
.
Is there any workaround to add this support? I really need it for adding some highcharts graphs.