Prevent Table Cutting from Left or Right Page Edges when Converting HTML to Word | C# .NET

Hi,

I am using Aspose.Words (20.11.0) to generate docx file from Html. In generated docx, the table is not aligned properly. (text cut off from the right). I am using the following snippet to autoFit the table.

table.AutoFit(AutoFitBehavior.AutoFitToWindow);

For your reference, I have attached both input and output files.
Please guide me how to fix this issue.

input.zip (7.9 KB)
Output.docx (18.1 KB)

@kainat123,

We tested the scenario and have managed to reproduce this problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-22725. We will further look into the details of this problem and will keep you updated here on the status of correction. We apologize for your inconvenience.

Hi,
Is there any update on this issue?

@kainat123,

WORDSNET-22725 is currently pending for analysis and is in the queue. We will inform you here as soon as this issue will get resolved or any further updates may be available in future.

Hi,
Can you tell me any expected timeline to resolve this issue? Thanks.

@kainat123,

Your issue is currently pending for analysis and is in the queue. The new monthly release of Aspose.Words is about to come out, and we are simply too busy in the new release which contains many other important issues. I am afraid, we can’t provide you any reliable estimate at the moment. After the new release, we are hopeful to schedule your issue for detailed investigation. We apologize for any inconvenience.

@kainat123,

Regarding WORDSNET-22725, we also suggest you to please save the document to a newer version of the DOCX format:

doc.Save("output.docx", new OoxmlSaveOptions { Compliance = OoxmlCompliance.Iso29500_2008_Transitional });

I have tried with this implementation but it did not work.

@kainat123,

We have logged these details in our issue tracking system and will keep you posted here on any further updates.

@kainat123,

Can you please provide a bit more information about the exact issue that you are currently observing on your end? So that we could analyze why the fix doesn’t work on your side and propose an alternate. Please create a standalone simplified Console Application (source code without compilation errors) that helps us to reproduce this problem on our end, compress it (along with the output document it produces) into ZIP format and attach the .zip file here for further testing. Please do not include Aspose.Words DLL files in it to reduce the file size.

However, the following code produces a document on our end with table that fits the page and is not cropped.

Document doc = new Document("input.htm");
doc.Save("out-iso29500.docx", new OoxmlSaveOptions { Compliance = OoxmlCompliance.Iso29500_2008_Transitional });

Please see this document that the above code produced on our end:

out-iso29500.docx (18.6 KB)

Its still not working on my end, can you please tell the version of Aspose you are using to convert this document?

@kainat123 The document attached by Awais was produced by Aspose.Words 21.10 version. We always test the issues on the latest versions of Aspose products because all fixes and improvements are published with new versions of products.

The issues you have found earlier (filed as WORDSNET-22725) have been fixed in this Aspose.Words for .NET 22.5 update also available on NuGet.