mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #10890 from Snuffleupagus/outline-items-hidden
Add support for outline items, in the default viewer, which default to collapsed when the outline is built
This commit is contained in:
commit
06b253d609
3 changed files with 13 additions and 7 deletions
|
@ -144,6 +144,7 @@ class Catalog {
|
|||
const title = outlineDict.get('Title');
|
||||
const flags = outlineDict.get('F') || 0;
|
||||
const color = outlineDict.getArray('C');
|
||||
const count = outlineDict.get('Count');
|
||||
let rgbColor = blackColor;
|
||||
|
||||
// We only need to parse the color when it's valid, and non-default.
|
||||
|
@ -159,7 +160,7 @@ class Catalog {
|
|||
newWindow: data.newWindow,
|
||||
title: stringToPDFString(title),
|
||||
color: rgbColor,
|
||||
count: outlineDict.get('Count'),
|
||||
count: Number.isInteger(count) ? count : undefined,
|
||||
bold: !!(flags & 2),
|
||||
italic: !!(flags & 1),
|
||||
items: [],
|
||||
|
|
|
@ -715,6 +715,7 @@ class PDFDocumentProxy {
|
|||
* bold: boolean,
|
||||
* italic: boolean,
|
||||
* color: rgb Uint8ClampedArray,
|
||||
* count: integer or undefined,
|
||||
* dest: dest obj,
|
||||
* url: string,
|
||||
* items: array of more items like this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue