word library

Word (.docx) documents.

WordView shows a document that a WordController has loaded, either reflowed to the screen or as printed pages (WordViewMode). WordPageThumbnail draws one page small, for a page strip.

To read a document's content without showing it, parse it with DocxReader into a WordDocument.

Classes

DocumentController
What every format's controller does, so an app can build one toolbar, search bar and position display for all of them.
DocumentLocation
Where the reader is in a document: "page 3 of 12", "row 40 of 900".
DocumentSearchState
A search in a document: the query, how many times it occurs and which occurrence is current.
DocumentViewerStrings
The text the package's widgets show: messages, labels, tooltips and screen-reader descriptions. English by default.
DocumentViewerStringsScope
Gives the package's widgets below it strings instead of English.
DocumentViewerTheme
Colours the package's views use for search matches, as a ThemeExtension on the app's theme.
DocxReader
Reads a .docx (WordprocessingML, ECMA-376 Part 1 §17) into a WordDocument for display.
ListMarker
A list item's number or bullet, already worked out (1., 2.3, iv), •), with its own formatting.
ParagraphFormat
A paragraph's resolved formatting. Lengths in points.
PositionKeys
Keys used in ReadingPosition maps, per reader.
RunFormat
A run's resolved formatting. Sizes in points.
WordBlock
A block-level piece of content: a WordParagraph, a WordTable or a WordSectionBreak.
WordBookmark
A named place a link can jump to (w:bookmarkStart).
WordBorderLine
A line on one side of a cell or paragraph.
WordBreak
A break inside a paragraph (w:br, w:cr).
WordCellBorders
The four borders of a table cell; a null side has no line.
WordController
Loads a Word (.docx) document for WordView: its layout (viewMode), zoom, search, the page in view and the scroll position.
WordDocument
A Word document as read from a .docx, ready to display: styles are already resolved onto every paragraph and run, list markers are already numbered, and field codes are reduced to their shown results.
WordImage
A picture (DrawingML w:drawing or a VML picture).
WordInline
A piece of a paragraph's content: text, a tab, a break, an image, a note mark, a page field or a bookmark.
A link's target: a web address, or a bookmark in this document.
WordNoteReference
A footnote or endnote mark in the text (w:footnoteReference, w:endnoteReference).
WordPageField
A PAGE or NUMPAGES field: the page number (or count) where it's shown. fallback is the result Word saved, for views without pages.
WordPageThumbnail
Page page (1-based) of controller's print layout, scaled down to fit
WordParagraph
A paragraph (w:p): inline content with resolved formatting.
WordSection
A section's page and its headers/footers. Sizes are in points.
WordSectionBreak
Where one section ends and the next begins.
WordTab
A tab character (w:tab, w:ptab).
WordTable
A table (w:tbl) of rows on a grid of columnWidths.
WordTableCell
A table cell (w:tc).
WordTableRow
A table row (w:tr).
WordText
A stretch of text with one formatting (from a run, w:r).
WordView
A .docx, lazily built, in one of two layouts (WordController.viewMode):

Enums

BreakKind
What a WordBreak ends (w:br w:type).
CellVerticalAlignment
How a table cell's content sits vertically (w:vAlign).
DocumentLoadError
Why a document couldn't be opened.
DocumentStatus
Where a DocumentController is in its document's life.
DocumentUnit
What DocumentLocation.current and DocumentLocation.count count.
HeaderFooterKind
Which pages a header or footer is for (w:headerReference w:type).
LineSpacingRule
How ParagraphFormat.lineSpacing is measured (w:spacing w:lineRule).
ListMarkerSuffix
What separates a list marker from the text (w:suff).
NoteKind
Whether a note is a footnote or an endnote.
PageFieldKind
What a WordPageField shows.
ParagraphAlignment
Horizontal alignment of a paragraph's lines (w:jc) or of a table.
UnderlineStyle
A run's underline (w:u). Word's many styles are reduced to these.
VerticalTextPosition
A run's position relative to the baseline (w:vertAlign).
WordViewMode
How WordView lays a document out.

Typedefs

ReadingPosition = Map<String, Object?>
A reader's saved place in a document, as plain JSON-safe values.

Exceptions / Errors

DocxFormatException
The file isn't a readable .docx.