Two adjacent tables in word output do not show up properly but shows up ok in pdf

Hi,
Attached is a copy of the word and pdf output. If you take a look at page 4 in the word output, you will notice that the first table under the item “3.” is not showing up properly. The second set of tables under item “4.” have a space in between them and they show up ok. In pdf output, everything works fine. I am using Aspose.Words 6.3.0.0 and Aspose.Pdf 4.0.0.2.
Thank you.

Hi

Thanks for your request. Please attach your source document and show me the code that will allow me to generate the same document on my side. I will investigate the issue and provide you more information.
In addition, we just released Aspose.Words 6.4.0. you can download it from here:
https://releases.aspose.com/words/net
Best regards.

Hi,
I have attached the source html that we are using. We just basically insert the html into the DocumentBuilder. I have already attached the broken output .doc file and its corresponding pdf file in the attachment labeled “wi.zip”. If you need anything else, please let me know.
Thanks

Thank you for additional information. I used the following code for testing and the output document looks fine.

// Read HTML string
string html = File.ReadAllText(@"Test144\SourceHtml.htm");
// Create empty document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert HTML
builder.InsertHtml(html);
// Save document
doc.Save(@"Test144\out.doc");

Could you please provide me your code? I see you inserted this snippet of HTML into a table cell. Do you generate this table programmatically or you have some template?
Best regards.

Hi,
I have attached some sample code that seems to produce the same word/pdf results. I tried the new version of Aspose.Words, and it seems to produce the same results.
Thanks.

Hi

Thank you for additional information. There are a lot of unnecessary things in your code. I cleared it and not all works fine:

// Read HTML string
string html = File.ReadAllText(@"Test144\SourceHtml.htm");
// Create empty document
Aspose.Words.Document doc = new Aspose.Words.Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.RowFormat.AllowBreakAcrossPages = true;
builder.StartTable();
builder.InsertCell();
builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Top;
builder.CellFormat.Width = 26;
builder.InsertCell();
builder.CellFormat.ClearFormatting();
builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Top;
builder.CellFormat.Width = 468 - 26;
// Insert HTML
builder.InsertHtml(html);
builder.EndRow();
builder.EndTable();
// Save document
doc.Save(@"Test144\out.doc");
doc.SaveToPdf(@"Test144\out.pdf");

Hope this helps.
Best regards.

Hi,
The sample that I provided was meant to only show that the problem existed. I basically stepped through the code and pasted whatever it came across while taking out some of the lines of code that required some of our own objects. Anyways, I tried out the code that you supplied, and I believe that the root of the problem is still present. If you take a look at the pdf and doc outputs, you will notice that in the doc outputs, the columns for the two tables are lined up perfectly while the pdf does not. So, it looks like word is treating two independent tables as just one table. When I move the column border of one table, the other corresponding column border of the other table moves as well.
In the original output that I supplied, you will notice that the second table extends the same distance as the first column of the first table. I am guessing that this is just a variant of the root problem.
Plese let me know if you need anything else from me.
Thanks.

Hi John,

Thank you for additional information. Yes, you are right – two separate table are treated as a single table. This is the issue #1160 in our defect database. I will notify you as soon as it is fixed.
As a possible workaround, you can try putting one paragraph between tables.
Best regards,

The issues you have found earlier (filed as WORDSNET-792) have been fixed in this .NET update and in this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.