Context class

Layout / paint environment. Flutter-like, no dart:ui.

Constructors

Context({required Document document, required PdfPageFormat pageFormat, required ThemeData theme, required TextDirection textDirection, int pageNumber = 1, int pagesCount = 1, PdfCanvas? canvas, FontSubset? subset, FontSubset? boldSubset, Set<int>? usedCodePoints, List<PdfEmbeddedImage>? images, List<PdfLinkAnnot>? links, List<PwHeading>? headings, List<PwHeading>? frozenHeadings, Map<String, PwHeading>? anchors, bool measuring = false})
Context API.

Properties

anchors → Map<String, PwHeading>
Named destinations.
final
boldSubset ↔ FontSubset?
Bold face subset → /F3.
getter/setter pair
canvas ↔ PdfCanvas?
canvas API.
getter/setter pair
document → Document
document API.
final
font → SfntFont?
font API.
no setter
fontBold → SfntFont?
Bold face when embedded.
no setter
frozenHeadings → List<PwHeading>
Frozen headings from the measure pass (TOC page numbers).
final
hashCode → int
The hash code for this object.
no setterinherited
headings → List<PwHeading>
headings API.
final
images → List<PdfEmbeddedImage>
images API.
final
links API.
final
measuring → bool
Probe pass (IntrinsicHeight). Headings recorded here are discarded.
final
pageFormat → PdfPageFormat
pageFormat API.
final
pageNumber ↔ int
pageNumber API.
getter/setter pair
pagesCount ↔ int
pagesCount API.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subset ↔ FontSubset?
subset API (regular face → /F1).
getter/setter pair
textDirection → TextDirection
textDirection API.
final
theme → ThemeData
theme API.
final
usedCodePoints → Set<int>
usedCodePoints API.
final

Methods

copyWith({ThemeData? theme, TextDirection? textDirection, PdfPageFormat? pageFormat, bool? measuring}) → Context
copyWith API.
embedFor({required bool bold}) → ({String fontName, FontSubset? subset})
Subset + resource name for bold.
faceFor({required bool bold}) → SfntFont?
Face used for measurement / paint for bold.
headingNamed(String title) → PwHeading?
Frozen heading from the previous pass, else one recorded this pass.
nextImageName() → String
nextImageName API.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pageOfHeading(String title) → int?
pageOfHeading API.
placeHeading(String title, double destY) → void
Stamp the first unplaced heading named title with a top-left destY.
registerAnchor(String name, {double destY = 0}) → void
registerAnchor API.
registerHeading(int level, String title, {double destY = 0}) → void
registerHeading API.
restampHeadings({required int from, required int pageNumber, required double destY}) → void
Headings registered during child layout do not yet know their page y.
toString() → String
A string representation of this object.
inherited
useText(String text) → void
useText API.

Operators

operator ==(Object other) → bool
The equality operator.
inherited