UNPKG

7.13 kBTypeScriptView Raw
1export type PageViewport = import("../src/display/display_utils").PageViewport;
2export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
3export type EventBus = import("./event_utils").EventBus;
4export type IL10n = import("./interfaces").IL10n;
5export type IPDFAnnotationLayerFactory = import("./interfaces").IPDFAnnotationLayerFactory;
6export type IPDFStructTreeLayerFactory = import("./interfaces").IPDFStructTreeLayerFactory;
7export type IPDFTextLayerFactory = import("./interfaces").IPDFTextLayerFactory;
8export type IPDFXfaLayerFactory = import("./interfaces").IL10n;
9export type IRenderableView = import("./interfaces").IRenderableView;
10export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
11export type PDFPageViewOptions = {
12 /**
13 * - The viewer element.
14 */
15 container?: HTMLDivElement | undefined;
16 /**
17 * - The application event bus.
18 */
19 eventBus: EventBus;
20 /**
21 * - The page unique ID (normally its number).
22 */
23 id: number;
24 /**
25 * - The page scale display.
26 */
27 scale: number;
28 /**
29 * - The page viewport.
30 */
31 defaultViewport: PageViewport;
32 /**
33 * -
34 * A promise that is resolved with an {@link OptionalContentConfig } instance.
35 * The default value is `null`.
36 */
37 optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
38 /**
39 * - The rendering queue object.
40 */
41 renderingQueue: PDFRenderingQueue;
42 textLayerFactory: IPDFTextLayerFactory;
43 /**
44 * - Controls if the text layer used for
45 * selection and searching is created, and if the improved text selection
46 * behaviour is enabled. The constants from {TextLayerMode} should be used.
47 * The default value is `TextLayerMode.ENABLE`.
48 */
49 textLayerMode?: number | undefined;
50 /**
51 * - Controls if the annotation layer is
52 * created, and if interactive form elements or `AnnotationStorage`-data are
53 * being rendered. The constants from {@link AnnotationMode } should be used;
54 * see also {@link RenderParameters } and {@link GetOperatorListParameters }.
55 * The default value is `AnnotationMode.ENABLE_FORMS`.
56 */
57 annotationMode?: number | undefined;
58 annotationLayerFactory: IPDFAnnotationLayerFactory;
59 xfaLayerFactory: IPDFXfaLayerFactory;
60 structTreeLayerFactory: IPDFStructTreeLayerFactory;
61 textHighlighterFactory?: Object | undefined;
62 /**
63 * - Path for image resources, mainly
64 * for annotation icons. Include trailing slash.
65 */
66 imageResourcesPath?: string | undefined;
67 /**
68 * - 'canvas' or 'svg'. The default is 'canvas'.
69 */
70 renderer: string;
71 /**
72 * - Enables CSS only zooming. The default
73 * value is `false`.
74 */
75 useOnlyCssZoom?: boolean | undefined;
76 /**
77 * - The maximum supported canvas size in
78 * total pixels, i.e. width * height. Use -1 for no limit. The default value
79 * is 4096 * 4096 (16 mega-pixels).
80 */
81 maxCanvasPixels?: number | undefined;
82 /**
83 * - Localization service.
84 */
85 l10n: IL10n;
86};
87/**
88 * @implements {IRenderableView}
89 */
90export class PDFPageView implements IRenderableView {
91 /**
92 * @param {PDFPageViewOptions} options
93 */
94 constructor(options: PDFPageViewOptions);
95 id: number;
96 renderingId: string;
97 pdfPage: any;
98 pageLabel: string | null;
99 rotation: number;
100 scale: number;
101 viewport: import("../src/display/display_utils").PageViewport;
102 pdfPageRotate: number;
103 _optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
104 hasRestrictedScaling: boolean;
105 textLayerMode: number;
106 imageResourcesPath: string;
107 useOnlyCssZoom: boolean;
108 maxCanvasPixels: any;
109 eventBus: import("./event_utils").EventBus;
110 renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue;
111 textLayerFactory: import("./interfaces").IPDFTextLayerFactory;
112 annotationLayerFactory: import("./interfaces").IPDFAnnotationLayerFactory;
113 xfaLayerFactory: import("./interfaces").IL10n;
114 textHighlighter: any;
115 structTreeLayerFactory: import("./interfaces").IPDFStructTreeLayerFactory;
116 renderer: string;
117 l10n: import("./interfaces").IL10n;
118 paintTask: {
119 promise: any;
120 onRenderContinue(cont: any): void;
121 cancel(): void;
122 } | null;
123 paintedViewportMap: WeakMap<object, any>;
124 renderingState: number;
125 resume: (() => void) | null;
126 _renderError: any;
127 _isStandalone: boolean;
128 _annotationCanvasMap: any;
129 annotationLayer: any;
130 textLayer: import("./text_layer_builder.js").TextLayerBuilder | null;
131 zoomLayer: ParentNode | null;
132 xfaLayer: any;
133 structTreeLayer: any;
134 div: HTMLDivElement;
135 setPdfPage(pdfPage: any): void;
136 destroy(): void;
137 /**
138 * @private
139 */
140 private _renderAnnotationLayer;
141 /**
142 * @private
143 */
144 private _renderXfaLayer;
145 _buildXfaTextContentItems(textDivs: any): Promise<void>;
146 /**
147 * @private
148 */
149 private _resetZoomLayer;
150 reset({ keepZoomLayer, keepAnnotationLayer, keepXfaLayer, }?: {
151 keepZoomLayer?: boolean | undefined;
152 keepAnnotationLayer?: boolean | undefined;
153 keepXfaLayer?: boolean | undefined;
154 }): void;
155 loadingIconDiv: HTMLDivElement | undefined;
156 update({ scale, rotation, optionalContentConfigPromise }: {
157 scale?: number | undefined;
158 rotation?: null | undefined;
159 optionalContentConfigPromise?: null | undefined;
160 }, ...args: any[]): void;
161 /**
162 * PLEASE NOTE: Most likely you want to use the `this.reset()` method,
163 * rather than calling this one directly.
164 */
165 cancelRendering({ keepAnnotationLayer, keepXfaLayer }?: {
166 keepAnnotationLayer?: boolean | undefined;
167 keepXfaLayer?: boolean | undefined;
168 }): void;
169 _onTextLayerRendered: any;
170 cssTransform({ target, redrawAnnotationLayer, redrawXfaLayer, }: {
171 target: any;
172 redrawAnnotationLayer?: boolean | undefined;
173 redrawXfaLayer?: boolean | undefined;
174 }): void;
175 get width(): number;
176 get height(): number;
177 getPagePoint(x: any, y: any): Object;
178 /**
179 * @ignore
180 */
181 toggleLoadingIconSpinner(viewVisible?: boolean): void;
182 draw(): any;
183 paintOnCanvas(canvasWrapper: any): {
184 promise: any;
185 onRenderContinue(cont: any): void;
186 cancel(): void;
187 };
188 canvas: HTMLCanvasElement | undefined;
189 outputScale: Object | undefined;
190 paintOnSvg(wrapper: any): {
191 promise: any;
192 onRenderContinue(cont: any): void;
193 cancel(): void;
194 };
195 svg: any;
196 /**
197 * @param {string|null} label
198 */
199 setPageLabel(label: string | null): void;
200 #private;
201}
202
\No newline at end of file