Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

BookProject

OfficeIMO.Workflows

Namespace
OfficeIMO.Workflows
Assembly
OfficeIMO.Workflows
Source revision
5e5a2dda74b3 with working tree changes
Modifiers
sealed

An editable publication and its retained manuscript review state. Instances are mutable and not thread-safe.

Inheritance

  • object
  • BookProject

Usage

Explore 4 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.

Methods

public void AcknowledgeImportLoss() #

Records author acceptance of import approximations and omissions. Failed imports require source repair and re-import.

public string AddChapter(string title, CancellationToken cancellationToken = default) #

Appends a chapter, retaining the first XHTML chapter's head and resolving its resource references from the new location.

Parameters

title string required
cancellationToken System.Threading.CancellationToken = default optional

Returns

string
public void ApplyContentEdits(IEnumerable<EpubContentEdit> edits, CancellationToken cancellationToken = default) #

Applies stale-checked scoped content edits in one undoable transaction.

Parameters

edits System.Collections.Generic.IEnumerable<OfficeIMO.Epub.EpubContentEdit> required
cancellationToken System.Threading.CancellationToken = default optional
public void ApplyEdits(BookProjectEdits edits, CancellationToken cancellationToken = default) #

Applies a complete editor draft in one transaction; failure retains the previous publication.

Parameters

edits OfficeIMO.Workflows.BookProjectEdits required
cancellationToken System.Threading.CancellationToken = default optional
public EpubEditionComparison CompareRevision(string revisionId, CancellationToken cancellationToken = default) #

Compares a retained revision with the current publication through the EPUB owner.

Parameters

revisionId string required
cancellationToken System.Threading.CancellationToken = default optional

Returns

EpubEditionComparison
public static BookProject Create(string title, string language = "en") #

Creates a reflowable EPUB project with an editable first chapter.

Parameters

title string required
language string = "en" optional
public BookProjectRevision CreateRevision(string name, CancellationToken cancellationToken = default) #

Captures the current validated publication. Exhausted bounds reject capture without evicting earlier revisions.

Parameters

name string required
cancellationToken System.Threading.CancellationToken = default optional
Export 2 overloads
public EpubWriteResult Export(CancellationToken cancellationToken = default) #

Exports a complete EPUB after import review and canonical writer validation.

Parameters

cancellationToken System.Threading.CancellationToken = default optional

Returns

EpubWriteResult
public EpubWriteResult Export(EpubSaveOptions options, CancellationToken cancellationToken = default) #

Exports a reviewed publication with explicit EPUB writer limits and signature policy.

Parameters

options OfficeIMO.Epub.EpubSaveOptions required
cancellationToken System.Threading.CancellationToken = default optional

Returns

EpubWriteResult
public BookOnixExportResult ExportOnix(BookOnixExportOptions options, XmlSchemaSet schemas, EpubSaveOptions? epubOptions = null, CancellationToken cancellationToken = default) #

Exports a single-product digital-download ONIX bibliographic record, validated against a caller-supplied compiled schema set. The schema must declare ONIXMessage in the ONIX 3.1 reference namespace. Callers own schema provenance and must not mutate the schema set during export. The result retains the exact validated EPUB from which the title and selected ISBN were obtained. This is a complete-record notification, not a block update; commercial fields require explicit caller assertions.

Parameters

options OfficeIMO.Workflows.BookOnixExportOptions required
schemas System.Xml.Schema.XmlSchemaSet required
epubOptions OfficeIMO.Epub.EpubSaveOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public static BookProject FromEpub(byte[] bytes, CancellationToken cancellationToken = default) #

Opens an existing EPUB for package-preserving editing without claiming that its content was converted.

Parameters

bytes byte[] required
cancellationToken System.Threading.CancellationToken = default optional
public static BookProject FromImport(EpubManuscriptResult result) #

Starts a project from the shared manuscript import result.

Parameters

result OfficeIMO.Epub.EpubManuscriptResult required
public static BookProject LoadProject(byte[] bytes, CancellationToken cancellationToken = default) #

