HtmlSaveOptionsExportLanguageInformation Property |
Namespace: Aspose.Words.Saving
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.
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);