Loading Documents

GroupDocs.Merger for Python via .NET provides flexible ways to load a source document. The Merger class accepts a file path, a binary stream, or either combined with LoadOptions for password-protected and custom-loading scenarios.

Merger Class Constructors

The following constructors are available for loading from a file path:

  • Merger(file_path) — load a document from a local or relative file path.
  • Merger(file_path, load_options) — load a document and supply additional load options (e.g. a password).
  • Merger(file_path, load_options, settings) — load a document with load options and custom MergerSettings.

To load a document from a stream, pass any readable binary stream object:

  • Merger(stream) — load from a binary file-like object.
  • Merger(stream, load_options) — load from a stream with additional load options.
  • Merger(stream, load_options, settings) — load from a stream with load options and custom settings.

All constructors support the Python context manager protocol (with Merger(...) as merger:), which automatically releases all managed resources when the block exits.

Loading Guides

See also