Content-stream layer: decoded Uint8Array → typed ops → gstate / text / colour applied, plus typed XObjects.

Module Returns Deps Description
pdfContentOps { OPS, OP_NAMES, lookupOp, isOp } none Operator table §8.2 + §9.4.
pdfContentStream { parseContentStream } pdfErrors, pdfParser, pdfContentOps Bytes → ops §7.8.
pdfGraphics { GStateStack, createStack, applyOp, initialGState, mulCtm } pdfErrors Graphics-state stack §8.4.
pdfText { setFont, beginTextObject, td, tdSetLeading, setTextMatrix, nextLine, rawStringBytes, extractText } pdfErrors Text state + Tm/Tlm §9.3.
pdfColor { applyColorOp } pdfErrors Colour §8.6.
pdfImages { typeImageXObject, typeFormXObject, typeXObject } pdfErrors, pdfParser XObjects §8.9 / §8.10.

Common pattern

const cs = runtime.resolve('pdfContentStream');
const g  = runtime.resolve('pdfGraphics');
const ops = cs.parseContentStream(decodedBytes);
const stack = g.createStack();
for (const op of ops) g.applyOp(stack, op);

See also