HtmlSaveOptionsExportLanguageInformation Property

Specifies whether language information is exported to HTML, MHTML or EPUB. Default is false.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool ExportLanguageInformation { get; set; }

Property Value

Type: Boolean
Remarks

When this property is set to true Aspose.Words outputs lang HTML attribute on the document elements that specify language. This can be needed to preserve language related semantics.

Examples
Shows how to preserve language information when saving to .html.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Use the builder to write text in more than one language
builder.Font.LocaleId = 2057; // en-GB
builder.Writeln("Hello world!");

builder.Font.LocaleId = 1049; // ru-RU
builder.Write("Привет, мир!");

// Normally, when saving a document with more than one proofing language to .html,
// only the text content is preserved with no traces of any other languages
// Saving with a HtmlSaveOptions object with this flag set will add "lang" attributes to spans 
// in places where other proofing languages were used 
HtmlSaveOptions options = new HtmlSaveOptions
{
    ExportLanguageInformation = true,
    PrettyFormat = true
};

doc.Save(ArtifactsDir + "HtmlSaveOptions.ExportLanguageInformation.html", options);
See Also