Highcharts exports "invalid" svg
I'm attempting to print SVG charts exported from HighCharts using the SDL product XPP which is an automated page composition engine. XPP is refusing to render the SVG graphics due to errors in the SVG files. I quote from their support team:
The problem with the SVG image that was sent to us is that it did not comply with our requirements in support of SVG images,
On page 16-26 of the Managing XPP manual, we state:
SVG Document Structure
An SVG document must have XML and document type declarations. A document or document fragment must have an root element. The root element must define the svg namespace, and can contain text, shapes,and paths.
What we have found in the SVG image provided, is there is no XML doc type declaration as required.
As soon as I edited the SVG image, added such a doc type declaration, and saved it, when I opened the SVG image in XPP, it converted and displayed.
Would it be possible to have the Highcharts-Export server add the required XML and DTD declarations at the top of exported SVG files? I of course could add these in a post-processing step, but that does add complexity to our publishing pipeline.
On a possibly related note, I've found that the latest version of ImageMagick 6.8.5 also doesn't render the exported HighChart SVG correctly. Inkscape 0.48+ and various browsers (Chrome, Firefox, IE) seem OK with the files though.
Thanks
I'm not sure what the implications of this change could be really. But I've to admit that it sounds logical, to have the xml doc declaration at the start of the file. After all it's a FILE download.
In your case, this should be added;
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
I created an issue on GitHub for this
链接地址: http://www.djcxy.com/p/74446.html上一篇: 页面出错
下一篇: Highcharts出口“无效”svg