diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 660630ce9..9aadc4649 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -3405,7 +3405,12 @@ class PartialEvaluator { } else if (encoding instanceof Name) { baseEncodingName = encoding.name; } else { - throw new FormatError("Encoding is not a Name nor a Dict"); + const msg = "Encoding is not a Name nor a Dict"; + + if (!this.options.ignoreErrors) { + throw new FormatError(msg); + } + warn(msg); } // According to table 114 if the encoding is a named encoding it must be // one of these predefined encodings. diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 2306c1674..51f3ded88 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -129,6 +129,7 @@ !asciihexdecode.pdf !bug766086.pdf !bug793632.pdf +!issue14821.pdf !bug1020858.pdf !prefilled_f1040.pdf !bug1050040.pdf diff --git a/test/pdfs/issue14821.pdf b/test/pdfs/issue14821.pdf new file mode 100644 index 000000000..71c50726a Binary files /dev/null and b/test/pdfs/issue14821.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 9465e2712..f780d69c4 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -3612,6 +3612,12 @@ "rounds": 1, "type": "eq" }, + { "id": "issue14821", + "file": "pdfs/issue14821.pdf", + "md5": "ae77afb0f98c62e6b7fe7f912c84a75c", + "rounds": 1, + "type": "eq" + }, { "id": "issue6165", "file": "pdfs/issue6165.pdf",