Hi,
Is there any option to achieve a word conversion to html without adding a margin-left & padding-left to the tag html <li> resulted from a numbering conversion ?
The code I’m using to proceed with that conversion is as follows :
AsposeWord aWord = new AsposeWord(templateName);
{
SyncfusionTemplateCompatibility = true
};
aWord.OfficeVersion = aWord.OfficeVersionIs2007 ? AsposeOfficeVersion.Office2007AndGreater : AsposeOfficeVersion.CompatibilityVersion;
aWord.Open(templateName);
//if we didn't find the CSS file, shoud be because the import was previous to the patch so we create it
MemoryStream outStream = new MemoryStream();
HtmlSaveOptions saveOptions = new HtmlSaveOptions(SaveFormat.Html)
{
ExportHeadersFootersMode = ExportHeadersFootersMode.None,
ImageSavingCallback = new HandleImageSaving(),
ExportImagesAsBase64 = true,
// Extract Word styles as CSS class. generate class for each BuiltIn style used and for each custom class (used or not)
CssStyleSheetType = CssStyleSheetType.Embedded,
ExportListLabels = ExportListLabels.ByHtmlTags
};
aWord.WordDocument.Save(outStream, saveOptions);
outStream.Position = 0;
string output = string.Empty;
using (StreamReader reader = new StreamReader(outStream))
{
output = reader.ReadToEnd();
}
outStream.Close();
As an attachment you can find the docx input and the html output.
I’m using Aspose Words: 21.4.0.0 for .net.
This is also reproducible via the online conversion : https://products.aspose.app/words/fr/conversion/word-to-html
NumberingFromWordToHtml.zip (771 Bytes)
Regards