Re-factor the "nested trailer dictionary" check (PR 4731 follow-up)

In the `pr4731.pdf` document the trailer is actually a Stream, rather than the expected Dictionary, hence update the "nested trailer dictionary" check to make that clearer.

*Note:* This is something that I happened to noticed while working on the previous patch.
This commit is contained in:
Jonas Jenwald 2026-07-25 11:59:25 +02:00
parent 1ee8705093
commit a7b7cec2e7

View File

@ -214,7 +214,7 @@ class XRef {
let dict = parser.getObj();
// The pdflib PDF generator can generate a nested trailer dictionary
if (!(dict instanceof Dict) && dict.dict) {
if (dict instanceof BaseStream) {
dict = dict.dict;
}
if (!(dict instanceof Dict)) {