Hi,
We have Aspose.Total license and we are using Aspose v21.7.0 for converting HTML to DOCX and PDF document.
We have few SVG’s inside the html file which is getting converted as image when converting it to WORD or PDF which is great. But all the accessibility properties are ignored and the images are not accessible.
We have 4 issues related to SVG out of which we feel 3 issues are bug and 4th one is likely a question or requesting for recommendation
-
aria-hidden=“true” attribute is ignored and so the SVG / Images which we want to make it a decorative item is not achievable. Hence requesting you for an option to mark SVG’s and Images as decorative when converted from HTML.
-
By setting focusable=“false”, we expect it not to be focused while navigation, but still it is getting focus. May be solving above issue could implicitly solve this as well.
-
To make the SVG accessible, we are trying to provide the Title tag and still it is not applied as ALT text while generating the document.
-
This is more likely a question rather than reporting as an issue. Currently when we provide margin in style tag for SVG element, it works fine with browser. But when same HTML is generated as DOCX, this margin is not applied. This could also be a limitation with DOCX / PDF, but would like to know if their is a workaround.
Note: All these issues are applicable for HTML to PDF conversion as well.
This is also reproducible with the online web version of Aspose converter if that would be simple to reproduce: HTML To WORD Converter Free. HTML To WORD Online.
Here is the sample HTML file with which we were able to reproduce the issue: SVH Test.zip (446 Bytes)
Here is the screenshot of the word document which shows the Accessibility issue: SVG Accessability Issue.png (30.2 KB)
Here is the sample code which we are using to convert the HTML to WORD programatically:
// This is an abstract of what we have in code
var inputStream = /* Stream of the html */
var doc = new Aspose.Words.Document(inputStream, new LoadOptions { Encoding = Encoding.UTF8 });
var filename = /* some docx file name */
var stream = new MemoryStream();
var saveOptions = SaveOptions.CreateSaveOptions(filename);
doc.Save(stream, saveOptions);
// Now stream contains the document
I know you have been doing great in terms of prompt reply / support. Any help is greatly appreciated and thank you in advance for the same.