(bytes, offset)
| 2842 | * @returns {Uint8Array} |
| 2843 | */ |
| 2844 | export function extractPDF(bytes, offset) { |
| 2845 | const stream = new Stream(bytes.slice(offset)); |
| 2846 | |
| 2847 | // Find end-of-file marker (%%EOF) |
| 2848 | stream.continueUntil([0x25, 0x25, 0x45, 0x4f, 0x46]); |
| 2849 | stream.moveForwardsBy(5); |
| 2850 | stream.consumeIf(0x0d); |
| 2851 | stream.consumeIf(0x0a); |
| 2852 | |
| 2853 | return stream.carve(); |
| 2854 | } |
| 2855 | |
| 2856 | |
| 2857 | /** |
nothing calls this directly
no test coverage detected