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

Free Support Forum - aspose.com

Is is possible to reduce the amount of spans?


I use following code to create an HTML fine. The result looks very fine but
is it possible to reduce the amount of spans ? It has 11k spans inside

Here my example:

Document docBR = new Document(@"Annual Financial Report_V9.docx");
Encoding encoding = new UTF8Encoding(true);

string cssPrefix2 = "dm";
HtmlFixedSaveOptions saveOptionsFixed2 = new HtmlFixedSaveOptions();
saveOptionsFixed2.Encoding = encoding;
saveOptionsFixed2.CssClassNamesPrefix = cssPrefix2;

saveOptionsFixed2.ExportEmbeddedFonts = false;
saveOptionsFixed2.ExportEmbeddedImages = false;
saveOptionsFixed2.ExportEmbeddedSvg = false;
saveOptionsFixed2.FontFormat = ExportFontFormat.Ttf;

saveOptionsFixed2.PrettyFormat = true;

saveOptionsFixed2.ExportEmbeddedCss = true;
docBR.Save("html/output.html", saveOptionsFixed2);

Annual Financial Report_V9.zip (597.1 KB)

Kind regards,

@Nachti Unfortunately, there is no way to reduce the number of spans when you export to FixedHtml format. This is a fixed page format and it’s model is more like XPS or PDF, i.e. each part of text has it’s own coordinates and is represented as a separate span.