(bytes: Uint8Array)
| 176 | * @returns True if bytes start with "%PDF-" |
| 177 | */ |
| 178 | export function isPdfHeader(bytes: Uint8Array) { |
| 179 | // %PDF- = 0x25 0x50 0x44 0x46 0x2D |
| 180 | |
| 181 | return ( |
| 182 | // Fix: String.fromCharCode(...bytes) expects numbers, and map returns string[] |
| 183 | String.fromCharCode(...bytes.slice(0, 5)) === "%PDF-" |
| 184 | ); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * Find the PDF version from the header. |
no test coverage detected