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

Free Support Forum - aspose.com

Word Table column data truncating when Converting HTML to word document using Aspose.word

HI Team,
Table content last column hide while converting Html to Word using aspose.word .net

steps:
1.Convert word document to HTML
2.Convert HTML to Word document

’Below sample code we are using:

Aspose.Words.License license1 = new Aspose.Words.License();
license1.SetLicense(“Aspose.Total.lic”);
Aspose.Words.Document doc1 = new Aspose.Words.Document(@“D:\FileTest\Maindoc.docx”);
Aspose.Words.Saving.HtmlSaveOptions options = new Aspose.Words.Saving.HtmlSaveOptions(Aspose.Words.SaveFormat.Html);
options.ExportImagesAsBase64 = true;
options.ExportHeadersFootersMode = Aspose.Words.Saving.ExportHeadersFootersMode.None;
doc1.Save(@“D:\FileTest\Exe-514-Temp.html”, options);
Aspose.Words.Document doc2 = new Aspose.Words.Document(@“D:\FileTest\Exe-514-Temp.html”);
doc2.Save(@“D:\FileTest\HTMLTOWord.docx”, Aspose.Words.SaveFormat.Docx);

issue screen shot: Wordimage.png (87.4 KB)

sample Document: SampleDoc.zip (56.6 KB)

@thiru1711

Please use Table.AutoFit method as shown below to get the desired output.

Aspose.Words.Document doc2 = new Aspose.Words.Document(@"C:\SampleDoc\MainDoc.html");
foreach (Table table in doc2.GetChildNodes(NodeType.Table, true))
{
    table.AutoFit(AutoFitBehavior.AutoFitToWindow);
}
doc2.Save(@"C:\SampleDoc\MainDoc.html.docx", Aspose.Words.SaveFormat.Docx);