djvu library
DjVu parsing entry points and page model.
Classes
- ArchiveEntry
- A physical entry of a book's container archive.
- BinaryFile
- Represents a binary book file.
- Book
- A fully parsed book, independent of its source format.
- BookCover
- A book cover: raw bytes plus the detected image type.
- BookFile
- Abstract representation of a file inside a book container.
- BookMetadata
- Format-agnostic book metadata extracted from any supported book file.
- BookStatistics
- Basic reading statistics computed from book content.
- DjvuBook
- A DjVu book with directly stored JPEG or decoded page images in reading order.
- DjvuPage
- One DjVu page with a directly stored JPEG or decoded BMP image.
- DjvuPageStructure
- The stable spatial structure of one DjVu page's hidden text: the zone hierarchy with its coordinates, and the canonical text the zones bind to.
- DjvuTextChunk
- One TXTz hidden-text chunk: the page text plus its decoded zone tree.
- DjvuTextZone
- One node of the TXTz zone tree, decoded to absolute values.
- DocumentBook
- A document-backed book produced by text and office-format adapters.
- Files
- The files contained in a parsed book.
- The navigation (table of contents) of a book.
- Represents a navigation point (table of contents entry) in a book.
- ReadingOrderItem
- One entry of a book's reading order.
- SpatialRect
-
A rectangle in the canonical top-left page space: the
xandyfields place the upper-left corner, sizes grow right and down. - SpatialTextPage
- One page of positioned text: the shared shape DjVu hidden text and imported ALTO both project onto.
- SpatialTextProvenance
- The provenance of a spatial text page: its origin, the OCR software when the source names one, and whether the source declared confidence values at all.
- SpatialTextZone
- One positioned text zone: a hierarchy kind, a rectangle in the page's canonical top-left space, and the UTF-16 code-unit range it selects in the page's canonical text.
- SpatialZoneLookup
- Range queries over one SpatialTextPage's zones: which zone holds a text offset, which zones overlap a text range, which region a zone belongs to.
- TextFile
- Represents a text book file.
Enums
- BookFormat
- The book formats supported by unseal.
- SpatialTextOrigin
- Where a spatial text page's zones came from.
- SpatialUnit
- The unit every coordinate of one spatial document is expressed in.
- SpatialZoneKind
- The hierarchy levels DjVu hidden text and ALTO share.
Constants
- djvuZoneTypeCharacter → const int
- The character zone type: the finest stored level.
- djvuZoneTypeColumn → const int
- The column zone type: a vertical slice of the page.
- djvuZoneTypeLine → const int
- The line zone type.
- djvuZoneTypePage → const int
- The page zone type: the tree's root record.
- djvuZoneTypeParagraph → const int
- The paragraph zone type.
- djvuZoneTypeRegion → const int
- The region zone type: a block-level text area.
- djvuZoneTypeWord → const int
- The word zone type.
Properties
- djvuHiddenTextProfile → TextProfile
-
The extraction profile of DjVu hidden text: the page's TXTz/TXTa zone
text rendered with the positional separator convention. The profile is
stable for the format's whole contract — the hidden text is stored, not
computed, so no plan revision can change its shape.
final
Functions
-
decodeDjvuTextChunk(
Uint8List encoded) → DjvuTextChunk - Decodes a BZZ-compressed TXTz chunk (DjVu 3 spec, §8.3.5).
-
decodeDjvuTextChunkRaw(
Uint8List raw) → DjvuTextChunk -
Validates the decompressed TXTz grammar of
rawand extracts its text and zone tree. -
parseDjvuBook(
Uint8List bytes) → DjvuBook - Opens direct BGjp JPEG pages, page-local JB2 masks, and bounded IW44 layers.
-
readDjvuMetadata(
Uint8List bytes) → BookMetadata - Validates the container and reads DjVu metadata without decoding image data.
Exceptions / Errors
- DjvuException
- Malformed or excessive DjVu input.
- DjvuUnsupportedCodecException
- A valid page whose image codec is not yet decoded by Unseal.