* Extract all text from a content stream. * * @param contentBytes - The raw content stream bytes * @returns Array of extracted characters with positions
(contentBytes: Uint8Array)
| 47 | * @returns Array of extracted characters with positions |
| 48 | */ |
| 49 | extract(contentBytes: Uint8Array): ExtractedChar[] { |
| 50 | const parser = new ContentStreamParser(contentBytes); |
| 51 | const { operations } = parser.parse(); |
| 52 | |
| 53 | for (const op of operations) { |
| 54 | this.processOperation(op); |
| 55 | } |
| 56 | |
| 57 | return this.chars; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Process a single content stream operation. |
no test coverage detected