public void ControlListLabelsExportToHtml(ExportListLabels howExportListLabels) { Document doc = new Document(MyDir + "Lists.PrintOutAllLists.doc"); HtmlSaveOptions saveOptions = new HtmlSaveOptions(SaveFormat.Html) { // 'ExportListLabels.Auto' - this option uses <ul> and <ol> tags are used for list label representation if it doesn't cause formatting loss, // otherwise HTML <p> tag is used. This is also the default value. // 'ExportListLabels.AsInlineText' - using this option the <p> tag is used for any list label representation. // 'ExportListLabels.ByHtmlTags' - The <ul> and <ol> tags are used for list label representation. Some formatting loss is possible. ExportListLabels = howExportListLabels }; doc.Save(ArtifactsDir + "Document.ExportListLabels.html", saveOptions); }
public void ControlListLabelsExport(ExportListLabels howExportListLabels) { Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Aspose.Words.Lists.List bulletedList = doc.Lists.Add(ListTemplate.BulletDefault); builder.ListFormat.List = bulletedList; builder.ParagraphFormat.LeftIndent = 72; builder.Writeln("Bulleted list item 1."); builder.Writeln("Bulleted list item 2."); builder.ParagraphFormat.ClearFormatting(); HtmlSaveOptions saveOptions = new HtmlSaveOptions(SaveFormat.Html) { // 'ExportListLabels.Auto' - this option uses <ul> and <ol> tags are used for list label representation if it doesn't cause formatting loss, // otherwise HTML <p> tag is used. This is also the default value // 'ExportListLabels.AsInlineText' - using this option the <p> tag is used for any list label representation // 'ExportListLabels.ByHtmlTags' - The <ul> and <ol> tags are used for list label representation. Some formatting loss is possible ExportListLabels = howExportListLabels }; doc.Save(ArtifactsDir + $"HtmlSaveOptions.ControlListLabelsExport.html", saveOptions); }