Rendering Issues with Nested EQ Field

Description:
Processing Word documents containing nested EQ fields (where an EQ field contains another EQ field or embedded objects such as images) results in rendering errors. Instead of correctly displaying the intended output, Aspose sometimes shows raw field codes or produces visual artifacts.
Example field structure:

{ EQ \o({ EQ \o( ... , { EMBED Word.Picture.8 }) }) }

Sample Docx:
nested_eq.docx (20.1 KB)

Expected Result (Microsoft Word Screenshot):
Field nesting and embedded objects should render correctly, visually matching how Word displays the document.

Actual Result (Aspose Output):
The output is missing some elements and renders incorrectly.

Code Sample:

using Aspose.Words;
new License().SetLicense(@"licensePath");
var doc = new Document(@"inputDocxPath");
doc.Save(@"outputPngPath");

Environment:

  • .NET Framework 4.8
  • Aspose.Words 25.11.0

Possible Solution:
Is there a known solution or workaround to fully support nested EQ fields and embedded objects during rendering? If not, could this scenario be considered for enhancement in future releases? Please let me know if further details or examples are required.

@chenweii

Summary
Rendering of nested EQ fields (an EQ field that contains another EQ field or an embedded picture) can be problematic in Aspose.Words. In some cases the renderer shows the raw field code or omits the embedded object when saving directly to an image format.

Why it may happen

  • Field evaluation – The field engine may not fully evaluate complex, nested EQ structures before rasterisation. When the field is not expanded, the renderer falls back to displaying the field code.
  • Embedded object handling – Pictures or OLE objects that are referenced inside an EQ field are not always extracted automatically during image rendering, which can lead to missing visual elements.
  • Version‑specific behavior – Users have reported this issue in version 25.11.0. Later builds sometimes contain fixes for complex field scenarios, but there is no publicly documented guarantee that nested EQ fields are fully supported.

What to try

  1. Force field update before rendering
using Aspose.Words;
using Aspise.Words.Saving;

var doc = new Document("input.docx");
// Expand all fields (including EQ) before saving
doc.UpdateFields();

var imgOptions = new ImageSaveOptions(SaveFormat.Png) { Resolution = 300 };
doc.Save("output.png", imgOptions);

If the image now looks correct, the problem was simply that the fields were not expanded.

  1. Test with a newer Aspose.Words build
  • Download the latest stable version (e.g., 25.12.x or later).
  • Run the same code (with or without UpdateFields).
  • Compare the output. New releases often include fixes for complex field handling.
  1. Work‑around: render via PDF
    Converting the document to PDF first forces a full field evaluation, and the PDF can then be rasterised to an image.
doc.Save("intermediate.pdf", SaveFormat.Pdf);
// Use Aspose.PDF or another library to convert the PDF page to PNG.
  1. Create a minimal reproducible document
  • Build a small DOCX that contains only the problematic nested EQ field.
  • Attach this file when contacting Aspose support or filing an enhancement request. A minimal sample speeds up investigation.
  1. Raise the issue with Aspose
    If the steps above do not resolve the problem, log a support ticket or submit an enhancement request. Include:
  • The minimal DOCX sample.
  • The exact Aspose.Words version.
  • The code snippet you are using.
  • Screenshots of the expected vs. actual rendering.

Note: The information above is based on typical behavior of the Aspose.Words field engine and user‑reported experiences. The specific evidence for nested EQ field rendering issues was not found in the provided sources, so the exact cause and fix may vary. It is recommended to verify the behavior in your environment and, if needed, engage Aspose support for a definitive answer.

:warning: I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.

Thank you for your response.

I have already tried using the UpdateFields method as suggested, and also exported the document to both PNG and PDF formats. Unfortunately, the rendering issue persists—the results are identical for both PNG and PDF.

Code Sample:

using Aspose.Words;
new License().SetLicense(@"licensePath");
var doc = new Document(@"inputDocxPath");
doc.UpdateFields();
doc.Save(@"outputPngPath");
doc.Save(@"outputPdfPath");

Aspose Output (PNG):

Aspose Output (PDF):
sample.pdf (19.2 KB)

A minimal Word document to reproduce the issue has also been provided.
If you require any additional information or files, please let me know.

@chenweii
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-28824

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.