(s: string)
| 206 | } |
| 207 | |
| 208 | function decodeHex(s: string): string { |
| 209 | const clean = s.replace(/\s+/g, ''); |
| 210 | // Pad odd length per PDF spec |
| 211 | const padded = clean.length % 2 === 0 ? clean : clean + '0'; |
| 212 | let result = ''; |
| 213 | for (let i = 0; i < padded.length; i += 2) { |
| 214 | const code = parseInt(padded.slice(i, i + 2), 16); |
| 215 | if (!isNaN(code)) result += String.fromCharCode(code); |
| 216 | } |
| 217 | return result; |
| 218 | } |
| 219 | |
| 220 | function parsePageRange(spec: string, total: number): Set<number> { |
| 221 | const wanted = new Set<number>(); |
no outgoing calls
no test coverage detected