I’m trying to summarize it a bit and I added a zip-file containing 6 files
- Expected output as I see the chart in the latest IE11 version
- Input and output files used in code snippet using the SVGLoadOptions
- Input and output files used in code snippet using the HTMLFragment approach
- Desired output to generate with Aspose.PDF API
var loadopt = new SvgLoadOptions();
Document doc = new Document(File.Open(dataDir + "InputSvg.svg", FileMode.Open), loadopt);
doc.Save(dataDir + "OutputPdfSvgLoad.pdf");
This approach has the following issues
- The x-axis and right-handed y-axis is not drawn as expected on the pdf. The reason for that is, that IE seems to abbreviate a
<g transform="translate(38 0)"> to
<g transform="translate(38)"> which subsequently is interpreted by aspose.pdf as
<g transform="translate(38 38)">.
- Additionally. the gridlines do not appear correctly in the pdf. It seems as the style information is not regarded
string HTML = File.ReadAllText(dataDir + “InputSvg.txt”);
Document doc = new Document();
Page page = doc.Pages.Add();
HtmlFragment hf = new HtmlFragment(HTML);
page.PageInfo.Margin = new MarginInfo(0, 0, 0, 0);
doc.Save(dataDir + “OutputPdfHtml.pdf”);
It seems to me, that the quality is not the same as with the SVGLoadOptions approach. The differents fonts in the legends’ section seem to come from IE11.
I really fancy the SVGLoadOptions approach as this produces a nice Chart on the pdf. What I finally want to achieve is adding several SVG charts like the one attached to a page(s) and produce a report containing charts, text, shapes and images like in the file DesiredOutput.pdf. Do you think it’ll be possible to place SVG charts on a page with the SVGLoadOptions approach?
Another small question: I receive the svg-string from the client via AJAX and I’d like to read this string in a stream and use it in the SvgLoadOptions approach. Can you kindly let me know, how I need to adapt the code snippets in order to achieve that?
AsposeSvg.zip (386.4 KB)