Creates a new PDF decoder.
Optionaloptions: { ignoreWhitespace?: boolean; maxBufferSizeBytes?: number }Configuration options
OptionalignoreWhitespace?: booleanIf true, whitespace tokens are ignored
OptionalmaxBufferSizeBytes?: numberMaximum buffer size before compaction (default: 10MB)
ProtectedbufferBuffer holding input items
ProtectedbufferCurrent position in the buffer
Whether end of file has been signaled
ProtectedinputCurrent position in the input stream
ProtectedoutputNumber of outputs generated
ProtectedatChecks if end of file has been reached and buffer is exhausted.
True if no more input is available
ProtectedbufferProtectedcanOverride to customize when to compact the buffer By default, compacts when more than 1000 items have been consumed
boolean indicating whether to compact the buffer
ProtectedcompactCompacts the buffer by removing consumed items
ProtectedexpectProtectednextGenerates parsed output items from the buffer. Handles backtracking when more input is needed.
A generator yielding parsed output items
ProtectedoneProtectedparseAbstract method to parse the next output item from the buffer. Subclasses must implement this to define parsing logic.
The parsed output item
ProtectedpeekPeeks at an item in the buffer without consuming it.
Number of positions to look ahead (default: 0)
The item at the peek position, or null if at EOF
Decodes PDF tokens into PDF objects. Handles parsing of all PDF object types including dictionaries, arrays, streams, and xref tables.