UNPKG

@syncfusion/ej2-pdf

Version:

Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.

81 lines (80 loc) 2.34 kB
import { _PdfCrossReference } from './pdf-cross-reference'; import { _PdfDictionary, _PdfReferenceSetCache, _PdfReference } from './pdf-primitives'; /** * Provides access to the PDF catalog and utilities to traverse and cache the page tree. * * @private */ export declare class _PdfCatalog { private _crossReference; /** * Backing dictionary for the catalog object. * * @private */ _catalogDictionary: _PdfDictionary; pageIndexCache: _PdfReferenceSetCache; pageKidsCountCache: _PdfReferenceSetCache; /** * Root pages dictionary of the document. * * @private */ _topPagesDictionary: _PdfDictionary; /** * List of page indices that have been parsed and cached. * * @private */ _parsedPages: number[]; /** * Cache of page dictionaries and references keyed by page index. * * @private */ _pageCache: Map<number, { dictionary: _PdfDictionary; reference: _PdfReference; parent: _PdfDictionary; }>; /** * Indicates whether the page tree format is invalid and requires linear traversal. * * @private */ _hasInvalidPageTree: boolean; constructor(xref: _PdfCrossReference); readonly version: string; readonly pageCount: number; readonly acroForm: _PdfDictionary; /** * Creates and registers a new AcroForm dictionary on the catalog. * * @private * @returns {_PdfDictionary} The created AcroForm dictionary. */ _createForm(): _PdfDictionary; private _addToCache; /** * Gets the page dictionary and reference for the specified page index, using caches when possible. * * @private * @param {number} pageIndex Zero-based page index to retrieve. * @returns {{ dictionary: _PdfDictionary, reference: _PdfReference }} The page dictionary and its indirect reference (if any). */ _getPageDictionary(pageIndex: number): { dictionary: _PdfDictionary; reference: _PdfReference; }; private _checkPageTreeFormat; private _findNearestIndex; private _traverseFromCached; private _findNextPage; private _traverseFromRoot; /** * Releases catalog and cache resources and clears references. * * @private */ _destroy(): void; }