# EpubDocument

Represents extracted EPUB content. Review signatures, members, parameters, type relationships, and available reference details in OfficeIMO.Epub API Reference.

Class 

`OfficeIMO.Epub`

**Namespace**

`OfficeIMO.Epub`

**Assembly**

`OfficeIMO.Epub`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[EpubDocument.cs:83](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L83)

**Modifiers**

sealed

Represents extracted EPUB content.

## Inheritance

- object
- EpubDocument

## Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 3

- Method [EpubDocument.Load](/api/epub/officeimo-epub-epubdocument/#method-load-string-officeimo-epub-epubloadoptions)
- Method [EpubDocument.LoadAsync](/api/epub/officeimo-epub-epubdocument/#method-loadasync-string-officeimo-epub-epubloadoptions-threading-cancellationtoken)
- Method [EpubPublication.Read](/api/epub/officeimo-epub-epubpublication/#method-read-officeimo-epub-epubloadoptions-threading-cancellationtoken)

Filter members 

Show inherited

## Constructors

`public EpubDocument()` [#](#constructor-ctor)

[EpubDocument.cs:83](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L83)

## Methods

InspectContentSafety 2 overloads

`public static OfficeContentSafetyReport InspectContentSafety(byte[] packageBytes, OfficeContentSafetyOptions? options = null, EpubLoadOptions? readOptions = null, CancellationToken cancellationToken = default)` [#](#method-inspectcontentsafety-byte-officeimo-contentsafety-officecontentsafetyoptions-officeimo-epub-epubloadoptions-threading-cancellationtoken)

[EpubDocument.ContentSafety.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.ContentSafety.cs#L17)

Inspects concealed machine-readable HTML across bounded EPUB content documents.

Parameters

**packageBytes byte[] required**

**options OfficeIMO.ContentSafety.OfficeContentSafetyOptions? = null optional**

**readOptions OfficeIMO.Epub.EpubLoadOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`OfficeContentSafetyReport`

`public static OfficeContentSafetyReport InspectContentSafety(string filePath, OfficeContentSafetyOptions? options = null, EpubLoadOptions? readOptions = null, CancellationToken cancellationToken = default)` [#](#method-inspectcontentsafety-string-officeimo-contentsafety-officecontentsafetyoptions-officeimo-epub-epubloadoptions-threading-cancellationtoken)

[EpubDocument.ContentSafety.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.ContentSafety.cs#L33)

Inspects concealed machine-readable HTML across a bounded EPUB file.

Parameters

**filePath string required**

**options OfficeIMO.ContentSafety.OfficeContentSafetyOptions? = null optional**

**readOptions OfficeIMO.Epub.EpubLoadOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`OfficeContentSafetyReport`

Load 4 overloads

`public static EpubDocument Load(string path, EpubLoadOptions? options = null)` [#](#method-load-string-officeimo-epub-epubloadoptions)

[EpubDocument.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L8)

Loads an EPUB document from a file.

Parameters

**path string required**

**options OfficeIMO.Epub.EpubLoadOptions? = null optional**

Returns

`EpubDocument`

`public static EpubDocument Load(Stream stream, EpubLoadOptions? options = null)` [#](#method-load-io-stream-officeimo-epub-epubloadoptions)

[EpubDocument.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L11)

Loads an EPUB document from a caller-owned stream.

Parameters

**stream System.IO.Stream required**

**options OfficeIMO.Epub.EpubLoadOptions? = null optional**

Returns

`EpubDocument`

`public static EpubDocument Load(string path, EpubLoadOptions? options, CancellationToken cancellationToken)` [#](#method-load-string-officeimo-epub-epubloadoptions-threading-cancellationtoken)

[EpubDocument.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L15)

Loads a file with cancellation during package reading and parsing.

Parameters

**path string required**

**options OfficeIMO.Epub.EpubLoadOptions? required**

**cancellationToken System.Threading.CancellationToken required**

Returns

`EpubDocument`

`public static EpubDocument Load(Stream stream, EpubLoadOptions? options, CancellationToken cancellationToken)` [#](#method-load-io-stream-officeimo-epub-epubloadoptions-threading-cancellationtoken)

[EpubDocument.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L19)

Loads a caller-owned stream with cancellation during reading and parsing.

Parameters

**stream System.IO.Stream required**

**options OfficeIMO.Epub.EpubLoadOptions? required**

**cancellationToken System.Threading.CancellationToken required**

Returns

`EpubDocument`

LoadAsync 2 overloads

`public static async Task<EpubDocument> LoadAsync(string path, EpubLoadOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-loadasync-string-officeimo-epub-epubloadoptions-threading-cancellationtoken)

Asynchronously loads an EPUB document from a file.

Parameters

**path string required**

**options OfficeIMO.Epub.EpubLoadOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<EpubDocument>`

`public static async Task<EpubDocument> LoadAsync(Stream stream, EpubLoadOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-loadasync-io-stream-officeimo-epub-epubloadoptions-threading-cancellationtoken)

Asynchronously loads an EPUB document from a caller-owned stream.

Parameters

**stream System.IO.Stream required**

**options OfficeIMO.Epub.EpubLoadOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<EpubDocument>`

RemoveProvenance 2 overloads

`public static OfficeProvenanceRemovalResult RemoveProvenance(string inputPath, string outputPath, OfficeProvenanceRemovalOptions? options = null)` [#](#method-removeprovenance-string-string-officeimo-provenance-officeprovenanceremovaloptions)

[EpubDocument.Provenance.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.Provenance.cs#L33)

Removes selected provenance and atomically writes an EPUB package.

Parameters

**inputPath string required**

**outputPath string required**

**options OfficeIMO.Provenance.OfficeProvenanceRemovalOptions? = null optional**

Returns

`OfficeProvenanceRemovalResult`

`public static OfficeProvenanceRemovalResult RemoveProvenance(byte[] packageBytes, string fileName = "publication.epub", OfficeProvenanceRemovalOptions? options = null)` [#](#method-removeprovenance-byte-string-officeimo-provenance-officeprovenanceremovaloptions)

[EpubDocument.Provenance.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.Provenance.cs#L48)

Removes selected provenance from encoded EPUB package bytes.

Parameters

**packageBytes byte[] required**

**fileName string = "publication.epub" optional**

**options OfficeIMO.Provenance.OfficeProvenanceRemovalOptions? = null optional**

Returns

`OfficeProvenanceRemovalResult`

RemoveSelectedContent 2 overloads

`public static OfficeContentCleanupResult RemoveSelectedContent(byte[] packageBytes, OfficeContentCleanupSelection selection, OfficeContentCleanupOptions? options = null, EpubLoadOptions? readOptions = null, CancellationToken cancellationToken = default)` [#](#method-removeselectedcontent-byte-officeimo-contentsafety-officecontentcleanupselection-officeimo-contentsafety-officecontentcleanupoptions-officeimo-epub-epubloadoptions-threading-cancellationtoken)

[EpubDocument.ContentSafety.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.ContentSafety.cs#L46)

Removes exact selected concealed HTML findings, preserves other EPUB entries, and reopens the result.

Parameters

**packageBytes byte[] required**

**selection OfficeIMO.ContentSafety.OfficeContentCleanupSelection required**

**options OfficeIMO.ContentSafety.OfficeContentCleanupOptions? = null optional**

**readOptions OfficeIMO.Epub.EpubLoadOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`OfficeContentCleanupResult`

`public static OfficeContentCleanupResult RemoveSelectedContent(string inputPath, string outputPath, OfficeContentCleanupSelection selection, OfficeContentCleanupOptions? options = null, EpubLoadOptions? readOptions = null, CancellationToken cancellationToken = default)` [#](#member-570cfef11fe0cc8cf3953c41)

[EpubDocument.ContentSafety.cs:108](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.ContentSafety.cs#L108)

Atomically writes an explicitly cleaned EPUB artifact.

Parameters

**inputPath string required**

**outputPath string required**

**selection OfficeIMO.ContentSafety.OfficeContentCleanupSelection required**

**options OfficeIMO.ContentSafety.OfficeContentCleanupOptions? = null optional**

**readOptions OfficeIMO.Epub.EpubLoadOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`OfficeContentCleanupResult`

`public static OfficeXmlPackageSigningResult SignPackage(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficeXmlPackageSignatureOptions? options = null)` [#](#method-signpackage-string-officeimo-security-iofficesecurityprovider-security-cryptography-x509certificates-x509certificate2-officeimo-security-officexmlpackagesignatureoptions)

[EpubDocument.Signatures.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.Signatures.cs#L21)

Creates, validates, and atomically commits an EPUB XML package signature.

Parameters

**filePath string required**

**securityProvider OfficeIMO.Security.IOfficeSecurityProvider required**

**signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 required**

**options OfficeIMO.Security.OfficeXmlPackageSignatureOptions? = null optional**

Returns

`OfficeXmlPackageSigningResult`

`public static OfficeXmlPackageSigningResult TrySignPackage(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficeXmlPackageSignatureOptions? options = null)` [#](#method-trysignpackage-string-officeimo-security-iofficesecurityprovider-security-cryptography-x509certificates-x509certificate2-officeimo-security-officexmlpackagesignatureoptions)

[EpubDocument.Signatures.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.Signatures.cs#L31)

Attempts atomic EPUB XML signature creation and returns structured failure evidence.

Parameters

**filePath string required**

**securityProvider OfficeIMO.Security.IOfficeSecurityProvider required**

**signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 required**

**options OfficeIMO.Security.OfficeXmlPackageSignatureOptions? = null optional**

Returns

`OfficeXmlPackageSigningResult`

`public static OfficeXmlPackageSignatureValidationReport ValidateSignatures(string filePath, IOfficeSecurityProvider securityProvider, OfficeXmlPackageSignatureOptions? options = null)` [#](#method-validatesignatures-string-officeimo-security-iofficesecurityprovider-officeimo-security-officexmlpackagesignatureoptions)

[EpubDocument.Signatures.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.Signatures.cs#L12)

Validates META-INF/signatures.xml and signed EPUB entry digests through an explicit provider.

Parameters

**filePath string required**

**securityProvider OfficeIMO.Security.IOfficeSecurityProvider required**

**options OfficeIMO.Security.OfficeXmlPackageSignatureOptions? = null optional**

Returns

`OfficeXmlPackageSignatureValidationReport`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string? Title { get; internal set; }` [#](#property-title)

[EpubDocument.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L48)

Best-effort document title.

`public string? Identifier { get; internal set; }` [#](#property-identifier)

[EpubDocument.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L53)

Package identifier from OPF metadata when available.

`public string? Language { get; internal set; }` [#](#property-language)

[EpubDocument.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L58)

Primary language from OPF metadata when available.

`public string? Creator { get; internal set; }` [#](#property-creator)

[EpubDocument.cs:63](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L63)

Creator/author from OPF metadata when available.

`public string? OpfPath { get; internal set; }` [#](#property-opfpath)

[EpubDocument.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L68)

Internal path to the OPF package document when discovered.

`public string? PackageVersion { get; internal set; }` [#](#property-packageversion)

[EpubDocument.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L71)

Version declared by the OPF package element.

`public string? UniqueIdentifierId { get; internal set; }` [#](#property-uniqueidentifierid)

[EpubDocument.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L74)

ID of the dc:identifier selected by the package unique-identifier attribute.

`public EpubRenditionLayout? RenditionLayout { get; internal set; }` [#](#property-renditionlayout)

[EpubDocument.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L77)

Globally declared rendition layout, or null when the package uses the default.

`public bool IsFixedLayout { get; }` [#](#property-isfixedlayout)

[EpubDocument.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L80)

Whether the package globally declares a pre-paginated fixed layout.

`public IReadOnlyList<EpubRootfile> Rootfiles { get; internal set; }` [#](#property-rootfiles)

[EpubDocument.cs:83](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L83)

Ordered rootfile declarations from META-INF/container.xml.

`public IReadOnlyList<EpubMetadataEntry> Metadata { get; internal set; }` [#](#property-metadata)

[EpubDocument.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L86)

Ordered OPF metadata declarations, including EPUB 3 refinements and EPUB 2 metadata.

`public IReadOnlyList<EpubNavigationItem> TableOfContents { get; internal set; }` [#](#property-tableofcontents)

[EpubDocument.cs:89](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L89)

Hierarchical EPUB table of contents.

`public IReadOnlyList<EpubNavigationItem> PageList { get; internal set; }` [#](#property-pagelist)

[EpubDocument.cs:92](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L92)

EPUB page-list navigation items.

`public IReadOnlyList<EpubNavigationItem> Landmarks { get; internal set; }` [#](#property-landmarks)

[EpubDocument.cs:95](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L95)

EPUB landmarks or EPUB 2 guide references.

`public IReadOnlyList<EpubChapter> Chapters { get; internal set; }` [#](#property-chapters)

[EpubDocument.cs:100](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L100)

Extracted chapters.

`public EpubReadSummary ReadSummary { get; internal set; }` [#](#property-readsummary)

[EpubDocument.cs:103](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L103)

Chapter extraction counts and completeness under the selected reading policy.

`public IReadOnlyList<EpubResource> Resources { get; internal set; }` [#](#property-resources)

[EpubDocument.cs:108](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L108)

OPF manifest resources in deterministic package order.

`public IReadOnlyList<EpubEncryptionInfo> Encryption { get; internal set; }` [#](#property-encryption)

[EpubDocument.cs:111](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L111)

Encrypted or obfuscated resources declared by META-INF/encryption.xml.

`public bool HasEncryptedResources { get; }` [#](#property-hasencryptedresources)

[EpubDocument.cs:114](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L114)

Whether the container declares any encrypted or obfuscated resources.

`public bool RequiresDecryption { get; }` [#](#property-requiresdecryption)

[EpubDocument.cs:117](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L117)

Whether one or more resources require unsupported decryption.

`public EpubSignatureInfo Signatures { get; internal set; }` [#](#property-signatures)

[EpubDocument.cs:120](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L120)

Structural information about META-INF/signatures.xml, when present.

`public bool HasSignatures { get; }` [#](#property-hassignatures)

[EpubDocument.cs:123](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L123)

Whether the EPUB container carries a signatures.xml document.

`public IReadOnlyList<EpubDiagnostic> Diagnostics { get; internal set; }` [#](#property-diagnostics)

[EpubDocument.cs:126](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L126)

Structured non-fatal diagnostics encountered during extraction.

`public IReadOnlyList<string> Warnings { get; internal set; }` [#](#property-warnings)

[EpubDocument.cs:131](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Epub/EpubDocument.cs#L131)

Non-fatal warnings encountered during extraction.

<!-- PowerForge markdown artifact sha256:5A77E8FA6DE1A8CCB9A381AE6A039FCC47FEAD3F6EA0ED612EAE0EAFFC50DD20 -->
