StripPdfDevice constructor
StripPdfDevice(})
precomputed feeds the device a worker-binned StripPlan instead of
binning locally: generator feeds are skipped entirely and each flush
point consumes the plan batch tagged with its ordinal. The plan must
have been binned for this exact geometry - usablePlan guards that
(and the debug-delegate flags, which force local binning) - and
finish verifies the flush-point count and full consumption before
painting anything, throwing StripPlanMismatchError on desync so the
caller can transparently re-run with local binning.
Implementation
factory StripPdfDevice(
ui.Canvas canvas, {
required PdfMatrix pageToDevice,
required int deviceWidth,
required int deviceHeight,
required double pixelRatio,
Map<Object, ui.Image> images = const {},
StripPlan? precomputed,
double slugMinGlyphPx = 4,
bool? enableSlugGlyphs,
}) {
final slugEnabled = enableSlugGlyphs ?? slugGlyphs;
return StripPdfDevice._(
canvas,
usablePlan(precomputed,
pageToDevice: pageToDevice,
deviceWidth: deviceWidth,
deviceHeight: deviceHeight,
slugEnabled: slugEnabled),
pageToDevice: pageToDevice,
deviceWidth: deviceWidth,
deviceHeight: deviceHeight,
pixelRatio: pixelRatio,
images: images,
slugMinGlyphPx: slugMinGlyphPx,
slugEnabled: slugEnabled,
);
}