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

Free Support Forum - aspose.com

Table's width are changed after conversion from html to docx

Hi sirs,

I use Aspose.Words Convert html to docx file.

table’s width are changed after conversion from html to docx.

string htmlFile = @“d:\wda.html”;
string docxFile = @“d:\wda.docx”;
var doc = new Document(htmlFile);
doc.Save(docxFile);

attachments are the testing files.

thanks for your help.
Hi Rainmaker,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14434. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.
Hi Rainmaker,

Thanks for your patience. It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-14434) as 'Not a Bug'.

Please use following code example to get the desired output.

Document doc = new Aspose.Words.Document(MyDir + "wda.html");

OoxmlSaveOptions options = new OoxmlSaveOptions(SaveFormat.Docx);

options.Compliance = OoxmlCompliance.Iso29500_2008_Strict;

doc.Save(MyDir + "wda_out.docx", options);

Hi sir,

It’s worked.
I try to mark options.Complince = OxmlCompliance.Iso29500_2008_Strict;
It’s still worked.
Should i add OoxmlSaveOptions paramater in Document.Save Method every time?
Thank for your help.
Hi Rainmaker,

Thanks for your inquiry. You can use OoxmlSaveOptions class if you want to save document to Docx file format. OoxmlSaveOptions class can be used to specify additional options when saving a document into the Docx, Docm, Dotx, Dotm or FlatOpc format.

Hi tahir,

I got it. Thanks for your help.

Best Regards,
Rainmaker.
Hi Rainmaker,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.