Loads an .oibook project after physical ZIP, byte, schema and entry validation. No files are extracted.

Parameters

bytes byte[] required
cancellationToken System.Threading.CancellationToken = default optional
MergeChapters 2 overloads
public void MergeChapters(string firstManifestId, string secondManifestId, string boundaryId, CancellationToken cancellationToken = default) #

Merges consecutive compatible chapters, repairing references in one undoable transaction.

Parameters

firstManifestId string required
secondManifestId string required
boundaryId string required
cancellationToken System.Threading.CancellationToken = default optional
public void MergeChapters(string firstManifestId, string secondManifestId, string boundaryId, EpubChapterMergeOptions options, CancellationToken cancellationToken = default) #

Merges chapters using explicit EPUB reconciliation options in one undoable transaction.

Parameters

firstManifestId string required
secondManifestId string required
boundaryId string required
options OfficeIMO.Epub.EpubChapterMergeOptions required
cancellationToken System.Threading.CancellationToken = default optional
public void MoveChapter(int fromIndex, int toIndex, CancellationToken cancellationToken = default) #

Moves a chapter and its top-level navigation entry atomically, retaining nested navigation.

Parameters

fromIndex int required
toIndex int required
cancellationToken System.Threading.CancellationToken = default optional
public IReadOnlyList<OfficeImageExportResult> PreviewChapter(int index, double width = 816, CancellationToken cancellationToken = default) #

Renders one current chapter through the existing EPUB image owner, using retained package resources only.

Parameters

index int required
width double = 816 optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

IReadOnlyList<OfficeImageExportResult>
public void Redo(CancellationToken cancellationToken = default) #

Restores the publication that was replaced by the last undo.

Parameters

cancellationToken System.Threading.CancellationToken = default optional
public void RemoveChapter(int index, CancellationToken cancellationToken = default) #

Removes a chapter and its navigation entries. Remaining content links must still resolve; otherwise the removal is rolled back.

Parameters

index int required
cancellationToken System.Threading.CancellationToken = default optional
public void RemoveRevision(string revisionId) #

Explicitly removes a named snapshot without changing the current publication or session undo.

Parameters

revisionId string required
public void RenameChapter(int index, string title, CancellationToken cancellationToken = default) #

Renames a chapter's document title, first matching heading and matching primary navigation label atomically.

Parameters

index int required
title string required
cancellationToken System.Threading.CancellationToken = default optional
public void RenameResource(string manifestId, string containerPath, CancellationToken cancellationToken = default) #

Moves a publication resource and repairs its references in an undoable project edit.

Parameters

manifestId string required
containerPath string required
cancellationToken System.Threading.CancellationToken = default optional
public void RestoreRevision(string revisionId, CancellationToken cancellationToken = default) #

Restores a named publication snapshot as an undoable edit, retaining all revisions and import review state.

Parameters

revisionId string required
cancellationToken System.Threading.CancellationToken = default optional
public void SetChapterBody(int index, string bodyXml, CancellationToken cancellationToken = default) #

Replaces a chapter's XHTML body while retaining its document head and package declarations.

Parameters

index int required
bodyXml string required
cancellationToken System.Threading.CancellationToken = default optional
public void SetCoverImage(byte[] bytes, string mediaType, CancellationToken cancellationToken = default) #

Selects newly supplied image bytes as the package cover, retaining earlier resources and content references.

Parameters

bytes byte[] required
mediaType string required
cancellationToken System.Threading.CancellationToken = default optional
public void SetMetadata(string title, string language, string creator, CancellationToken cancellationToken = default) #

Updates primary package metadata atomically, retaining other values and refinements. A blank creator retains the current value.

Parameters

title string required
language string required
creator string required
cancellationToken System.Threading.CancellationToken = default optional
public void SetStylesheet(string css, CancellationToken cancellationToken = default) #

Changes the project typography stylesheet without replacing imported source CSS.

Parameters

