UNPKG

@lillallol/outline-pdf

Version:

High level API to add outline to a pdf without any dependency on other programming languages. Works in both browser and node.

16 lines (15 loc) 671 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createOutlineDictFactory = void 0; function createOutlineDictFactory(_) { const { PDFDict, PDFName } = _; return function createOutlineDict(doc, _) { const outlinesDictMap = new Map(); outlinesDictMap.set(PDFName.Type, PDFName.of("Outlines")); outlinesDictMap.set(PDFName.of("First"), _.First); outlinesDictMap.set(PDFName.of("Last"), _.Last); outlinesDictMap.set(PDFName.of("Count"), _.Count); return PDFDict.fromMapWithContext(outlinesDictMap, doc.context); }; } exports.createOutlineDictFactory = createOutlineDictFactory;