Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

Check Supported Formats

Edit on GitHub

List the formats an OfficeIMO.Reader instance can read, detect a file's kind and register every adapter at once from C#, PowerShell or CLI.

A reader only handles the formats you registered, so the supported set is a property of your configuration. The full list of adapter packages and extensions is in the supported formats table; this page shows how to check it at run time.

List what a reader can read

C#

using OfficeIMO.Reader;
using OfficeIMO.Reader.Pdf;
using OfficeIMO.Reader.Word;

OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
    .AddWordHandler()
    .AddPdfHandler()
    .Build();

foreach (ReaderHandlerCapability capability in reader.GetCapabilities()) {
    Console.WriteLine($"{capability.DisplayName}: {string.Join(", ", capability.Extensions)}");
}

File.WriteAllText("reader-capabilities.json", reader.GetCapabilityManifestJson(indented: true));

PowerShell

Get-OfficeDocumentCapability | Format-Table DisplayName, Extensions
Get-OfficeDocumentCapability -Manifest

CLI

officeimo reader capabilities
officeimo reader capabilities --format json

Detect a file's kind

Check a file before reading it, for example to route uploads:

using OfficeIMO.Reader;
using OfficeIMO.Reader.Pdf;

OfficeDocumentReader reader = new OfficeDocumentReaderBuilder().AddPdfHandler().Build();
Console.WriteLine(reader.DetectKind("upload.pdf"));

Register every adapter

OfficeIMO.Reader.All registers all adapters in one call. Use it for hosts that accept any document, and selective adapters for smaller deployments.

using OfficeIMO.Reader;
using OfficeIMO.Reader.All;

OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
    .AddAllOfficeIMOHandlers(new ReaderAllOptions())
    .Build();

Limits and reference

Limits: a registered handler is not a claim of complete format preservation; each capability lists its format qualifications. See the compatibility matrix.

Reference: OfficeIMO.Reader API · Get-OfficeDocumentCapability

API used on this page

Example source