File Content Extraction 25.3
Filter SDK .NET Programming Guide

# Using Document Objects

This topic provides some additional guidance about using document objects in your code.

- A `Document` must be created and used on the same thread that created the parent session.

- Changing session configuration options can change the data that is returned by methods of a document object, even if you created the document object before changing the configuration.

  Consider the following example. You have a document with embedded images but no subfiles and you run the following code:

  Copy

      using (Document myDoc = session.Open(inputFilePath))
      {
           myDoc.Subfiles().Count(); // Returns 0

           session.Config().ExtractImages(true);

           myDoc.Subfiles().Count(); // Returns 3
      }

  This example shows that the `ExtractImages` session configuration option must not be changed while iterating over subfiles - because the list of subfiles would be invalidated. OpenText recommends disposing all objects created by open `Document` objects before changing the session configuration.

Copyright 1997-2025 Open Text
Version 25.3 | Last updated July 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: File Content Extraction 25.3

Topic Title: Using Document Objects