Words to PDF Error

Hi,

We have a document that fails to convert to PDF when

aspWordsDocument.LayoutOptions.RevisionOptions.ShowInBalloons = Aspose.Words.Layout.ShowInBalloons.FormatAndDelete

The document is attached:

Test File (004).docx (160.1 KB)

The error reported is InvalidOperationException:

Message: Invalid document model.Operation can not be completed.
StackTrace:    at    .(FieldChar , Boolean )
	at    .(FieldChar )
	at    .(FieldChar )
	at    .(Node )
	at    .(Node )
	at    .(Node )
	at    . ()
	at    . ()
	at    .()
	at    .MoveNext()
	at .()
	at Aspose.Words.Document.UpdatePageLayout()
	at    .(  ​ ,     )
	at    .     (  ​ )
	at    .     (  ​ )
	at Aspose.Words.Document.(  ​ )
	at Aspose.Words.Document.(Stream , String , SaveOptions )
	at Aspose.Words.Document.Save(Stream stream, SaveOptions saveOptions)

@GaryO

You reported an InvalidOperationException that occurs only when you set

doc.LayoutOptions.RevisionOptions.ShowInBalloons = ShowInBalloons.FormatAndDelete;

The ShowInBalloons enumeration does include the FormatAndDelete value , and this setting appears in other code examples .

What to try

  1. Test other balloon options
// Try a different enum value
doc.LayoutOptions.RevisionOptions.ShowInBalloons = ShowInBalloons.Format; // or ShowInBalloons.None

If the document converts successfully, the problem is isolated to the FormatAndDelete mode.

  1. Create a minimal reproducible sample
  • a small .docx containing at least one tracked format change and one tracked delete,
  • the same code that loads the document, sets ShowInBalloons = FormatAndDelete, and saves to PDF.
    Attach the sample (or a zip) to this thread.
  1. Provide the Aspose.Words version you are using (e.g., 23.9, 24.1, etc.) so we can check whether this behavior is version‑specific.

Work‑around (if you need the PDF now)

Use ShowInBalloons = ShowInBalloons.Format or ShowInBalloons = ShowInBalloons.None to render revisions without triggering the exception.

Please share the version number and a minimal repro file, and we’ll continue the investigation here.

Document was attached to the original post

Issue is the Format and Delete

@GaryO
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-29043

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.