css string required
cancellationToken System.Threading.CancellationToken = default optional
public void SplitChapter(string manifestId, string boundaryId, string newManifestId, string newContainerPath, string title, CancellationToken cancellationToken = default) #

Splits a chapter before a block identifier, with reference repair and one undoable transaction.

Parameters

manifestId string required
boundaryId string required
newManifestId string required
newContainerPath string required
title string required
cancellationToken System.Threading.CancellationToken = default optional
public byte[] ToDeliveryBytes(EpubSaveOptions? options = null, long maximumOutputBytes = 140509184, CancellationToken cancellationToken = default) #

Exports a reviewed EPUB, its exact selected OPF payload and a versioned checksum manifest in a ZIP. This local handoff format does not perform ONIX conversion, external validation or retailer submission. Publication, OPF and manifest limits are 128 MiB, 4 MiB and 1 MiB respectively. No files are written and project history is not included.

Parameters

options OfficeIMO.Epub.EpubSaveOptions? = null optional
maximumOutputBytes long = 140509184 optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

byte[]
public byte[] ToKdpDeliveryBytes(byte[] listingCover, EpubSaveOptions? options = null, long maximumOutputBytes = 192937984, CancellationToken cancellationToken = default) #

Prepares an offline KDP handoff containing publication.epub, package.opf, a separate listing cover and a versioned manifest. The ZIP is an OfficeIMO handoff, not an upload format.

Parameters

listingCover byte[] required
options OfficeIMO.Epub.EpubSaveOptions? = null optional
maximumOutputBytes long = 192937984 optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

byte[]
public byte[] ToProjectBytes(CancellationToken cancellationToken = default) #

Serializes an editable .oibook project. Publication bytes and review acceptance are retained together.

Parameters

cancellationToken System.Threading.CancellationToken = default optional

Returns

byte[]
public void Undo(CancellationToken cancellationToken = default) #

Restores the previous validated publication while retaining import review state.

Parameters

cancellationToken System.Threading.CancellationToken = default optional

Properties

public EpubPublication Publication { get; } #

Canonical EPUB authoring model backing this project.

public bool CanUndo { get; } #

Whether one validated package edit can be undone. History is session-only and bounded to 128 MiB per snapshot.

public bool CanRedo { get; } #

Whether the last package undo can be redone.

public IReadOnlyList<OfficeDiagnostic> ImportDiagnostics { get; } #

Retained category-preserving manuscript import diagnostics.

public bool ImportLossAcknowledged { get; private set; } #

Whether the author has reviewed and accepted non-fatal import losses.

public bool CanExport { get; } #

Whether import review permits export. Native writer validation still runs for every export.

public IReadOnlyList<BookProjectRevision> Revisions { get; } #

Named revisions in creation order. Import review state is project-wide, not reverted with content.

Fields

public const long MaximumDeliveryBytes #

Maximum delivery ZIP size: a bounded EPUB, package metadata, manifest and ZIP overhead.

Value: 140509184
public const long MaximumKdpDeliveryBytes #

Local KDP handoff ZIP ceiling, including the publication and separate cover.

Value: 192937984
public const int MaximumKdpCoverBytes #

Conservative local cover byte cap: strictly below 50 decimal MB.

Value: 49999999
public const long MaximumKdpCoverPixels #

Local cover decoding limit, independent of the retailer's dimension rules.

Value: 16000000
public const string OnixNamespace #

Namespace of the supported ONIX 3.1 reference-tag export profile.

Value: http://ns.editeur.org/onix/3.1/reference
public const long MaximumProjectBytes #

Maximum stored project size, including its bounded EPUB and review record.

Value: 272629760
public const long MaximumRevisionBytes #

Maximum combined stored EPUB bytes in named revisions.

Value: 134217728
public const long MaximumRevisionExpandedBytes #

Maximum combined expanded EPUB bytes in named revisions.

Value: 268435456
public const int MaximumRevisionCount #

Maximum named revisions retained by one project.

Value: 100