1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Display outlines even if one has no title

Fixes #17856.
This commit is contained in:
Calixte Denizet 2024-03-29 20:58:24 +01:00
parent 55db43966e
commit 136c1faa7f
4 changed files with 42 additions and 2 deletions

View file

@ -324,7 +324,7 @@ class Catalog {
continue;
}
if (!outlineDict.has("Title")) {
throw new FormatError("Invalid outline item encountered.");
warn("Invalid outline item encountered.");
}
const data = { url: null, dest: null, action: null };
@ -357,7 +357,7 @@ class Catalog {
unsafeUrl: data.unsafeUrl,
newWindow: data.newWindow,
setOCGState: data.setOCGState,
title: stringToPDFString(title),
title: typeof title === "string" ? stringToPDFString(title) : "",
color: rgbColor,
count: Number.isInteger(count) ? count : undefined,
bold: !!(flags & 2),