1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Re-factor the PDF version parsing in the worker-thread

Part of this is very old code, and back when support for parsing the catalog-version was added things became less clear (in my opinion).
Hence this patch tries to improve things, by e.g. validating the header- and catalog-version separately.
This commit is contained in:
Jonas Jenwald 2022-10-15 11:55:37 +02:00
parent 951564d697
commit d470010293
3 changed files with 25 additions and 26 deletions

View file

@ -26,6 +26,8 @@ import {
import { Dict, isName, Ref, RefSet } from "./primitives.js";
import { BaseStream } from "./base_stream.js";
const PDF_VERSION_REGEXP = /^[1-9]\.\d$/;
function getLookupTableFactory(initializer) {
let lookup;
return function () {
@ -585,6 +587,7 @@ export {
numberToString,
ParserEOFException,
parseXFAPath,
PDF_VERSION_REGEXP,
readInt8,
readUint16,
readUint32,