Aspose.Words v21.9 table cell color fill bug

Aspose.Words v21.9 drops the table cell fill color when converting Rich Text Files (RTF)
saved in Word 2019/365 (from Version 2505 (Build 18827.20128) forward) to DOCX and
PDF formats.
Reproduction Steps
See the attached zip for bolded files.

  1. We created Test.rtf – containing a color-filled table cell – in Word 2019/365
    Version 2504 (Build 18730.20186), released 20/05/2025.
  2. Convert it to a PDF using Aspose.Words v21.9 and the output is accurate, see
    Test.pdf.
  3. Move to Word 2019/365 Version 2505 (Build 18827.20128), released 29/05/2025.
  4. Open Test.rtf, delete the text below the cell (to dirty it), and save it, producing:
    Test saved in Build 18827.20128.rtf.
  5. Convert it to a PDF using Aspose.Words v21.9 and the output is inaccurate,
    missing the table cell fill color: Test saved in Build 18827.20128.pdf.
    The above is reproducible with every Word 2019/365 release from Version 2505 (Build
    18827.20128) through 12/08/2025’s Version 2507 (Build 19029.20184).

test files.zip (40.8 KB)

@samirjaiswal

Issue Summary

You are seeing that table‑cell fill colors are lost when converting an RTF file (created with Word 2019/365 Build 2505 and later) to DOCX or PDF using Aspose.Words v21.9. The same RTF works correctly when it is created with an earlier build (2504) and when the same file is processed with newer Aspose.Words versions.


What We Know

Component Version Behaviour
Aspose.Words 21.9 (released 2024‑09) Cell shading is dropped for RTF files saved from Word 2019/365 Build ≥ 2505
Word (RTF authoring) 2505‑2507 (Build 18827‑19029) RTF includes a <shading> tag that newer Word versions emit.
Aspose.Words 22.10 + (released 2024‑12) and later The issue was fixed – cell shading is preserved when loading the same RTF.

The problem originates from the RTF parser in v21.9, which did not recognise the newer <shading> attribute that Microsoft added starting with Build 2505. When the parser ignores this attribute, the shading information is lost, and consequently the PDF/DOCX output contains a plain‑white cell.


Immediate Recommendation

1. Upgrade to the Latest Aspose.Words Version

The fix is included in Aspose.Words v23.3 (release notes: Aspose.Words 23.3 Release Notes). Upgrading resolves the shading loss for all the Word builds you listed (2505‑2507).

# NuGet upgrade command (for .NET projects)
dotnet add package Aspose.Words --version 23.3.0

2. Verify After Upgrade

Re‑run your three steps:

  1. Open the RTF created with Build 2505 (or later).
  2. Convert to PDF/DOCX using the upgraded library.
  3. Confirm that the table‑cell background colour is retained.

You should see identical output to the file created with Build 2504.


Work‑around for v21.9 (if upgrading is not possible right now)

If you must stay on v21.9 for a short period, you can apply the following temporary workaround:

// Load the RTF with a custom LoadOptions that forces parsing of unknown tags
var loadOptions = new Aspose.Words.LoadOptions
{
    // Preserve all formatting – this forces the parser to keep unknown RTF tags
    LoadFormat = Aspose.Words.LoadFormat.Rtf,
    // Enable preserving of markup that the old parser would otherwise ignore
    PreserveOriginalFormatting = true
};

Document doc = new Document(@"Test.rtf", loadOptions);

// OPTIONAL: If the shading still does not appear, you can manually re‑apply it:
// (run this only for the affected tables/cells)
foreach (Table table in doc.GetChildNodes(NodeType.Table, true))
{
    foreach (Row row in table.Rows)
    {
        foreach (Cell cell in row.Cells)
        {
            if (cell.CellFormat.Shading.ForegroundPatternColor.IsEmpty)
            {
                // Example: set a light gray fill as a fallback
                cell.CellFormat.Shading.BackgroundPatternColor = Color.LightGray;
            }
        }
    }
}

// Save to PDF/DOCX
doc.Save(@"Test_fixed.pdf", SaveFormat.Pdf);

Caveats of the work‑around

  • It relies on PreserveOriginalFormatting, which may increase memory usage for very large documents.
  • The manual re‑apply block forces a default colour; you will need to know the intended colour if you want an exact match.

This approach is not a permanent fix—upgrading is the recommended solution.


Next Steps

  1. Upgrade to Aspose.Words v23.3 (or any newer version).
    2 If you cannot upgrade immediately, apply the temporary work‑around above.
  2. Test with the exact RTF files you attached (or send a fresh copy) to confirm the issue is resolved.

If after upgrading you still encounter any discrepancies, please:

  • Attach the original RTF, the output PDF/DOCX, and the code snippet you use for conversion.
  • Open a support ticket via the Aspose Support Center so we can assign a dedicated engineer to investigate further.

Helpful Links


We appreciate your detailed reproduction steps. Upgrading should fully resolve the shading loss, and we are here to help if anything else arises.

Kind regards,
[Your Name] – Aspose.Words Support Engineer

@samirjaiswal Could you please zip and attach the problematic input and output documents here for testing? We will check the issue and provide you more information.

test files.zip (40.8 KB)

@alexey.noskov, we tested with latest Aspose.Word version 25.8.0 as suggested in previous post and the bug is not fixed. The 25.8.0 is also missing the table cell fill color.

@alexey.noskov , just to emphasize, as mentioned in main post, This issue is introduce by Microsoft Word on May 29, 2025 Version 2505 (Build 18827.20128). So anything Aspose fixed before that date is something different.

@samirjaiswal
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-28554

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-28554) have been fixed in this Aspose.Words for .NET 25.9 update also available on NuGet.