Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

EpubDocument

OfficeIMO.Epub

Namespace
OfficeIMO.Epub
Assembly
OfficeIMO.Epub
Source revision
ba882f6b0d07 with working tree changes
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

Constructors

public EpubDocument() #

Methods

InspectContentSafety 2 overloads
public static OfficeContentSafetyReport InspectContentSafety(byte[] packageBytes, OfficeContentSafetyOptions? options = null, EpubLoadOptions? readOptions = null, CancellationToken cancellationToken = default) #

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) #

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) #

Loads an EPUB document from a file.

Parameters

path string required
options OfficeIMO.Epub.EpubLoadOptions? = null optional
public static EpubDocument Load(Stream stream, EpubLoadOptions? options = null) #

Loads an EPUB document from a caller-owned stream.

Parameters

stream System.IO.Stream required
options OfficeIMO.Epub.EpubLoadOptions? = null optional
public static EpubDocument Load(string path, EpubLoadOptions? options, CancellationToken cancellationToken) #

Loads a file with cancellation during package reading and parsing.

Parameters

path string required
options OfficeIMO.Epub.EpubLoadOptions? required
cancellationToken System.Threading.CancellationToken required
public static EpubDocument Load(Stream stream, EpubLoadOptions? options, CancellationToken cancellationToken) #

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
LoadAsync 2 overloads
public static async Task<EpubDocument> LoadAsync(string path, EpubLoadOptions? options = null, CancellationToken cancellationToken = default) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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

Properties

public string? Title { get; internal set; } #

Best-effort document title.

public string? Identifier { get; internal set; } #

Package identifier from OPF metadata when available.

public string? Language { get; internal set; } #

Primary language from OPF metadata when available.

public string? Creator { get; internal set; } #

Creator/author from OPF metadata when available.

public string? OpfPath { get; internal set; } #

Internal path to the OPF package document when discovered.

public string? PackageVersion { get; internal set; } #

Version declared by the OPF package element.

public string? UniqueIdentifierId { get; internal set; } #

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

public EpubRenditionLayout? RenditionLayout { get; internal set; } #

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

public bool IsFixedLayout { get; } #

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

public IReadOnlyList<EpubRootfile> Rootfiles { get; internal set; } #

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

public IReadOnlyList<EpubMetadataEntry> Metadata { get; internal set; } #

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

public IReadOnlyList<EpubNavigationItem> TableOfContents { get; internal set; } #

Hierarchical EPUB table of contents.

public IReadOnlyList<EpubNavigationItem> PageList { get; internal set; } #

EPUB page-list navigation items.

public IReadOnlyList<EpubNavigationItem> Landmarks { get; internal set; } #

EPUB landmarks or EPUB 2 guide references.

public IReadOnlyList<EpubChapter> Chapters { get; internal set; } #

Extracted chapters.

public EpubReadSummary ReadSummary { get; internal set; } #

Chapter extraction counts and completeness under the selected reading policy.

public IReadOnlyList<EpubResource> Resources { get; internal set; } #

OPF manifest resources in deterministic package order.

public IReadOnlyList<EpubEncryptionInfo> Encryption { get; internal set; } #

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

public bool HasEncryptedResources { get; } #

Whether the container declares any encrypted or obfuscated resources.

public bool RequiresDecryption { get; } #

Whether one or more resources require unsupported decryption.

public EpubSignatureInfo Signatures { get; internal set; } #

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

public bool HasSignatures { get; } #

Whether the EPUB container carries a signatures.xml document.

public IReadOnlyList<EpubDiagnostic> Diagnostics { get; internal set; } #

Structured non-fatal diagnostics encountered during extraction.

public IReadOnlyList<string> Warnings { get; internal set; } #

Non-fatal warnings encountered during extraction.