Codecs
All four are pure Dart and work on the canonical model (types.dart). Guide: tutorial step 6.
DOCX
| Type | Purpose | Key members |
|---|---|---|
DocxCodec | Word import and export | DocxCodec(elementRegistry:, resolveImageBytes:, contributions:, packageLimits:), decode, decodeDocument(bytes, onProgress:), decodeWithReport(bytes), encode(document), encodeWithReport(document), encodeValidated(envelope), inspectFidelity, canDecode |
DocxDecodeResult | Import outcome | document, issues, receipts, sourcePagination |
DocxEncodeResult | Export outcome | bytes, supportReport |
DocxFidelityIssue | One approximation or omission | code, impact, partPath, message |
DocxCodecContributionRegistry | Element mappings | .fixed([...]), .empty |
DocxExportValidationEnvelope | Pairs a state with its resolved layout for validated export | state, generation |
DocxDecodeProgress, DocxPackageLimits, DocumentCodec<T> | Progress, limits, the codec interface |
PDF
| Type | Purpose | Key members |
|---|---|---|
ResolvedPdfPainter | Paints the resolved pages into PDF bytes | ResolvedPdfPainter(registry:, fontResourceTimeout:, imageResourceTimeout:), paintValidated(envelope, resolveBytes:, resolveFontBytes:) |
ResolvedPdfExportValidationEnvelope | A state and its complete layout generation | state, generation, validate() |
ResolvedDocumentPrintService | A print spool from the same lane | preparePrintSpool(envelope) |
PdfElementRegistry, createCorePdfElementRegistry(...), pdfElementsOf(extensions) | Element painters | |
PdfFontBytesResolver | (family, {weight, italic}) to font bytes |
Horizontal rules consume their exact resolved stroked-rule occurrence, including its owner rectangle and stroke position. The PDF adapter converts the resolved top-down coordinates into PDF coordinates once; paragraph spacing and container placement come from the layout snapshot. It does not position a second rule from the block's declared frame. Missing or ambiguous occurrence artifacts fail validation. This applies to the registered rule painter, including nested rules; it does not establish support for unrelated custom inline-atom painters.
Markdown
| Type | Purpose | Key members |
|---|---|---|
MarkdownCodec | CommonMark/GFM import and export | decode(source, title:, dialect:, extensions:), encode(document, dialect:, extensions:) |
MarkdownDecodeResult, MarkdownEncodeResult | Results with diagnostics | document, source |
MarkdownDialect | commonMark, gfm | |
MarkdownExtensionRegistry | Element syntax | .fromExtensions(extensions, fencedBlocks:, math:), .none |
MarkdownDiagnostic, MarkdownSourceMap, MarkdownTargetProfile | Diagnostics, source mapping, export profile | |
MarkdownFencedBlockExtension, MarkdownMathExtension, MarkdownBlockSyntaxExtension, MarkdownInlineFieldExtension | Extension points |
HTML
| Type | Purpose | Key members |
|---|---|---|
HtmlCodec | HTML import and semantic export | decode(html, title:, allowImages:, extensions:), encode(document, extensions:, resolveAsset:, fullDocument:) |
HtmlDecodeResult | Import result | document, diagnostics |
HtmlEncodeResult | Export result | source (body fragment or full page), diagnostics |
HtmlAssetResolver | Host resource mapping | Asset id to safe HTML or relative EPUB URL |
HtmlExtensionRegistry | Element mappings | .fromExtensions(extensions) |
parseHtmlToBlocks, HtmlBlockElementExtension, HtmlInlineFieldExtension | Lower-level parsing and extension points |