Alternative Text is exported as Title and Alt properties of IMG tag | DOCX to HTML Conversion using .NET

Hello,

We’re using Aspose.Words .net version to convert from DOCX to HTML but are having trouble with accessibility in the converted document.

Whenever we use HtmlFixedSaveOptions to save out our DOCX as HTML we no longer get alt tags on some images. What’s interesting is that we don’t see the same behavior in the .Net Core version of Aspose.Words.

An example of what we’re seeing follows. Using the same docx file (attached - a11y.zip (160.8 KB)), we get different outputs:

Aspose Words 20.12 on .Net Framework:

   <div class="awdiv" title="Alt test">
      <img class="awimg" style="left:0pt; top:0pt; width:451.3pt; height:584.05pt;" src="data:image/png;base64, /bt+e…..”/>
   </div>

Aspose Words 20.12 on .Net Core:

 <img class="awimg" style="left:0pt; top:0pt; width:451.3pt; height:584.05pt;" src="data:image/png;base64,iVBORw0KGgoAAAANSU…” alt="Alt test" />

Both simply run the code below against the 20.12 version of Aspose.Words from nuget.

                 Document doc = new Document(File.OpenRead("a11y.docx"));

                 HtmlFixedSaveOptions saveOptions = new HtmlFixedSaveOptions
                 {
                       ExportEmbeddedCss = true,
                       ExportEmbeddedFonts = true,
                       ExportEmbeddedImages = true,
                       ExportEmbeddedSvg = true
                 };

                 doc.Save("out.html", saveOptions);

Our main aim is to get the alt tag reliably – if you know of a workaround that would get this working in 20.12.0 standard framework version we’d appreciate it!

Thanks,

Barry McHoull

@BMFirefinch

We have logged this problem in our issue tracking system as WORDSNET-21584. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.