Issue with Table borders after Aspose Migration from 21.12.0 to 25.4.0

  1. I have an table HTML as “tableContent”.
  2. And the table is inserted to the Aspose word document.
  3. Builder.InsertHtml(tableContent, false);
  4. Word is converted to PDF

The table borders for the merged cell were not produced with Aspose version 21.12.

But the borders of merged cells are not properly handled with Aspose version 25.4.0

Can you please let us know if this is an known issue or if there is a workaround to fix this on our side?

Attaching the input html and output pdf in aspose versions 25.4 and 21.12
MegedCell Border Issue.zip (127.3 KB)

@MonishaRaja

It seems that you are experiencing issues with table borders after migrating from Aspose version 21.12.0 to 25.4.0. Specifically, the borders for merged cells are not being rendered correctly in the newer version.

To address this issue, you can try the following steps:

  1. Check Table Formatting: Ensure that the table formatting is correctly set in your code. You can apply borders explicitly to the table and its cells using the SetBorders method. For example:

    Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
    table.ClearBorders(); // Clear existing borders
    table.SetBorders(LineStyle.Single, 1.5, Color.Black); // Set borders for the entire table
    
  2. Cell Formatting: If you have specific cells that need different border settings, you can set the borders for those cells individually:

    Cell cell = table.Rows[0].Cells[0];
    cell.CellFormat.Borders.LineStyle = LineStyle.Single;
    cell.CellFormat.Borders.Color = Color.Black;
    
  3. Merged Cells: For merged cells, ensure that you are correctly setting the HorizontalMerge and VerticalMerge properties. For example:

    Cell cell1 = table.Rows[0].Cells[0];
    Cell cell2 = table.Rows[0].Cells[1];
    cell1.CellFormat.HorizontalMerge = CellMerge.First; // First cell in the merge
    cell2.CellFormat.HorizontalMerge = CellMerge.Previous; // Merged with the previous cell
    
  4. Testing with Different Versions: If the issue persists, consider testing with a different version of Aspose to see if the problem is specific to version 25.4.0. Sometimes, changes in the library can affect how certain features are rendered.

  5. Review Documentation: It may also be helpful to review the Aspose documentation regarding table formatting and borders to ensure that you are using the latest methods and properties correctly.

If you continue to face issues, please provide a minimal reproducible example of your code, and I can assist you further.

Sources:

@MonishaRaja Could you please zip and attach your input HTML and output document produced on your side? Screenshots are not very convenient for testing. We will check the issue and provide you more information.

@alexey.noskov : Thanks for the quick response. Attached input html and output file for your reference.

@MonishaRaja
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-28238

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

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