@progress/kendo-angular-pdfviewer 13.0.0-develop.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/NOTICE.txt +654 -0
- package/README.md +32 -0
- package/esm2020/index.mjs +16 -0
- package/esm2020/loader/loader.component.mjs +53 -0
- package/esm2020/localization/custom-messages.component.mjs +38 -0
- package/esm2020/localization/localized-messages.directive.mjs +37 -0
- package/esm2020/localization/messages.mjs +71 -0
- package/esm2020/models/events.mjs +21 -0
- package/esm2020/models/loader-settings.mjs +5 -0
- package/esm2020/models/pdfviewer-context.mjs +5 -0
- package/esm2020/models/toolbar-tool.mjs +5 -0
- package/esm2020/models/zoom-level.mjs +5 -0
- package/esm2020/package-metadata.mjs +15 -0
- package/esm2020/pdfviewer.component.mjs +801 -0
- package/esm2020/pdfviewer.module.mjs +81 -0
- package/esm2020/progress-kendo-angular-pdfviewer.mjs +8 -0
- package/esm2020/toolbar/input-wrapper.component.mjs +63 -0
- package/esm2020/toolbar/search.component.mjs +171 -0
- package/esm2020/toolbar/toolbar-combobox.directive.mjs +43 -0
- package/esm2020/toolbar/toolbar-focusable.directive.mjs +63 -0
- package/esm2020/toolbar/toolbar-navigation.service.mjs +52 -0
- package/esm2020/toolbar/toolbar.component.mjs +460 -0
- package/esm2020/util.mjs +72 -0
- package/fesm2015/progress-kendo-angular-pdfviewer.mjs +1943 -0
- package/fesm2020/progress-kendo-angular-pdfviewer.mjs +1938 -0
- package/index.d.ts +16 -0
- package/loader/loader.component.d.ts +17 -0
- package/localization/custom-messages.component.d.ts +18 -0
- package/localization/localized-messages.directive.d.ts +16 -0
- package/localization/messages.d.ts +113 -0
- package/models/events.d.ts +81 -0
- package/models/loader-settings.d.ts +48 -0
- package/models/pdfviewer-context.d.ts +27 -0
- package/models/toolbar-tool.d.ts +8 -0
- package/models/zoom-level.d.ts +14 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +65 -0
- package/pdfviewer.component.d.ts +228 -0
- package/pdfviewer.module.d.ts +30 -0
- package/progress-kendo-angular-pdfviewer.d.ts +9 -0
- package/schematics/collection.json +12 -0
- package/schematics/ngAdd/index.js +8 -0
- package/schematics/ngAdd/schema.json +24 -0
- package/toolbar/input-wrapper.component.d.ts +21 -0
- package/toolbar/search.component.d.ts +39 -0
- package/toolbar/toolbar-combobox.directive.d.ts +21 -0
- package/toolbar/toolbar-focusable.directive.d.ts +21 -0
- package/toolbar/toolbar-navigation.service.d.ts +23 -0
- package/toolbar/toolbar.component.d.ts +65 -0
- package/util.d.ts +32 -0
|
@@ -0,0 +1,801 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, Renderer2, ViewChild, isDevMode } from '@angular/core';
|
|
6
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
7
|
+
import { packageMetadata } from './package-metadata';
|
|
8
|
+
import { INITIAL_ZOOM_LEVEL, zoomOptionsData } from './util';
|
|
9
|
+
import { loadPDF, removeChildren, currentPage, scrollToPage, Scroller, reloadDocument, print, calculateZoomLevel, SearchService, goToNextSearchMatch, goToPreviousSearchMatch } from '@progress/kendo-pdfviewer-common';
|
|
10
|
+
import { hasObservers } from '@progress/kendo-angular-common';
|
|
11
|
+
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
12
|
+
import { PDFViewerDownloadEvent } from './models/events';
|
|
13
|
+
import { saveAs } from '@progress/kendo-file-saver';
|
|
14
|
+
import { Subscription } from 'rxjs';
|
|
15
|
+
import 'pdfjs-dist/build/pdf.worker.entry';
|
|
16
|
+
import * as i0 from "@angular/core";
|
|
17
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
18
|
+
import * as i2 from "./loader/loader.component";
|
|
19
|
+
import * as i3 from "./toolbar/toolbar.component";
|
|
20
|
+
import * as i4 from "./toolbar/search.component";
|
|
21
|
+
import * as i5 from "./localization/localized-messages.directive";
|
|
22
|
+
import * as i6 from "@angular/common";
|
|
23
|
+
let counter = 0;
|
|
24
|
+
/**
|
|
25
|
+
* Represents the [Kendo UI PDFViewer component for Angular]({% slug overview_pdfviewer %}).
|
|
26
|
+
*/
|
|
27
|
+
export class PDFViewerComponent {
|
|
28
|
+
constructor(ngZone, renderer, localizationService) {
|
|
29
|
+
this.ngZone = ngZone;
|
|
30
|
+
this.renderer = renderer;
|
|
31
|
+
this.localizationService = localizationService;
|
|
32
|
+
this.hostClass = true;
|
|
33
|
+
/**
|
|
34
|
+
* Represents the tools collection rendered in the toolbar.
|
|
35
|
+
* @default ['pager', 'spacer', 'zoomInOut', 'zoom', 'selection', 'spacer', 'search', 'open', 'download', 'print' ]
|
|
36
|
+
*/
|
|
37
|
+
this.tools = [
|
|
38
|
+
'pager',
|
|
39
|
+
'spacer',
|
|
40
|
+
'zoomInOut',
|
|
41
|
+
'zoom',
|
|
42
|
+
'selection',
|
|
43
|
+
'spacer',
|
|
44
|
+
'search',
|
|
45
|
+
'open',
|
|
46
|
+
'download',
|
|
47
|
+
'print'
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* The configuration of the internal Loader component.
|
|
51
|
+
* @default { size: 'large', type: 'pulsing', themeColor: 'primary' }
|
|
52
|
+
*/
|
|
53
|
+
this.loaderSettings = {
|
|
54
|
+
size: 'large',
|
|
55
|
+
type: 'pulsing',
|
|
56
|
+
themeColor: 'primary'
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The name of the file that will be saved when the end user clicks the Download tool.
|
|
60
|
+
* @default 'Download'
|
|
61
|
+
*/
|
|
62
|
+
this.saveFileName = 'Download';
|
|
63
|
+
/**
|
|
64
|
+
* Represents the options for saving the file when the end user clicks the Download tool.
|
|
65
|
+
* @default {}
|
|
66
|
+
*/
|
|
67
|
+
this.saveOptions = {};
|
|
68
|
+
/**
|
|
69
|
+
* The initial zoom level of the PDF document.
|
|
70
|
+
*
|
|
71
|
+
* @default 1.25
|
|
72
|
+
*/
|
|
73
|
+
this.zoom = INITIAL_ZOOM_LEVEL;
|
|
74
|
+
/**
|
|
75
|
+
* Represents the step the zoom level will be changed with when using the ZoomIn and ZoomOut tools.
|
|
76
|
+
* @default 0.25
|
|
77
|
+
*/
|
|
78
|
+
this.zoomRate = 0.25;
|
|
79
|
+
/**
|
|
80
|
+
* Represents minimum allowed zoom value.
|
|
81
|
+
* @default 0.5
|
|
82
|
+
*/
|
|
83
|
+
this.minZoom = 0.5;
|
|
84
|
+
/**
|
|
85
|
+
* Represents maximum allowed zoom value.
|
|
86
|
+
* @default 4
|
|
87
|
+
*/
|
|
88
|
+
this.maxZoom = 4;
|
|
89
|
+
/**
|
|
90
|
+
* The event fired when a PDF document is successfully loaded in the `PDFViewer` component.
|
|
91
|
+
*/
|
|
92
|
+
this.load = new EventEmitter();
|
|
93
|
+
/**
|
|
94
|
+
* The event fired when an error occurs during the loading or downloading of the PDF document.
|
|
95
|
+
*/
|
|
96
|
+
this.error = new EventEmitter();
|
|
97
|
+
/**
|
|
98
|
+
* The event fired when an error occurs during the loading of the PDF document.
|
|
99
|
+
*/
|
|
100
|
+
this.download = new EventEmitter();
|
|
101
|
+
/**
|
|
102
|
+
* The event fired when the end user changes the page of the loaded PDF document.
|
|
103
|
+
*/
|
|
104
|
+
this.pageChange = new EventEmitter();
|
|
105
|
+
/**
|
|
106
|
+
* The event fired when the end user changes the zoom level of the loaded PDF document.
|
|
107
|
+
*/
|
|
108
|
+
this.zoomLevelChange = new EventEmitter();
|
|
109
|
+
this.loading = false;
|
|
110
|
+
this.searchActive = false;
|
|
111
|
+
this.matchCase = false;
|
|
112
|
+
this.currentMatches = [];
|
|
113
|
+
this.skip = 0;
|
|
114
|
+
this.zoomOptionsData = zoomOptionsData;
|
|
115
|
+
this.zoomLevel = this.zoomOptionsData[5];
|
|
116
|
+
this._pdfContext = null;
|
|
117
|
+
this._enabedSelection = false;
|
|
118
|
+
this.subs = new Subscription();
|
|
119
|
+
this.scrollListener = (e) => {
|
|
120
|
+
const nextPage = currentPage(e.target.parentNode);
|
|
121
|
+
if (nextPage !== this.skip) {
|
|
122
|
+
this.ngZone.run(() => {
|
|
123
|
+
hasObservers(this.pageChange) && this.pageChange.emit({
|
|
124
|
+
previousPage: this.currentPage,
|
|
125
|
+
currentPage: nextPage + 1
|
|
126
|
+
});
|
|
127
|
+
this.skip = nextPage;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
validatePackage(packageMetadata);
|
|
132
|
+
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
133
|
+
counter++;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Returns the current page number of the loaded PDF document.
|
|
137
|
+
*/
|
|
138
|
+
get currentPage() {
|
|
139
|
+
const isDocumentLoaded = this.pagesContainer && this.pdfContext?.pdfDoc;
|
|
140
|
+
return isDocumentLoaded ? this.skip + 1 : null;
|
|
141
|
+
}
|
|
142
|
+
set pdfContext(doc) {
|
|
143
|
+
this._pdfContext = doc;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Exposes the currently loaded `PDF.js` document, its pages, and their DOM element wrapper.
|
|
147
|
+
*/
|
|
148
|
+
get pdfContext() {
|
|
149
|
+
return this._pdfContext;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* @hidden
|
|
153
|
+
*/
|
|
154
|
+
get activePageId() {
|
|
155
|
+
if (!this.pdfContext?.pdfPages.length) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
return this.pagesContainer.nativeElement.querySelectorAll('.k-page')[this.skip]?.getAttribute('id');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @hidden
|
|
162
|
+
*/
|
|
163
|
+
get pagesContainerId() {
|
|
164
|
+
if (!this.pdfContext?.pdfPages.length) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
return `k-pdfviewer-${counter}-pages-container`;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* @hidden
|
|
171
|
+
*/
|
|
172
|
+
set enabledSelection(value) {
|
|
173
|
+
if (this.pdfScroller) {
|
|
174
|
+
value ? this.pdfScroller.disablePanEventsTracking() : this.pdfScroller.enablePanEventsTracking();
|
|
175
|
+
}
|
|
176
|
+
this._enabedSelection = value;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* @hidden
|
|
180
|
+
*/
|
|
181
|
+
get enabledSelection() {
|
|
182
|
+
return this._enabedSelection;
|
|
183
|
+
}
|
|
184
|
+
ngOnInit() {
|
|
185
|
+
this.subs.add(this.localizationService.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
|
|
186
|
+
}
|
|
187
|
+
ngAfterViewInit() {
|
|
188
|
+
const pagesContainer = this.pagesContainer.nativeElement.parentNode;
|
|
189
|
+
this.ngZone.runOutsideAngular(() => this.subs.add(this.renderer.listen(pagesContainer, 'scroll', this.scrollListener)));
|
|
190
|
+
}
|
|
191
|
+
ngOnDestroy() {
|
|
192
|
+
this.subs.unsubscribe();
|
|
193
|
+
removeChildren(this.pagesContainer.nativeElement);
|
|
194
|
+
if (this.pdfScroller) {
|
|
195
|
+
this.pdfScroller.destroy();
|
|
196
|
+
this.pdfScroller = null;
|
|
197
|
+
}
|
|
198
|
+
if (this.searchService) {
|
|
199
|
+
this.searchService.destroy();
|
|
200
|
+
this.searchService = null;
|
|
201
|
+
}
|
|
202
|
+
this.pdfContext = null;
|
|
203
|
+
}
|
|
204
|
+
ngOnChanges(changes) {
|
|
205
|
+
const newBase64Data = changes['data'] && this.data;
|
|
206
|
+
const newUrl = changes['url'] && this.url;
|
|
207
|
+
const newArrayBuffer = changes['arrayBuffer'] && this.arrayBuffer;
|
|
208
|
+
const newTypedArray = changes['typedArray'] && this.typedArray;
|
|
209
|
+
this.verifySettings(changes);
|
|
210
|
+
const source = newUrl ? 'url' : newArrayBuffer ? 'arrayBuffer' : newBase64Data ? 'data' : 'typedArray';
|
|
211
|
+
if (newUrl || newArrayBuffer || newBase64Data || newTypedArray) {
|
|
212
|
+
this.loadPdf(source, this[source]);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Scrolls the PDFViewer document to the passed page number.
|
|
217
|
+
*/
|
|
218
|
+
scrollToPage(page) {
|
|
219
|
+
scrollToPage(this.pagesContainer.nativeElement, page);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* @hidden
|
|
223
|
+
*/
|
|
224
|
+
onFileSelect(e) {
|
|
225
|
+
this.loadPdf('data', e);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @hidden
|
|
229
|
+
*/
|
|
230
|
+
onFileSelectError(e) {
|
|
231
|
+
hasObservers(this.error) && this.error.emit({ error: e, context: this.pdfContext });
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* @hidden
|
|
235
|
+
*/
|
|
236
|
+
onPageChange(e) {
|
|
237
|
+
this.scrollToPage(e.skip);
|
|
238
|
+
hasObservers(this.pageChange) && this.pageChange.emit({
|
|
239
|
+
previousPage: this.skip,
|
|
240
|
+
currentPage: e.skip
|
|
241
|
+
});
|
|
242
|
+
this.skip = e.skip;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* @hidden
|
|
246
|
+
*/
|
|
247
|
+
onDownload() {
|
|
248
|
+
this.ngZone.runOutsideAngular(() => this.pdfContext.pdfDoc.getData()
|
|
249
|
+
.then((data) => new Blob([data], { type: 'application/pdf' }))
|
|
250
|
+
.then((blob) => {
|
|
251
|
+
const downloadEvent = new PDFViewerDownloadEvent(blob, this.saveFileName, this.saveOptions, this.pdfContext);
|
|
252
|
+
this.ngZone.run(() => this.download.emit(downloadEvent));
|
|
253
|
+
if (!downloadEvent.isDefaultPrevented()) {
|
|
254
|
+
saveAs(blob, this.saveFileName, this.saveOptions);
|
|
255
|
+
}
|
|
256
|
+
})
|
|
257
|
+
.catch((reason) => {
|
|
258
|
+
if (hasObservers(this.error)) {
|
|
259
|
+
this.ngZone.run(() => this.error.emit({
|
|
260
|
+
error: reason,
|
|
261
|
+
context: this.pdfContext
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* @hidden
|
|
268
|
+
*/
|
|
269
|
+
onZoomIn() {
|
|
270
|
+
const newZoom = Math.min(this.pdfContext.zoom + this.zoomRate, this.maxZoom);
|
|
271
|
+
if (newZoom !== this.pdfContext.zoom && this.pdfContext.pdfDoc) {
|
|
272
|
+
if (hasObservers(this.zoomLevelChange)) {
|
|
273
|
+
this.zoomLevelChange.emit({
|
|
274
|
+
previousZoomLevel: this.zoom,
|
|
275
|
+
currentZoomLevel: newZoom
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
this.zoom = this.pdfContext.zoom = newZoom;
|
|
279
|
+
this.setZoomLevel(newZoom);
|
|
280
|
+
this.ngZone.runOutsideAngular(() => this.reloadDocument());
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* @hidden
|
|
285
|
+
*/
|
|
286
|
+
onZoomOut() {
|
|
287
|
+
const newZoom = Math.max(this.pdfContext.zoom - this.zoomRate, this.minZoom);
|
|
288
|
+
if (newZoom !== this.pdfContext.zoom && this.pdfContext.pdfDoc) {
|
|
289
|
+
if (hasObservers(this.zoomLevelChange)) {
|
|
290
|
+
this.zoomLevelChange.emit({
|
|
291
|
+
previousZoomLevel: this.zoom,
|
|
292
|
+
currentZoomLevel: newZoom
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
this.zoom = this.pdfContext.zoom = newZoom;
|
|
296
|
+
this.setZoomLevel(newZoom);
|
|
297
|
+
this.ngZone.runOutsideAngular(() => this.reloadDocument());
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* @hidden
|
|
302
|
+
*/
|
|
303
|
+
onZoomLevelChange(zoomLevel) {
|
|
304
|
+
if (typeof zoomLevel === 'string') {
|
|
305
|
+
const parsedValue = parseFloat(zoomLevel);
|
|
306
|
+
zoomLevel = { value: Number.isNaN(parsedValue) ? 1 : parsedValue / 100 };
|
|
307
|
+
}
|
|
308
|
+
if (!zoomLevel) {
|
|
309
|
+
zoomLevel = { value: 1 };
|
|
310
|
+
}
|
|
311
|
+
let newZoom = calculateZoomLevel(zoomLevel.value, zoomLevel.type, this.pdfContext.zoom, this.pagesContainer.nativeElement);
|
|
312
|
+
newZoom = Math.round(newZoom * 100) / 100;
|
|
313
|
+
if (hasObservers(this.zoomLevelChange)) {
|
|
314
|
+
this.zoomLevelChange.emit({
|
|
315
|
+
previousZoomLevel: this.zoom,
|
|
316
|
+
currentZoomLevel: newZoom
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
this.zoom = this.pdfContext.zoom = newZoom;
|
|
320
|
+
this.setZoomLevel(newZoom);
|
|
321
|
+
this.ngZone.runOutsideAngular(() => this.reloadDocument());
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* @hidden
|
|
325
|
+
*/
|
|
326
|
+
onSearch() {
|
|
327
|
+
this.searchActive = true;
|
|
328
|
+
this.ngZone.runOutsideAngular(() => {
|
|
329
|
+
const pagesTextLayers = Array.from(this.pagesContainer.nativeElement.querySelectorAll('.k-text-layer'));
|
|
330
|
+
this.searchService = new SearchService({
|
|
331
|
+
textContainers: pagesTextLayers || [],
|
|
332
|
+
highlightClass: 'k-search-highlight',
|
|
333
|
+
highlightMarkClass: 'k-search-highlight-mark',
|
|
334
|
+
charClass: 'k-text-char'
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* @hidden
|
|
340
|
+
*/
|
|
341
|
+
onPrint() {
|
|
342
|
+
this.loading = true;
|
|
343
|
+
const onError = (e) => {
|
|
344
|
+
this.loading = false;
|
|
345
|
+
if (hasObservers(this.error)) {
|
|
346
|
+
this.error.emit(e);
|
|
347
|
+
}
|
|
348
|
+
;
|
|
349
|
+
};
|
|
350
|
+
const onDone = () => {
|
|
351
|
+
this.loading = false;
|
|
352
|
+
};
|
|
353
|
+
print(this.pdfContext.pdfPages, onDone, onError);
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* @hidden
|
|
357
|
+
*/
|
|
358
|
+
onSearchChange(e) {
|
|
359
|
+
this.currentMatches = this.searchService.search({ ...e });
|
|
360
|
+
this.currentMatch = this.currentMatches.length ? 1 : 0;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* @hidden
|
|
364
|
+
*/
|
|
365
|
+
closeSearch(toolbar) {
|
|
366
|
+
this.searchActive = false;
|
|
367
|
+
this.searchService.destroy();
|
|
368
|
+
this.currentMatches = [];
|
|
369
|
+
this.currentMatch = null;
|
|
370
|
+
toolbar.focus();
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* @hidden
|
|
374
|
+
*/
|
|
375
|
+
onNextMatch() {
|
|
376
|
+
goToNextSearchMatch({ search: this.searchService, scroller: this.pdfScroller });
|
|
377
|
+
this.currentMatch = this.currentMatch + 1 > this.currentMatches.length ? 1 : this.currentMatch + 1;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* @hidden
|
|
381
|
+
*/
|
|
382
|
+
onPreviousMatch() {
|
|
383
|
+
goToPreviousSearchMatch({ search: this.searchService, scroller: this.pdfScroller });
|
|
384
|
+
this.currentMatch = this.currentMatch - 1 < 1 ? this.currentMatches.length : this.currentMatch - 1;
|
|
385
|
+
}
|
|
386
|
+
loadPdf(dataType, data) {
|
|
387
|
+
this.loading = true;
|
|
388
|
+
this.ngZone.runOutsideAngular(() => setTimeout(() => {
|
|
389
|
+
removeChildren(this.pagesContainer.nativeElement);
|
|
390
|
+
loadPDF({
|
|
391
|
+
[dataType]: data,
|
|
392
|
+
dom: this.pagesContainer.nativeElement,
|
|
393
|
+
zoom: this.pdfContext?.zoom || this.zoom,
|
|
394
|
+
done: (e) => {
|
|
395
|
+
this.ngZone.run(() => {
|
|
396
|
+
this.loading = false;
|
|
397
|
+
this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
|
|
398
|
+
});
|
|
399
|
+
if (this.pdfScroller) {
|
|
400
|
+
this.pdfScroller.destroy();
|
|
401
|
+
}
|
|
402
|
+
this.pdfScroller = this.pdfScroller = new Scroller(this.pagesContainer.nativeElement.parentNode, {
|
|
403
|
+
filter: '.k-page',
|
|
404
|
+
events: {}
|
|
405
|
+
});
|
|
406
|
+
this.pdfScroller.enablePanEventsTracking();
|
|
407
|
+
this.assignPageIds();
|
|
408
|
+
if (hasObservers(this.load)) {
|
|
409
|
+
this.ngZone.run(() => this.load.emit({ context: this.pdfContext }));
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
error: (e) => {
|
|
413
|
+
this.ngZone.run(() => this.loading = false);
|
|
414
|
+
this.pdfContext = null;
|
|
415
|
+
if (hasObservers(this.error)) {
|
|
416
|
+
this.ngZone.run(() => this.error.emit({ error: e, context: this.pdfContext }));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
}));
|
|
421
|
+
}
|
|
422
|
+
reloadDocument() {
|
|
423
|
+
if (this.pagesContainer?.nativeElement) {
|
|
424
|
+
this.ngZone.run(() => this.loading = true);
|
|
425
|
+
removeChildren(this.pagesContainer.nativeElement);
|
|
426
|
+
reloadDocument({
|
|
427
|
+
pdfDoc: this.pdfContext?.pdfDoc,
|
|
428
|
+
zoom: this.zoom,
|
|
429
|
+
dom: this.pagesContainer.nativeElement,
|
|
430
|
+
done: (pdfPages) => {
|
|
431
|
+
this.pdfContext.pdfPages = pdfPages;
|
|
432
|
+
this.ngZone.run(() => this.loading = false);
|
|
433
|
+
this.assignPageIds();
|
|
434
|
+
},
|
|
435
|
+
error: (e) => {
|
|
436
|
+
if (this.pdfScroller) {
|
|
437
|
+
this.pdfScroller.destroy();
|
|
438
|
+
this.pdfScroller = null;
|
|
439
|
+
}
|
|
440
|
+
this.pdfContext = null;
|
|
441
|
+
if (hasObservers(this.error)) {
|
|
442
|
+
this.ngZone.run(() => this.error.emit({ error: e, context: this.pdfContext }));
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
assignPageIds() {
|
|
449
|
+
this.pagesContainer.nativeElement.querySelectorAll('.k-page').forEach((pageElement, index) => {
|
|
450
|
+
const id = `k-pdfviewer-${counter}-page-${index + 1}`;
|
|
451
|
+
this.renderer.setAttribute(pageElement, 'id', id);
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
setZoomLevel(zoom) {
|
|
455
|
+
const option = this.zoomOptionsData.find(item => !item.type && item.value === zoom);
|
|
456
|
+
this.zoomLevel = option || {
|
|
457
|
+
value: zoom,
|
|
458
|
+
displayValue: `${Math.round(zoom * 100)}%`,
|
|
459
|
+
text: `${Math.round(zoom * 100)}%`
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
verifySettings(changes) {
|
|
463
|
+
const sourceTypes = ['url', 'arrayBuffer', 'data', 'typedArray'];
|
|
464
|
+
const setTypes = sourceTypes.map(item => this.isSet(changes, item)).filter(item => item);
|
|
465
|
+
if (isDevMode() && setTypes.length > 1) {
|
|
466
|
+
console.warn(`
|
|
467
|
+
Setting more than one source of data simultaneously is not supported.
|
|
468
|
+
Only one of 'url', 'arrayBuffer', 'data', or 'typedArray' can be set.
|
|
469
|
+
`);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
isSet(changes, source) {
|
|
473
|
+
return this[source] || (changes[source] && changes[source].currentValue);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
PDFViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
477
|
+
PDFViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PDFViewerComponent, selector: "kendo-pdfviewer", inputs: { tools: "tools", loaderSettings: "loaderSettings", saveFileName: "saveFileName", saveOptions: "saveOptions", url: "url", data: "data", arrayBuffer: "arrayBuffer", typedArray: "typedArray", zoom: "zoom", zoomRate: "zoomRate", minZoom: "minZoom", maxZoom: "maxZoom" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction" } }, providers: [
|
|
478
|
+
LocalizationService,
|
|
479
|
+
{
|
|
480
|
+
provide: L10N_PREFIX,
|
|
481
|
+
useValue: 'kendo.pdfviewer'
|
|
482
|
+
}
|
|
483
|
+
], viewQueries: [{ propertyName: "pagesContainer", first: true, predicate: ["pagesContainer"], descendants: true }], exportAs: ["kendo-pdfviewer"], usesOnChanges: true, ngImport: i0, template: `
|
|
484
|
+
<ng-container kendoPDFViewerLocalizedMessages
|
|
485
|
+
i18n-pagerFirstPage="kendo.pdfviewer.pagerFirstPage|The label for the first page button in the Pager"
|
|
486
|
+
pagerFirstPage="Go to the first page"
|
|
487
|
+
|
|
488
|
+
i18n-pagerPreviousPage="kendo.pdfviewer.pagerPreviousPage|The label for the previous page button in the Pager"
|
|
489
|
+
pagerPreviousPage="Go to the previous page"
|
|
490
|
+
|
|
491
|
+
i18n-pagerNextPage="kendo.pdfviewer.pagerNextPage|The label for the next page button in the Pager"
|
|
492
|
+
pagerNextPage="Go to the next page"
|
|
493
|
+
|
|
494
|
+
i18n-pagerLastPage="kendo.pdfviewer.pagerLastPage|The label for the last page button in the Pager"
|
|
495
|
+
pagerLastPage="Go to the last page"
|
|
496
|
+
|
|
497
|
+
i18n-pagerPage="kendo.pdfviewer.pagerPage|The text before the current page number in the Pager"
|
|
498
|
+
pagerPage="Page"
|
|
499
|
+
|
|
500
|
+
i18n-pagerOf="kendo.pdfviewer.pagerOf|The text before the total pages number in the Pager"
|
|
501
|
+
pagerOf="of"
|
|
502
|
+
|
|
503
|
+
i18n-pagerInputTitle="kendo.pdfviewer.pagerInputTitle|The label of the pager input element"
|
|
504
|
+
pagerInputTitle="Page Number"
|
|
505
|
+
|
|
506
|
+
i18n-pagerInputLabel="kendo.pdfviewer.pagerInputLabel|The text of the aria-label attribute applied to the input element for entering the page number."
|
|
507
|
+
pagerInputLabel="Type a page number"
|
|
508
|
+
|
|
509
|
+
i18n-zoomInTitle="kendo.pdfviewer.zoomInTitle|The ZoomIn tool title and label."
|
|
510
|
+
zoomInTitle="Zoom in"
|
|
511
|
+
|
|
512
|
+
i18n-zoomOutTitle="kendo.pdfviewer.zoomOutTitle|The ZoomOut tool title and label."
|
|
513
|
+
zoomOutTitle="Zoom out"
|
|
514
|
+
|
|
515
|
+
i18n-selectionTitle="kendo.pdfviewer.selectionTitle|The Selection tool title and label."
|
|
516
|
+
selectionTitle="Enable selection"
|
|
517
|
+
|
|
518
|
+
i18n-panningTitle="kendo.pdfviewer.panningTitle|The Panning tool title and label."
|
|
519
|
+
panningTitle="Enable panning"
|
|
520
|
+
|
|
521
|
+
i18n-searchTitle="kendo.pdfviewer.searchTitle|The Search tool title and label."
|
|
522
|
+
searchTitle="Search"
|
|
523
|
+
|
|
524
|
+
i18n-openTitle="kendo.pdfviewer.openTitle|The Open tool title and label."
|
|
525
|
+
openTitle="Open"
|
|
526
|
+
|
|
527
|
+
i18n-downloadTitle="kendo.pdfviewer.downloadTitle|The Download tool title and label."
|
|
528
|
+
downloadTitle="Download"
|
|
529
|
+
|
|
530
|
+
i18n-printTitle="kendo.pdfviewer.printTitle|The Print tool title and label."
|
|
531
|
+
printTitle="Print"
|
|
532
|
+
|
|
533
|
+
i18n-fitToPage="kendo.pdfviewer.fitToPage|The text for the zoom level chooser Fit to page option."
|
|
534
|
+
fitToPage="Fit to page"
|
|
535
|
+
|
|
536
|
+
i18n-fitToWidth="kendo.pdfviewer.fitToWidth|The text for the zoom level chooser Fit to width option."
|
|
537
|
+
fitToWidth="Fit to width"
|
|
538
|
+
|
|
539
|
+
i18n-searchInputPlaceholder="kendo.pdfviewer.searchInputPlaceholder|The text for the search input placeholder."
|
|
540
|
+
searchInputPlaceholder="Search"
|
|
541
|
+
|
|
542
|
+
i18n-searchMatchesOf="kendo.pdfviewer.searchMatchesOf|The text before the total number of matches in the Search tool."
|
|
543
|
+
searchMatchesOf="of"
|
|
544
|
+
|
|
545
|
+
i18n-searchPreviousMatchTitle="kendo.pdfviewer.searchPreviousMatchTitle|The title of the Search tool previous match button."
|
|
546
|
+
searchPreviousMatchTitle="Previous match"
|
|
547
|
+
|
|
548
|
+
i18n-searchNextMatchTitle="kendo.pdfviewer.searchNextMatchTitle|The title of the Search tool next match button."
|
|
549
|
+
searchNextMatchTitle="Next match"
|
|
550
|
+
|
|
551
|
+
i18n-searchCloseTitle="kendo.pdfviewer.searchCloseTitle|The title of the Search tool close button."
|
|
552
|
+
searchCloseTitle="Close"
|
|
553
|
+
|
|
554
|
+
i18n-searchMatchCaseTitle="kendo.pdfviewer.searchMatchCaseTitle|The title of the Search tool match case button."
|
|
555
|
+
searchMatchCaseTitle="Match case"
|
|
556
|
+
|
|
557
|
+
i18n-zoomInputPlaceholder="kendo.pdfviewer.zoomInputPlaceholder|The text for the zoom tool input placeholder."
|
|
558
|
+
zoomInputPlaceholder="Choose zoom level">
|
|
559
|
+
</ng-container>
|
|
560
|
+
<div loader
|
|
561
|
+
*ngIf="loading"
|
|
562
|
+
[settings]="loaderSettings"></div>
|
|
563
|
+
<div toolbar
|
|
564
|
+
#toolbar
|
|
565
|
+
role="toolbar"
|
|
566
|
+
[attr.aria-controls]="pagesContainerId"
|
|
567
|
+
[tools]="tools"
|
|
568
|
+
[skip]="skip"
|
|
569
|
+
[total]="pdfContext?.pdfPages.length ? pdfContext?.pdfPages.length : 1"
|
|
570
|
+
[pageSize]="1"
|
|
571
|
+
[zoomInDisabled]="zoom >= maxZoom || !pdfContext?.pdfDoc"
|
|
572
|
+
[zoomOutDisabled]="zoom <= minZoom || !pdfContext?.pdfDoc"
|
|
573
|
+
[zoomOptionsData]="zoomOptionsData"
|
|
574
|
+
[zoomLevelChooserValue]="zoomLevel"
|
|
575
|
+
[disabledTools]="!pdfContext?.pdfDoc"
|
|
576
|
+
(pageChange)="onPageChange($event)"
|
|
577
|
+
(fileSelect)="onFileSelect($event)"
|
|
578
|
+
(fileSelectError)="onFileSelectError($event)"
|
|
579
|
+
(download)="onDownload()"
|
|
580
|
+
(panningEnabled)="enabledSelection = false;"
|
|
581
|
+
(selectionEnabled)="enabledSelection = true;"
|
|
582
|
+
(zoomIn)="onZoomIn()"
|
|
583
|
+
(zoomOut)="onZoomOut()"
|
|
584
|
+
(zoomLevelChange)="onZoomLevelChange($event)"
|
|
585
|
+
(print)="onPrint()"
|
|
586
|
+
(search)="onSearch()"></div>
|
|
587
|
+
<div
|
|
588
|
+
class="k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto"
|
|
589
|
+
[class.k-enable-text-select]="enabledSelection"
|
|
590
|
+
[class.k-enable-panning]="!enabledSelection"
|
|
591
|
+
[attr.aria-describedby]="activePageId"
|
|
592
|
+
tabindex="0">
|
|
593
|
+
<div
|
|
594
|
+
kendoPDFViewerSearch
|
|
595
|
+
*ngIf="searchActive"
|
|
596
|
+
[currentMatch]="currentMatch"
|
|
597
|
+
[matches]="currentMatches.length"
|
|
598
|
+
class="k-search-panel k-pos-sticky k-top-center"
|
|
599
|
+
(searchChange)="onSearchChange($event)"
|
|
600
|
+
(prevMatch)="onPreviousMatch()"
|
|
601
|
+
(nextMatch)="onNextMatch()"
|
|
602
|
+
(close)="closeSearch(toolbar)"></div>
|
|
603
|
+
<div
|
|
604
|
+
#pagesContainer
|
|
605
|
+
class="k-pdf-viewer-pages"
|
|
606
|
+
[style.--scale-factor]="zoom"
|
|
607
|
+
[attr.id]="pagesContainerId">
|
|
608
|
+
<div class="k-page">
|
|
609
|
+
<div class="k-text-layer"></div>
|
|
610
|
+
</div>
|
|
611
|
+
</div>
|
|
612
|
+
</div>
|
|
613
|
+
`, isInline: true, components: [{ type: i2.LoaderComponent, selector: "[loader]", inputs: ["settings"] }, { type: i3.ToolbarComponent, selector: "[toolbar]", inputs: ["zoomLevel", "calculatedComboBoxValue", "skip", "pageSize", "total", "zoomInDisabled", "zoomOutDisabled", "disabledTools", "zoomLevelChooserValue", "zoomOptionsData", "pagesContainerId", "tools"], outputs: ["fileSelect", "fileSelectError", "download", "selectionEnabled", "panningEnabled", "pageChange", "zoomIn", "zoomOut", "zoomLevelChange", "print", "search"] }, { type: i4.PDFViewerSearchComponent, selector: "[kendoPDFViewerSearch]", inputs: ["matches", "currentMatch"], outputs: ["searchChange", "prevMatch", "nextMatch", "close"] }], directives: [{ type: i5.LocalizedPDFViewerMessagesDirective, selector: "[kendoPDFViewerLocalizedMessages]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
614
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerComponent, decorators: [{
|
|
615
|
+
type: Component,
|
|
616
|
+
args: [{
|
|
617
|
+
exportAs: 'kendo-pdfviewer',
|
|
618
|
+
selector: 'kendo-pdfviewer',
|
|
619
|
+
providers: [
|
|
620
|
+
LocalizationService,
|
|
621
|
+
{
|
|
622
|
+
provide: L10N_PREFIX,
|
|
623
|
+
useValue: 'kendo.pdfviewer'
|
|
624
|
+
}
|
|
625
|
+
],
|
|
626
|
+
template: `
|
|
627
|
+
<ng-container kendoPDFViewerLocalizedMessages
|
|
628
|
+
i18n-pagerFirstPage="kendo.pdfviewer.pagerFirstPage|The label for the first page button in the Pager"
|
|
629
|
+
pagerFirstPage="Go to the first page"
|
|
630
|
+
|
|
631
|
+
i18n-pagerPreviousPage="kendo.pdfviewer.pagerPreviousPage|The label for the previous page button in the Pager"
|
|
632
|
+
pagerPreviousPage="Go to the previous page"
|
|
633
|
+
|
|
634
|
+
i18n-pagerNextPage="kendo.pdfviewer.pagerNextPage|The label for the next page button in the Pager"
|
|
635
|
+
pagerNextPage="Go to the next page"
|
|
636
|
+
|
|
637
|
+
i18n-pagerLastPage="kendo.pdfviewer.pagerLastPage|The label for the last page button in the Pager"
|
|
638
|
+
pagerLastPage="Go to the last page"
|
|
639
|
+
|
|
640
|
+
i18n-pagerPage="kendo.pdfviewer.pagerPage|The text before the current page number in the Pager"
|
|
641
|
+
pagerPage="Page"
|
|
642
|
+
|
|
643
|
+
i18n-pagerOf="kendo.pdfviewer.pagerOf|The text before the total pages number in the Pager"
|
|
644
|
+
pagerOf="of"
|
|
645
|
+
|
|
646
|
+
i18n-pagerInputTitle="kendo.pdfviewer.pagerInputTitle|The label of the pager input element"
|
|
647
|
+
pagerInputTitle="Page Number"
|
|
648
|
+
|
|
649
|
+
i18n-pagerInputLabel="kendo.pdfviewer.pagerInputLabel|The text of the aria-label attribute applied to the input element for entering the page number."
|
|
650
|
+
pagerInputLabel="Type a page number"
|
|
651
|
+
|
|
652
|
+
i18n-zoomInTitle="kendo.pdfviewer.zoomInTitle|The ZoomIn tool title and label."
|
|
653
|
+
zoomInTitle="Zoom in"
|
|
654
|
+
|
|
655
|
+
i18n-zoomOutTitle="kendo.pdfviewer.zoomOutTitle|The ZoomOut tool title and label."
|
|
656
|
+
zoomOutTitle="Zoom out"
|
|
657
|
+
|
|
658
|
+
i18n-selectionTitle="kendo.pdfviewer.selectionTitle|The Selection tool title and label."
|
|
659
|
+
selectionTitle="Enable selection"
|
|
660
|
+
|
|
661
|
+
i18n-panningTitle="kendo.pdfviewer.panningTitle|The Panning tool title and label."
|
|
662
|
+
panningTitle="Enable panning"
|
|
663
|
+
|
|
664
|
+
i18n-searchTitle="kendo.pdfviewer.searchTitle|The Search tool title and label."
|
|
665
|
+
searchTitle="Search"
|
|
666
|
+
|
|
667
|
+
i18n-openTitle="kendo.pdfviewer.openTitle|The Open tool title and label."
|
|
668
|
+
openTitle="Open"
|
|
669
|
+
|
|
670
|
+
i18n-downloadTitle="kendo.pdfviewer.downloadTitle|The Download tool title and label."
|
|
671
|
+
downloadTitle="Download"
|
|
672
|
+
|
|
673
|
+
i18n-printTitle="kendo.pdfviewer.printTitle|The Print tool title and label."
|
|
674
|
+
printTitle="Print"
|
|
675
|
+
|
|
676
|
+
i18n-fitToPage="kendo.pdfviewer.fitToPage|The text for the zoom level chooser Fit to page option."
|
|
677
|
+
fitToPage="Fit to page"
|
|
678
|
+
|
|
679
|
+
i18n-fitToWidth="kendo.pdfviewer.fitToWidth|The text for the zoom level chooser Fit to width option."
|
|
680
|
+
fitToWidth="Fit to width"
|
|
681
|
+
|
|
682
|
+
i18n-searchInputPlaceholder="kendo.pdfviewer.searchInputPlaceholder|The text for the search input placeholder."
|
|
683
|
+
searchInputPlaceholder="Search"
|
|
684
|
+
|
|
685
|
+
i18n-searchMatchesOf="kendo.pdfviewer.searchMatchesOf|The text before the total number of matches in the Search tool."
|
|
686
|
+
searchMatchesOf="of"
|
|
687
|
+
|
|
688
|
+
i18n-searchPreviousMatchTitle="kendo.pdfviewer.searchPreviousMatchTitle|The title of the Search tool previous match button."
|
|
689
|
+
searchPreviousMatchTitle="Previous match"
|
|
690
|
+
|
|
691
|
+
i18n-searchNextMatchTitle="kendo.pdfviewer.searchNextMatchTitle|The title of the Search tool next match button."
|
|
692
|
+
searchNextMatchTitle="Next match"
|
|
693
|
+
|
|
694
|
+
i18n-searchCloseTitle="kendo.pdfviewer.searchCloseTitle|The title of the Search tool close button."
|
|
695
|
+
searchCloseTitle="Close"
|
|
696
|
+
|
|
697
|
+
i18n-searchMatchCaseTitle="kendo.pdfviewer.searchMatchCaseTitle|The title of the Search tool match case button."
|
|
698
|
+
searchMatchCaseTitle="Match case"
|
|
699
|
+
|
|
700
|
+
i18n-zoomInputPlaceholder="kendo.pdfviewer.zoomInputPlaceholder|The text for the zoom tool input placeholder."
|
|
701
|
+
zoomInputPlaceholder="Choose zoom level">
|
|
702
|
+
</ng-container>
|
|
703
|
+
<div loader
|
|
704
|
+
*ngIf="loading"
|
|
705
|
+
[settings]="loaderSettings"></div>
|
|
706
|
+
<div toolbar
|
|
707
|
+
#toolbar
|
|
708
|
+
role="toolbar"
|
|
709
|
+
[attr.aria-controls]="pagesContainerId"
|
|
710
|
+
[tools]="tools"
|
|
711
|
+
[skip]="skip"
|
|
712
|
+
[total]="pdfContext?.pdfPages.length ? pdfContext?.pdfPages.length : 1"
|
|
713
|
+
[pageSize]="1"
|
|
714
|
+
[zoomInDisabled]="zoom >= maxZoom || !pdfContext?.pdfDoc"
|
|
715
|
+
[zoomOutDisabled]="zoom <= minZoom || !pdfContext?.pdfDoc"
|
|
716
|
+
[zoomOptionsData]="zoomOptionsData"
|
|
717
|
+
[zoomLevelChooserValue]="zoomLevel"
|
|
718
|
+
[disabledTools]="!pdfContext?.pdfDoc"
|
|
719
|
+
(pageChange)="onPageChange($event)"
|
|
720
|
+
(fileSelect)="onFileSelect($event)"
|
|
721
|
+
(fileSelectError)="onFileSelectError($event)"
|
|
722
|
+
(download)="onDownload()"
|
|
723
|
+
(panningEnabled)="enabledSelection = false;"
|
|
724
|
+
(selectionEnabled)="enabledSelection = true;"
|
|
725
|
+
(zoomIn)="onZoomIn()"
|
|
726
|
+
(zoomOut)="onZoomOut()"
|
|
727
|
+
(zoomLevelChange)="onZoomLevelChange($event)"
|
|
728
|
+
(print)="onPrint()"
|
|
729
|
+
(search)="onSearch()"></div>
|
|
730
|
+
<div
|
|
731
|
+
class="k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto"
|
|
732
|
+
[class.k-enable-text-select]="enabledSelection"
|
|
733
|
+
[class.k-enable-panning]="!enabledSelection"
|
|
734
|
+
[attr.aria-describedby]="activePageId"
|
|
735
|
+
tabindex="0">
|
|
736
|
+
<div
|
|
737
|
+
kendoPDFViewerSearch
|
|
738
|
+
*ngIf="searchActive"
|
|
739
|
+
[currentMatch]="currentMatch"
|
|
740
|
+
[matches]="currentMatches.length"
|
|
741
|
+
class="k-search-panel k-pos-sticky k-top-center"
|
|
742
|
+
(searchChange)="onSearchChange($event)"
|
|
743
|
+
(prevMatch)="onPreviousMatch()"
|
|
744
|
+
(nextMatch)="onNextMatch()"
|
|
745
|
+
(close)="closeSearch(toolbar)"></div>
|
|
746
|
+
<div
|
|
747
|
+
#pagesContainer
|
|
748
|
+
class="k-pdf-viewer-pages"
|
|
749
|
+
[style.--scale-factor]="zoom"
|
|
750
|
+
[attr.id]="pagesContainerId">
|
|
751
|
+
<div class="k-page">
|
|
752
|
+
<div class="k-text-layer"></div>
|
|
753
|
+
</div>
|
|
754
|
+
</div>
|
|
755
|
+
</div>
|
|
756
|
+
`,
|
|
757
|
+
}]
|
|
758
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }]; }, propDecorators: { hostClass: [{
|
|
759
|
+
type: HostBinding,
|
|
760
|
+
args: ['class.k-pdf-viewer']
|
|
761
|
+
}], direction: [{
|
|
762
|
+
type: HostBinding,
|
|
763
|
+
args: ['attr.dir']
|
|
764
|
+
}], tools: [{
|
|
765
|
+
type: Input
|
|
766
|
+
}], loaderSettings: [{
|
|
767
|
+
type: Input
|
|
768
|
+
}], saveFileName: [{
|
|
769
|
+
type: Input
|
|
770
|
+
}], saveOptions: [{
|
|
771
|
+
type: Input
|
|
772
|
+
}], url: [{
|
|
773
|
+
type: Input
|
|
774
|
+
}], data: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}], arrayBuffer: [{
|
|
777
|
+
type: Input
|
|
778
|
+
}], typedArray: [{
|
|
779
|
+
type: Input
|
|
780
|
+
}], zoom: [{
|
|
781
|
+
type: Input
|
|
782
|
+
}], zoomRate: [{
|
|
783
|
+
type: Input
|
|
784
|
+
}], minZoom: [{
|
|
785
|
+
type: Input
|
|
786
|
+
}], maxZoom: [{
|
|
787
|
+
type: Input
|
|
788
|
+
}], load: [{
|
|
789
|
+
type: Output
|
|
790
|
+
}], error: [{
|
|
791
|
+
type: Output
|
|
792
|
+
}], download: [{
|
|
793
|
+
type: Output
|
|
794
|
+
}], pageChange: [{
|
|
795
|
+
type: Output
|
|
796
|
+
}], zoomLevelChange: [{
|
|
797
|
+
type: Output
|
|
798
|
+
}], pagesContainer: [{
|
|
799
|
+
type: ViewChild,
|
|
800
|
+
args: ['pagesContainer']
|
|
801
|
+
}] } });
|