drawPageContent method
Parses and interprets content incrementally without retaining a
page-sized ContentOperation list.
This is the preferred path when the content is consumed once. Renderers that deliberately interpret the same page more than once should parse a list once and use drawPageOperations for each pass instead.
Implementation
void drawPageContent(PdfPage page, Uint8List content, {int? operationLimit}) {
_state = _GraphicsState();
_visibilityStack.clear();
_mcidStack.clear();
_pageBox = page.mediaBox;
device.save();
try {
_runCursor(
ContentStreamParser.cursor(content, operationLimit: operationLimit),
page.resources,
0,
);
final mask = _state.softMask;
if (mask != null) _finalizeSoftMask(mask);
} finally {
device.restore();
}
}