LINQ Expressions Not Working When Saving as PDF in Aspose.Words

Description

I am using Aspose.Words for Java to generate documents with LINQ Reporting Engine. The LINQ expressions are processed correctly when saving the document as DOCX, but when saving as PDF, the expressions are not evaluated, and the raw placeholders appear in the output.

Code Snippet

ReportingEngine reportingEngine = new ReportingEngine();
reportingEngine.buildReport(doc, ds.values().toArray(), ds.keySet().toArray(new String[0]));

SaveOptions saveOptions = SaveOptions.createSaveOptions(SaveFormat.fromName("PDF"));
doc.save(out, saveOptions);

Observed Behavior

  • DOCX Output → Works correctly (LINQ expressions are evaluated).
  • PDF Output → LINQ expressions remain as placeholders instead of being replaced with actual values.

Additional Notes

  • I also tried explicitly calling:
    doc.updateFields();
    doc.updatePageLayout();
    doc.cleanup()
    
  • I attempted using PdfSaveOptions with different settings.

But it didn’t solve the issue - the LINQ expressions still remain unprocessed in the PDF.

@MindControl Such problem might occur if document layout is cached before the document is filled with data. For example if you call Document.updateFields or Document.updatePageLayout before building the report. Please try calling Document.updatePageLayout just before saving the document as PDF. This must help.
If not, please attach your sample input, data, output and code that will allow us to reproduce the problem. We will check the issue on our side and provide you more information.