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

Free Support Forum - aspose.com

Text alignment missing in Doc to HTML conversion


We are using licensed version of aspose air. Latest Aspose Words version is used during conversion. Text alignment missing in Doc to HTML conversion for specific case. Following is the the code used during conversion.

Aspose.Words.Saving.SaveOptions docSaveOptions = new Aspose.Words.Saving.HtmlSaveOptions()
    SaveFormat = Aspose.Words.SaveFormat.Html,
    ExportHeadersFootersMode = ExportHeadersFootersMode.PerSection,
    ExportPageSetup = true,
    ExportRelativeFontSize = true,
    PrettyFormat = true,
    TableWidthOutputMode = HtmlElementSizeOutputMode.All,
    ImageSavingCallback = new HtmlImageExportCallback(),
    CssStyleSheetType = CssStyleSheetType.Inline

using (Stream inputBlobStream = dataStoreManager.Read(companyId, relativeDocBlobUri))
    Aspose.Words.Document doc = new Aspose.Words.Document(inputBlobStream);
    foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true))
        para.ParagraphBreakFont.HighlightColor = Color.Empty;

    doc.Save(localStorageHtmlFilePath, docSaveOptions); //Image File Format conversion

Attached is the word document which encounters issue during conversion and screenshot pointing its details.

Thank you!


Hi Abhijeet,

Thanks for your inquiry. Please note that Aspose.Words tries to mimic the same behavior as MS Word do. The text in your shared document starts with “Quarterly Report …” and “Transition Report Pursuant …” has text alignment as left. Please see the attached image for details.

The output HTML also have same text alignment. Hope this answers your query. Please let us know if you have any more queries.