We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Possibility add alt text to images in converted html

In MS Word we have possibility to add alt text to images inside of the document (see attached image).


Could you please provide possibility to add alt text from Title and Description fields into tag in converted html (for example like attributes )?
Or if you already have such possibility, could you please provide some example how manage it?

Hi Vladyslav,


Thanks for your inquiry. In Word document to HTML conversion, currently Aspose.Words adds Description field text from Alt Text form to img tag as alt in HTML text. However, if it does not fulfill your requirement then please share your sample input Word document, output HTML and expected HTML here. It will help us to understand your requirements exactly and log the request in our issue tracking system accordingly.

<img src=“image.001.png” width=“41” height=“41” alt=“Radio Button”…


Best Regards,

Hello!

I added example of document with alt text (title, description) for first image, but in converted html there is no alt text description from word in alt attribute for image(see attacment).

I am using Aspose.Word 17.2

Hi Vladyslav,


Thanks for your feedback. We have tested the scenario using following code snippet and it is adding Description field text from Alt Text form successfully in HTML text. Please find attached the sample output for your reference.

However, we have noticed that you are using HtmlFixedSaveOptions for DOCX to HTML conversion. Please confirm whether suggested code fulfill your requirements, otherwise we will log a new feature request in our issue tracking system accordingly.

// Load the document from disk.<o:p></o:p>

Document doc = new Document(@"D:\Downloads\test (9)\test\RTag.docx");

HtmlSaveOptions options = new HtmlSaveOptions();

// HtmlSaveOptions.ExportRoundtripInformation property specifies

// Whether to write the roundtrip information when saving to HTML, MHTML or EPUB.

// Default value is true for HTML and false for MHTML and EPUB.

options.ExportRoundtripInformation = true;

doc.Save("E:/Data/Temp/ExportRoundtripInformation_out.html", options);


Best Regards,

Hello!


I am using fixed html with HtmlFixedSaveOptions for document conversion, and i can’t find ExportRoundtripInformation inside of HtmlFixedSaveOptions.

Could you please spesify which property i should use for fixed html?

Best regards

Hi Vladyslav,


Thanks for your feedback. Currently, Aspose.Words does not support to export Alt Text information in resultant HTML using HtmlFixed approach. We have logged an enhancement ticket WORDSNET-15196 in our issue tracking system for your requirement. We will notify you as soon as it is implemented.

Best Regards,

@vladpyshnenko,

The issues you have found earlier (filed as WORDSNET-15196) have been fixed in this Aspose.Words for .NET 17.8 update and this Aspose.Words for Java 17.8 update.