base_viewer.d.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
  2. export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
  3. export type PageViewport = import("../src/display/display_utils").PageViewport;
  4. export type EventBus = import("./event_utils").EventBus;
  5. export type IDownloadManager = import("./interfaces").IDownloadManager;
  6. export type IL10n = import("./interfaces").IL10n;
  7. export type IPDFAnnotationLayerFactory = import("./interfaces").IPDFAnnotationLayerFactory;
  8. export type IPDFAnnotationEditorLayerFactory = import("./interfaces").IPDFAnnotationEditorLayerFactory;
  9. export type IPDFLinkService = import("./interfaces").IPDFLinkService;
  10. export type IPDFStructTreeLayerFactory = import("./interfaces").IPDFStructTreeLayerFactory;
  11. export type IPDFTextLayerFactory = import("./interfaces").IPDFTextLayerFactory;
  12. export type IPDFXfaLayerFactory = import("./interfaces").IPDFXfaLayerFactory;
  13. export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
  14. export type PDFViewerOptions = {
  15. /**
  16. * - The container for the viewer element.
  17. */
  18. container: HTMLDivElement;
  19. /**
  20. * - The viewer element.
  21. */
  22. viewer?: HTMLDivElement | undefined;
  23. /**
  24. * - The application event bus.
  25. */
  26. eventBus: EventBus;
  27. /**
  28. * - The navigation/linking service.
  29. */
  30. linkService: IPDFLinkService;
  31. /**
  32. * - The download manager
  33. * component.
  34. */
  35. downloadManager?: import("./interfaces").IDownloadManager | undefined;
  36. /**
  37. * - The find controller
  38. * component.
  39. */
  40. findController?: any;
  41. /**
  42. * - The scripting manager
  43. * component.
  44. */
  45. scriptingManager?: any;
  46. /**
  47. * - The rendering queue object.
  48. */
  49. renderingQueue?: PDFRenderingQueue | undefined;
  50. /**
  51. * - Removes the border shadow around
  52. * the pages. The default value is `false`.
  53. */
  54. removePageBorders?: boolean | undefined;
  55. /**
  56. * - Controls if the text layer used for
  57. * selection and searching is created, and if the improved text selection
  58. * behaviour is enabled. The constants from {TextLayerMode} should be used.
  59. * The default value is `TextLayerMode.ENABLE`.
  60. */
  61. textLayerMode?: number | undefined;
  62. /**
  63. * - Controls if the annotation layer is
  64. * created, and if interactive form elements or `AnnotationStorage`-data are
  65. * being rendered. The constants from {@link AnnotationMode } should be used;
  66. * see also {@link RenderParameters } and {@link GetOperatorListParameters }.
  67. * The default value is `AnnotationMode.ENABLE_FORMS`.
  68. */
  69. annotationMode?: number | undefined;
  70. /**
  71. * - Enables the creation and editing
  72. * of new Annotations. The constants from {@link AnnotationEditorType } should
  73. * be used. The default value is `AnnotationEditorType.DISABLE`.
  74. */
  75. annotationEditorMode?: number | undefined;
  76. /**
  77. * - Path for image resources, mainly
  78. * mainly for annotation icons. Include trailing slash.
  79. */
  80. imageResourcesPath?: string | undefined;
  81. /**
  82. * - Enables automatic rotation of
  83. * landscape pages upon printing. The default is `false`.
  84. */
  85. enablePrintAutoRotate?: boolean | undefined;
  86. /**
  87. * - Enables CSS only zooming. The default
  88. * value is `false`.
  89. */
  90. useOnlyCssZoom?: boolean | undefined;
  91. /**
  92. * - The maximum supported canvas size in
  93. * total pixels, i.e. width * height. Use -1 for no limit. The default value
  94. * is 4096 * 4096 (16 mega-pixels).
  95. */
  96. maxCanvasPixels?: number | undefined;
  97. /**
  98. * - Localization service.
  99. */
  100. l10n: IL10n;
  101. /**
  102. * - Enables PDF document permissions,
  103. * when they exist. The default value is `false`.
  104. */
  105. enablePermissions?: boolean | undefined;
  106. /**
  107. * - Overwrites background and foreground colors
  108. * with user defined ones in order to improve readability in high contrast
  109. * mode.
  110. */
  111. pageColors?: Object | undefined;
  112. };
  113. /**
  114. * Simple viewer control to display PDF content/pages.
  115. *
  116. * @implements {IPDFAnnotationLayerFactory}
  117. * @implements {IPDFAnnotationEditorLayerFactory}
  118. * @implements {IPDFStructTreeLayerFactory}
  119. * @implements {IPDFTextLayerFactory}
  120. * @implements {IPDFXfaLayerFactory}
  121. */
  122. export class BaseViewer implements IPDFAnnotationLayerFactory, IPDFAnnotationEditorLayerFactory, IPDFStructTreeLayerFactory, IPDFTextLayerFactory, IPDFXfaLayerFactory {
  123. /**
  124. * @param {PDFViewerOptions} options
  125. */
  126. constructor(options: PDFViewerOptions);
  127. container: HTMLDivElement;
  128. viewer: Element | null;
  129. eventBus: import("./event_utils").EventBus;
  130. linkService: import("./interfaces").IPDFLinkService;
  131. downloadManager: import("./interfaces").IDownloadManager | null;
  132. findController: any;
  133. _scriptingManager: any;
  134. removePageBorders: boolean;
  135. textLayerMode: number;
  136. imageResourcesPath: string;
  137. enablePrintAutoRotate: boolean;
  138. renderer: any;
  139. useOnlyCssZoom: boolean;
  140. maxCanvasPixels: number | undefined;
  141. l10n: import("./interfaces").IL10n;
  142. pageColors: Object | null;
  143. defaultRenderingQueue: boolean;
  144. renderingQueue: PDFRenderingQueue | undefined;
  145. scroll: {
  146. right: boolean;
  147. down: boolean;
  148. lastX: any;
  149. lastY: any;
  150. _eventHandler: (evt: any) => void;
  151. };
  152. presentationModeState: number;
  153. _onBeforeDraw: ((evt: any) => void) | null;
  154. _onAfterDraw: any;
  155. get pagesCount(): number;
  156. getPageView(index: any): any;
  157. /**
  158. * @type {boolean} - True if all {PDFPageView} objects are initialized.
  159. */
  160. get pageViewsReady(): boolean;
  161. /**
  162. * @type {boolean}
  163. */
  164. get renderForms(): boolean;
  165. /**
  166. * @type {boolean}
  167. */
  168. get enableScripting(): boolean;
  169. /**
  170. * @param {number} val - The page number.
  171. */
  172. set currentPageNumber(arg: number);
  173. /**
  174. * @type {number}
  175. */
  176. get currentPageNumber(): number;
  177. /**
  178. * @returns {boolean} Whether the pageNumber is valid (within bounds).
  179. * @private
  180. */
  181. private _setCurrentPageNumber;
  182. _currentPageNumber: any;
  183. /**
  184. * @param {string} val - The page label.
  185. */
  186. set currentPageLabel(arg: string | null);
  187. /**
  188. * @type {string|null} Returns the current page label, or `null` if no page
  189. * labels exist.
  190. */
  191. get currentPageLabel(): string | null;
  192. /**
  193. * @param {number} val - Scale of the pages in percents.
  194. */
  195. set currentScale(arg: number);
  196. /**
  197. * @type {number}
  198. */
  199. get currentScale(): number;
  200. /**
  201. * @param val - The scale of the pages (in percent or predefined value).
  202. */
  203. set currentScaleValue(arg: string);
  204. /**
  205. * @type {string}
  206. */
  207. get currentScaleValue(): string;
  208. /**
  209. * @param {number} rotation - The rotation of the pages (0, 90, 180, 270).
  210. */
  211. set pagesRotation(arg: number);
  212. /**
  213. * @type {number}
  214. */
  215. get pagesRotation(): number;
  216. _pagesRotation: any;
  217. get firstPagePromise(): any;
  218. get onePageRendered(): any;
  219. get pagesPromise(): any;
  220. /**
  221. * @param {PDFDocumentProxy} pdfDocument
  222. */
  223. setDocument(pdfDocument: PDFDocumentProxy): void;
  224. pdfDocument: import("../src/display/api").PDFDocumentProxy | undefined;
  225. _scrollMode: any;
  226. _optionalContentConfigPromise: Promise<any> | Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | null | undefined;
  227. /**
  228. * @param {Array|null} labels
  229. */
  230. setPageLabels(labels: any[] | null): void;
  231. _pageLabels: any[] | null | undefined;
  232. _resetView(): void;
  233. _pages: any[] | undefined;
  234. _currentScale: any;
  235. _currentScaleValue: any;
  236. _location: {
  237. pageNumber: any;
  238. scale: any;
  239. top: number;
  240. left: number;
  241. rotation: any;
  242. pdfOpenParams: string;
  243. } | null | undefined;
  244. _firstPageCapability: any;
  245. _onePageRenderedCapability: any;
  246. _pagesCapability: any;
  247. _previousScrollMode: any;
  248. _spreadMode: any;
  249. _scrollUpdate(): void;
  250. _setScaleUpdatePages(newScale: any, newValue: any, noScroll?: boolean, preset?: boolean): void;
  251. /**
  252. * @private
  253. */
  254. private get _pageWidthScaleFactor();
  255. _setScale(value: any, noScroll?: boolean): void;
  256. /**
  257. * @param {string} label - The page label.
  258. * @returns {number|null} The page number corresponding to the page label,
  259. * or `null` when no page labels exist and/or the input is invalid.
  260. */
  261. pageLabelToPageNumber(label: string): number | null;
  262. /**
  263. * @typedef {Object} ScrollPageIntoViewParameters
  264. * @property {number} pageNumber - The page number.
  265. * @property {Array} [destArray] - The original PDF destination array, in the
  266. * format: <page-ref> </XYZ|/FitXXX> <args..>
  267. * @property {boolean} [allowNegativeOffset] - Allow negative page offsets.
  268. * The default value is `false`.
  269. * @property {boolean} [ignoreDestinationZoom] - Ignore the zoom argument in
  270. * the destination array. The default value is `false`.
  271. */
  272. /**
  273. * Scrolls page into view.
  274. * @param {ScrollPageIntoViewParameters} params
  275. */
  276. scrollPageIntoView({ pageNumber, destArray, allowNegativeOffset, ignoreDestinationZoom, }: {
  277. /**
  278. * - The page number.
  279. */
  280. pageNumber: number;
  281. /**
  282. * - The original PDF destination array, in the
  283. * format: <page-ref> </XYZ|/FitXXX> <args..>
  284. */
  285. destArray?: any[] | undefined;
  286. /**
  287. * - Allow negative page offsets.
  288. * The default value is `false`.
  289. */
  290. allowNegativeOffset?: boolean | undefined;
  291. /**
  292. * - Ignore the zoom argument in
  293. * the destination array. The default value is `false`.
  294. */
  295. ignoreDestinationZoom?: boolean | undefined;
  296. }): void;
  297. _updateLocation(firstPage: any): void;
  298. update(): void;
  299. containsElement(element: any): boolean;
  300. focus(): void;
  301. get _isContainerRtl(): boolean;
  302. get isInPresentationMode(): boolean;
  303. get isChangingPresentationMode(): boolean;
  304. get isHorizontalScrollbarEnabled(): boolean;
  305. get isVerticalScrollbarEnabled(): boolean;
  306. _getVisiblePages(): Object;
  307. /**
  308. * @param {number} pageNumber
  309. */
  310. isPageVisible(pageNumber: number): any;
  311. /**
  312. * @param {number} pageNumber
  313. */
  314. isPageCached(pageNumber: number): any;
  315. cleanup(): void;
  316. /**
  317. * @private
  318. */
  319. private _cancelRendering;
  320. forceRendering(currentlyVisiblePages: any): boolean;
  321. /**
  322. * @typedef {Object} CreateTextLayerBuilderParameters
  323. * @property {HTMLDivElement} textLayerDiv
  324. * @property {number} pageIndex
  325. * @property {PageViewport} viewport
  326. * @property {boolean} [enhanceTextSelection]
  327. * @property {EventBus} eventBus
  328. * @property {TextHighlighter} highlighter
  329. * @property {TextAccessibilityManager} [accessibilityManager]
  330. */
  331. /**
  332. * @param {CreateTextLayerBuilderParameters}
  333. * @returns {TextLayerBuilder}
  334. */
  335. createTextLayerBuilder({ textLayerDiv, pageIndex, viewport, enhanceTextSelection, eventBus, highlighter, accessibilityManager, }: {
  336. textLayerDiv: HTMLDivElement;
  337. pageIndex: number;
  338. viewport: PageViewport;
  339. enhanceTextSelection?: boolean | undefined;
  340. eventBus: EventBus;
  341. highlighter: TextHighlighter;
  342. accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
  343. }): TextLayerBuilder;
  344. /**
  345. * @typedef {Object} CreateTextHighlighterParameters
  346. * @property {number} pageIndex
  347. * @property {EventBus} eventBus
  348. */
  349. /**
  350. * @param {CreateTextHighlighterParameters}
  351. * @returns {TextHighlighter}
  352. */
  353. createTextHighlighter({ pageIndex, eventBus }: {
  354. pageIndex: number;
  355. eventBus: EventBus;
  356. }): TextHighlighter;
  357. /**
  358. * @typedef {Object} CreateAnnotationLayerBuilderParameters
  359. * @property {HTMLDivElement} pageDiv
  360. * @property {PDFPageProxy} pdfPage
  361. * @property {AnnotationStorage} [annotationStorage] - Storage for annotation
  362. * data in forms.
  363. * @property {string} [imageResourcesPath] - Path for image resources, mainly
  364. * for annotation icons. Include trailing slash.
  365. * @property {boolean} renderForms
  366. * @property {IL10n} l10n
  367. * @property {boolean} [enableScripting]
  368. * @property {Promise<boolean>} [hasJSActionsPromise]
  369. * @property {Object} [mouseState]
  370. * @property {Promise<Object<string, Array<Object>> | null>}
  371. * [fieldObjectsPromise]
  372. * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some
  373. * annotation ids with canvases used to render them.
  374. * @property {TextAccessibilityManager} [accessibilityManager]
  375. */
  376. /**
  377. * @param {CreateAnnotationLayerBuilderParameters}
  378. * @returns {AnnotationLayerBuilder}
  379. */
  380. createAnnotationLayerBuilder({ pageDiv, pdfPage, annotationStorage, imageResourcesPath, renderForms, l10n, enableScripting, hasJSActionsPromise, mouseState, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, }: {
  381. pageDiv: HTMLDivElement;
  382. pdfPage: PDFPageProxy;
  383. /**
  384. * - Storage for annotation
  385. * data in forms.
  386. */
  387. annotationStorage?: any;
  388. /**
  389. * - Path for image resources, mainly
  390. * for annotation icons. Include trailing slash.
  391. */
  392. imageResourcesPath?: string | undefined;
  393. renderForms: boolean;
  394. l10n: IL10n;
  395. enableScripting?: boolean | undefined;
  396. hasJSActionsPromise?: Promise<boolean> | undefined;
  397. mouseState?: Object | undefined;
  398. fieldObjectsPromise?: Promise<{
  399. [x: string]: Object[];
  400. } | null> | undefined;
  401. /**
  402. * - Map some
  403. * annotation ids with canvases used to render them.
  404. */
  405. annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
  406. accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
  407. }): AnnotationLayerBuilder;
  408. /**
  409. * @typedef {Object} CreateAnnotationEditorLayerBuilderParameters
  410. * @property {AnnotationEditorUIManager} [uiManager]
  411. * @property {HTMLDivElement} pageDiv
  412. * @property {PDFPageProxy} pdfPage
  413. * @property {IL10n} l10n
  414. * @property {AnnotationStorage} [annotationStorage] - Storage for annotation
  415. * @property {TextAccessibilityManager} [accessibilityManager]
  416. * data in forms.
  417. */
  418. /**
  419. * @param {CreateAnnotationEditorLayerBuilderParameters}
  420. * @returns {AnnotationEditorLayerBuilder}
  421. */
  422. createAnnotationEditorLayerBuilder({ uiManager, pageDiv, pdfPage, accessibilityManager, l10n, annotationStorage, }: {
  423. uiManager?: any;
  424. pageDiv: HTMLDivElement;
  425. pdfPage: PDFPageProxy;
  426. l10n: IL10n;
  427. /**
  428. * - Storage for annotation
  429. */
  430. annotationStorage?: any;
  431. /**
  432. * data in forms.
  433. */
  434. accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
  435. }): AnnotationEditorLayerBuilder;
  436. /**
  437. * @typedef {Object} CreateXfaLayerBuilderParameters
  438. * @property {HTMLDivElement} pageDiv
  439. * @property {PDFPageProxy} pdfPage
  440. * @property {AnnotationStorage} [annotationStorage] - Storage for annotation
  441. * data in forms.
  442. */
  443. /**
  444. * @param {CreateXfaLayerBuilderParameters}
  445. * @returns {XfaLayerBuilder}
  446. */
  447. createXfaLayerBuilder({ pageDiv, pdfPage, annotationStorage, }: {
  448. pageDiv: HTMLDivElement;
  449. pdfPage: PDFPageProxy;
  450. /**
  451. * - Storage for annotation
  452. * data in forms.
  453. */
  454. annotationStorage?: any;
  455. }): XfaLayerBuilder;
  456. /**
  457. * @typedef {Object} CreateStructTreeLayerBuilderParameters
  458. * @property {PDFPageProxy} pdfPage
  459. */
  460. /**
  461. * @param {CreateStructTreeLayerBuilderParameters}
  462. * @returns {StructTreeLayerBuilder}
  463. */
  464. createStructTreeLayerBuilder({ pdfPage }: {
  465. pdfPage: PDFPageProxy;
  466. }): StructTreeLayerBuilder;
  467. /**
  468. * @type {boolean} Whether all pages of the PDF document have identical
  469. * widths and heights.
  470. */
  471. get hasEqualPageSizes(): boolean;
  472. /**
  473. * Returns sizes of the pages.
  474. * @returns {Array} Array of objects with width/height/rotation fields.
  475. */
  476. getPagesOverview(): any[];
  477. /**
  478. * @param {Promise<OptionalContentConfig>} promise - A promise that is
  479. * resolved with an {@link OptionalContentConfig} instance.
  480. */
  481. set optionalContentConfigPromise(arg: Promise<any>);
  482. /**
  483. * @type {Promise<OptionalContentConfig | null>}
  484. */
  485. get optionalContentConfigPromise(): Promise<any>;
  486. /**
  487. * @param {number} mode - The direction in which the document pages should be
  488. * laid out within the scrolling container.
  489. * The constants from {ScrollMode} should be used.
  490. */
  491. set scrollMode(arg: number);
  492. /**
  493. * @type {number} One of the values in {ScrollMode}.
  494. */
  495. get scrollMode(): number;
  496. _updateScrollMode(pageNumber?: null): void;
  497. /**
  498. * @param {number} mode - Group the pages in spreads, starting with odd- or
  499. * even-number pages (unless `SpreadMode.NONE` is used).
  500. * The constants from {SpreadMode} should be used.
  501. */
  502. set spreadMode(arg: number);
  503. /**
  504. * @type {number} One of the values in {SpreadMode}.
  505. */
  506. get spreadMode(): number;
  507. _updateSpreadMode(pageNumber?: null): void;
  508. /**
  509. * @private
  510. */
  511. private _getPageAdvance;
  512. /**
  513. * Go to the next page, taking scroll/spread-modes into account.
  514. * @returns {boolean} Whether navigation occured.
  515. */
  516. nextPage(): boolean;
  517. /**
  518. * Go to the previous page, taking scroll/spread-modes into account.
  519. * @returns {boolean} Whether navigation occured.
  520. */
  521. previousPage(): boolean;
  522. /**
  523. * Increase the current zoom level one, or more, times.
  524. * @param {number} [steps] - Defaults to zooming once.
  525. */
  526. increaseScale(steps?: number | undefined): void;
  527. /**
  528. * Decrease the current zoom level one, or more, times.
  529. * @param {number} [steps] - Defaults to zooming once.
  530. */
  531. decreaseScale(steps?: number | undefined): void;
  532. updateContainerHeightCss(): void;
  533. /**
  534. * @param {number} mode - AnnotationEditor mode (None, FreeText, Ink, ...)
  535. */
  536. set annotationEditorMode(arg: number);
  537. /**
  538. * @type {number}
  539. */
  540. get annotationEditorMode(): number;
  541. set annotationEditorParams(arg: any);
  542. refresh(): void;
  543. #private;
  544. }
  545. export namespace PagesCountLimit {
  546. const FORCE_SCROLL_MODE_PAGE: number;
  547. const FORCE_LAZY_PAGE_INIT: number;
  548. const PAUSE_EAGER_PAGE_INIT: number;
  549. }
  550. /**
  551. * @typedef {Object} PDFViewerOptions
  552. * @property {HTMLDivElement} container - The container for the viewer element.
  553. * @property {HTMLDivElement} [viewer] - The viewer element.
  554. * @property {EventBus} eventBus - The application event bus.
  555. * @property {IPDFLinkService} linkService - The navigation/linking service.
  556. * @property {IDownloadManager} [downloadManager] - The download manager
  557. * component.
  558. * @property {PDFFindController} [findController] - The find controller
  559. * component.
  560. * @property {PDFScriptingManager} [scriptingManager] - The scripting manager
  561. * component.
  562. * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.
  563. * @property {boolean} [removePageBorders] - Removes the border shadow around
  564. * the pages. The default value is `false`.
  565. * @property {number} [textLayerMode] - Controls if the text layer used for
  566. * selection and searching is created, and if the improved text selection
  567. * behaviour is enabled. The constants from {TextLayerMode} should be used.
  568. * The default value is `TextLayerMode.ENABLE`.
  569. * @property {number} [annotationMode] - Controls if the annotation layer is
  570. * created, and if interactive form elements or `AnnotationStorage`-data are
  571. * being rendered. The constants from {@link AnnotationMode} should be used;
  572. * see also {@link RenderParameters} and {@link GetOperatorListParameters}.
  573. * The default value is `AnnotationMode.ENABLE_FORMS`.
  574. * @property {number} [annotationEditorMode] - Enables the creation and editing
  575. * of new Annotations. The constants from {@link AnnotationEditorType} should
  576. * be used. The default value is `AnnotationEditorType.DISABLE`.
  577. * @property {string} [imageResourcesPath] - Path for image resources, mainly
  578. * mainly for annotation icons. Include trailing slash.
  579. * @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
  580. * landscape pages upon printing. The default is `false`.
  581. * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default
  582. * value is `false`.
  583. * @property {number} [maxCanvasPixels] - The maximum supported canvas size in
  584. * total pixels, i.e. width * height. Use -1 for no limit. The default value
  585. * is 4096 * 4096 (16 mega-pixels).
  586. * @property {IL10n} l10n - Localization service.
  587. * @property {boolean} [enablePermissions] - Enables PDF document permissions,
  588. * when they exist. The default value is `false`.
  589. * @property {Object} [pageColors] - Overwrites background and foreground colors
  590. * with user defined ones in order to improve readability in high contrast
  591. * mode.
  592. */
  593. export class PDFPageViewBuffer {
  594. constructor(size: any);
  595. push(view: any): void;
  596. /**
  597. * After calling resize, the size of the buffer will be `newSize`.
  598. * The optional parameter `idsToKeep` is, if present, a Set of page-ids to
  599. * push to the back of the buffer, delaying their destruction. The size of
  600. * `idsToKeep` has no impact on the final size of the buffer; if `idsToKeep`
  601. * is larger than `newSize`, some of those pages will be destroyed anyway.
  602. */
  603. resize(newSize: any, idsToKeep?: null): void;
  604. has(view: any): boolean;
  605. [Symbol.iterator](): IterableIterator<any>;
  606. #private;
  607. }
  608. import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
  609. import { TextHighlighter } from "./text_highlighter.js";
  610. import { TextLayerBuilder } from "./text_layer_builder.js";
  611. import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
  612. import { AnnotationEditorLayerBuilder } from "./annotation_editor_layer_builder.js";
  613. import { XfaLayerBuilder } from "./xfa_layer_builder.js";
  614. import { StructTreeLayerBuilder } from "./struct_tree_layer_builder.js";