From a7b7cec2e75a749bcc4dce864a306b8bd5b7ff58 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 25 Jul 2026 11:59:25 +0200 Subject: [PATCH] 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. --- src/core/xref.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/xref.js b/src/core/xref.js index 4954a14b4..adcadde48 100644 --- a/src/core/xref.js +++ b/src/core/xref.js @@ -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)) {