ng2-pdfjs-viewer 5.0.6 → 6.0.2
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/README.MD +6 -6
- package/index.d.ts +1 -1
- package/index.js +12 -10
- package/ng2-pdfjs-viewer.component.d.ts +6 -4
- package/ng2-pdfjs-viewer.metadata.json +1 -1
- package/ng2-pdfjs-viewer.umd.js +407 -405
- package/package.json +2 -2
- package/pdfjs/build/pdf.worker.js +55972 -55972
- package/pdfjs/build/pdf.worker.min.js +1 -1
package/ng2-pdfjs-viewer.umd.js
CHANGED
|
@@ -1,443 +1,445 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}(this,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common'], factory) :
|
|
4
|
+
(global = global || self, factory(global['ng2-pdfjs-viewer'] = {}, global.core, global.common));
|
|
5
|
+
}(this, function (exports, core, common) { 'use strict';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview added by tsickle
|
|
9
|
+
* Generated from: ng2-pdfjs-viewer.component.ts
|
|
10
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
|
+
*/
|
|
12
|
+
var PdfJsViewerComponent = /** @class */ (function () {
|
|
13
|
+
function PdfJsViewerComponent() {
|
|
14
|
+
this.onBeforePrint = new core.EventEmitter();
|
|
15
|
+
this.onAfterPrint = new core.EventEmitter();
|
|
16
|
+
this.onDocumentLoad = new core.EventEmitter();
|
|
17
|
+
this.onPageChange = new core.EventEmitter();
|
|
18
|
+
this.externalWindow = false;
|
|
19
|
+
this.showSpinner = true;
|
|
20
|
+
this.openFile = true;
|
|
21
|
+
this.download = true;
|
|
22
|
+
this.viewBookmark = true;
|
|
23
|
+
this.print = true;
|
|
24
|
+
this.fullScreen = true;
|
|
25
|
+
//@Input() public showFullScreen: boolean;
|
|
26
|
+
this.find = true;
|
|
27
|
+
this.useOnlyCssZoom = false;
|
|
28
|
+
this.errorOverride = false;
|
|
29
|
+
this.errorAppend = true;
|
|
30
|
+
this.diagnosticLogs = true;
|
|
31
|
+
}
|
|
32
|
+
Object.defineProperty(PdfJsViewerComponent.prototype, "page", {
|
|
33
|
+
get: /**
|
|
34
|
+
* @return {?}
|
|
35
|
+
*/
|
|
36
|
+
function () {
|
|
37
|
+
if (this.PDFViewerApplication) {
|
|
38
|
+
return this.PDFViewerApplication.page;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (this.diagnosticLogs)
|
|
42
|
+
console.warn("Document is not loaded yet!!!. Try to retrieve page# after full load.");
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
set: /**
|
|
46
|
+
* @param {?} _page
|
|
47
|
+
* @return {?}
|
|
48
|
+
*/
|
|
49
|
+
function (_page) {
|
|
50
|
+
this._page = _page;
|
|
51
|
+
if (this.PDFViewerApplication) {
|
|
52
|
+
this.PDFViewerApplication.page = this._page;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
if (this.diagnosticLogs)
|
|
56
|
+
console.warn("Document is not loaded yet!!!. Try to set page# after full load. Ignore this warning if you are not setting page# using '.' notation. (E.g. pdfViewer.page = 5;)");
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
enumerable: false,
|
|
60
|
+
configurable: true
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(PdfJsViewerComponent.prototype, "pdfSrc", {
|
|
63
|
+
get: /**
|
|
64
|
+
* @return {?}
|
|
65
|
+
*/
|
|
66
|
+
function () {
|
|
67
|
+
return this._src;
|
|
68
|
+
},
|
|
69
|
+
set: /**
|
|
70
|
+
* @param {?} _src
|
|
71
|
+
* @return {?}
|
|
72
|
+
*/
|
|
73
|
+
function (_src) {
|
|
74
|
+
this._src = _src;
|
|
75
|
+
},
|
|
76
|
+
enumerable: false,
|
|
77
|
+
configurable: true
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(PdfJsViewerComponent.prototype, "PDFViewerApplicationOptions", {
|
|
80
|
+
get: /**
|
|
81
|
+
* @return {?}
|
|
82
|
+
*/
|
|
83
|
+
function () {
|
|
84
|
+
/** @type {?} */
|
|
85
|
+
var pdfViewerOptions = null;
|
|
86
|
+
if (this.externalWindow) {
|
|
87
|
+
if (this.viewerTab) {
|
|
88
|
+
pdfViewerOptions = this.viewerTab.PDFViewerApplicationOptions;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
if (this.iframe.nativeElement.contentWindow) {
|
|
93
|
+
pdfViewerOptions = this.iframe.nativeElement.contentWindow.PDFViewerApplicationOptions;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return pdfViewerOptions;
|
|
97
|
+
},
|
|
98
|
+
enumerable: false,
|
|
99
|
+
configurable: true
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(PdfJsViewerComponent.prototype, "PDFViewerApplication", {
|
|
102
|
+
get: /**
|
|
103
|
+
* @return {?}
|
|
104
|
+
*/
|
|
105
|
+
function () {
|
|
106
|
+
/** @type {?} */
|
|
107
|
+
var pdfViewer = null;
|
|
108
|
+
if (this.externalWindow) {
|
|
109
|
+
if (this.viewerTab) {
|
|
110
|
+
pdfViewer = this.viewerTab.PDFViewerApplication;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
if (this.iframe.nativeElement.contentWindow) {
|
|
115
|
+
pdfViewer = this.iframe.nativeElement.contentWindow.PDFViewerApplication;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return pdfViewer;
|
|
119
|
+
},
|
|
120
|
+
enumerable: false,
|
|
121
|
+
configurable: true
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* @param {?} viewerEvent
|
|
33
125
|
* @return {?}
|
|
34
126
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
127
|
+
PdfJsViewerComponent.prototype.receiveMessage = /**
|
|
128
|
+
* @param {?} viewerEvent
|
|
129
|
+
* @return {?}
|
|
130
|
+
*/
|
|
131
|
+
function (viewerEvent) {
|
|
132
|
+
if (viewerEvent.data && viewerEvent.data.viewerId && viewerEvent.data.event) {
|
|
133
|
+
/** @type {?} */
|
|
134
|
+
var viewerId = viewerEvent.data.viewerId;
|
|
135
|
+
/** @type {?} */
|
|
136
|
+
var event_1 = viewerEvent.data.event;
|
|
137
|
+
/** @type {?} */
|
|
138
|
+
var param = viewerEvent.data.param;
|
|
139
|
+
if (this.viewerId == viewerId) {
|
|
140
|
+
if (this.onBeforePrint && event_1 == "beforePrint") {
|
|
141
|
+
this.onBeforePrint.emit();
|
|
142
|
+
}
|
|
143
|
+
else if (this.onAfterPrint && event_1 == "afterPrint") {
|
|
144
|
+
this.onAfterPrint.emit();
|
|
145
|
+
}
|
|
146
|
+
else if (this.onDocumentLoad && event_1 == "pagesLoaded") {
|
|
147
|
+
this.onDocumentLoad.emit(param);
|
|
148
|
+
}
|
|
149
|
+
else if (this.onPageChange && event_1 == "pageChange") {
|
|
150
|
+
this.onPageChange.emit(param);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
42
153
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
* @param {?} _page
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
46
156
|
* @return {?}
|
|
47
157
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
158
|
+
PdfJsViewerComponent.prototype.ngOnInit = /**
|
|
159
|
+
* @return {?}
|
|
160
|
+
*/
|
|
161
|
+
function () {
|
|
162
|
+
window.addEventListener("message", this.receiveMessage.bind(this), false);
|
|
163
|
+
if (!this.externalWindow) { // Load pdf for embedded views
|
|
164
|
+
this.loadPdf();
|
|
52
165
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
enumerable: true,
|
|
59
|
-
configurable: true
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(PdfJsViewerComponent.prototype, "pdfSrc", {
|
|
62
|
-
get: /**
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* @return {?}
|
|
169
|
+
*/
|
|
170
|
+
PdfJsViewerComponent.prototype.refresh = /**
|
|
63
171
|
* @return {?}
|
|
64
172
|
*/
|
|
65
173
|
function () {
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
* @
|
|
174
|
+
this.loadPdf();
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* @private
|
|
70
178
|
* @return {?}
|
|
71
179
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
enumerable: true,
|
|
76
|
-
configurable: true
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(PdfJsViewerComponent.prototype, "PDFViewerApplicationOptions", {
|
|
79
|
-
get: /**
|
|
180
|
+
PdfJsViewerComponent.prototype.loadPdf = /**
|
|
181
|
+
* @private
|
|
80
182
|
* @return {?}
|
|
81
183
|
*/
|
|
82
184
|
function () {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (this.externalWindow) {
|
|
86
|
-
if (this.viewerTab) {
|
|
87
|
-
pdfViewerOptions = this.viewerTab.PDFViewerApplicationOptions;
|
|
88
|
-
}
|
|
185
|
+
if (!this._src) {
|
|
186
|
+
return;
|
|
89
187
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
188
|
+
// console.log(`Tab is - ${this.viewerTab}`);
|
|
189
|
+
// if (this.viewerTab) {
|
|
190
|
+
// console.log(`Status of window - ${this.viewerTab.closed}`);
|
|
191
|
+
// }
|
|
192
|
+
if (this.externalWindow && (typeof this.viewerTab === 'undefined' || this.viewerTab.closed)) {
|
|
193
|
+
this.viewerTab = window.open('', '_blank', this.externalWindowOptions || '');
|
|
194
|
+
if (this.viewerTab == null) {
|
|
195
|
+
if (this.diagnosticLogs)
|
|
196
|
+
console.error("ng2-pdfjs-viewer: For 'externalWindow = true'. i.e opening in new tab to work, pop-ups should be enabled.");
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (this.showSpinner) {
|
|
200
|
+
this.viewerTab.document.write("\n <style>\n .loader {\n position: fixed;\n left: 40%;\n top: 40%;\n border: 16px solid #f3f3f3;\n border-radius: 50%;\n border-top: 16px solid #3498db;\n width: 120px;\n height: 120px;\n animation: spin 2s linear infinite;\n }\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n </style>\n <div class=\"loader\"></div>\n ");
|
|
93
201
|
}
|
|
94
202
|
}
|
|
95
|
-
return pdfViewerOptions;
|
|
96
|
-
},
|
|
97
|
-
enumerable: true,
|
|
98
|
-
configurable: true
|
|
99
|
-
});
|
|
100
|
-
Object.defineProperty(PdfJsViewerComponent.prototype, "PDFViewerApplication", {
|
|
101
|
-
get: /**
|
|
102
|
-
* @return {?}
|
|
103
|
-
*/
|
|
104
|
-
function () {
|
|
105
203
|
/** @type {?} */
|
|
106
|
-
var
|
|
107
|
-
if (this.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
204
|
+
var fileUrl;
|
|
205
|
+
//if (typeof this.src === "string") {
|
|
206
|
+
// fileUrl = this.src;
|
|
207
|
+
//}
|
|
208
|
+
if (this._src instanceof Blob) {
|
|
209
|
+
fileUrl = encodeURIComponent(URL.createObjectURL(this._src));
|
|
210
|
+
}
|
|
211
|
+
else if (this._src instanceof Uint8Array) {
|
|
212
|
+
/** @type {?} */
|
|
213
|
+
var blob = new Blob([this._src], { type: "application/pdf" });
|
|
214
|
+
fileUrl = encodeURIComponent(URL.createObjectURL(blob));
|
|
111
215
|
}
|
|
112
216
|
else {
|
|
113
|
-
|
|
114
|
-
pdfViewer = this.iframe.nativeElement.contentWindow.PDFViewerApplication;
|
|
115
|
-
}
|
|
217
|
+
fileUrl = this._src;
|
|
116
218
|
}
|
|
117
|
-
return pdfViewer;
|
|
118
|
-
},
|
|
119
|
-
enumerable: true,
|
|
120
|
-
configurable: true
|
|
121
|
-
});
|
|
122
|
-
/**
|
|
123
|
-
* @param {?} viewerEvent
|
|
124
|
-
* @return {?}
|
|
125
|
-
*/
|
|
126
|
-
PdfJsViewerComponent.prototype.receiveMessage = /**
|
|
127
|
-
* @param {?} viewerEvent
|
|
128
|
-
* @return {?}
|
|
129
|
-
*/
|
|
130
|
-
function (viewerEvent) {
|
|
131
|
-
if (viewerEvent.data && viewerEvent.data.viewerId && viewerEvent.data.event) {
|
|
132
|
-
/** @type {?} */
|
|
133
|
-
var viewerId = viewerEvent.data.viewerId;
|
|
134
219
|
/** @type {?} */
|
|
135
|
-
var
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
220
|
+
var viewerUrl;
|
|
221
|
+
if (this.viewerFolder) {
|
|
222
|
+
viewerUrl = this.viewerFolder + "/web/viewer.html";
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
viewerUrl = "assets/pdfjs/web/viewer.html";
|
|
226
|
+
}
|
|
227
|
+
viewerUrl += "?file=" + fileUrl;
|
|
228
|
+
if (typeof this.viewerId !== 'undefined') {
|
|
229
|
+
viewerUrl += "&viewerId=" + this.viewerId;
|
|
230
|
+
}
|
|
231
|
+
if (typeof this.onBeforePrint !== 'undefined') {
|
|
232
|
+
viewerUrl += "&beforePrint=true";
|
|
233
|
+
}
|
|
234
|
+
if (typeof this.onAfterPrint !== 'undefined') {
|
|
235
|
+
viewerUrl += "&afterPrint=true";
|
|
236
|
+
}
|
|
237
|
+
if (typeof this.onDocumentLoad !== 'undefined') {
|
|
238
|
+
viewerUrl += "&pagesLoaded=true";
|
|
239
|
+
}
|
|
240
|
+
if (typeof this.onPageChange !== 'undefined') {
|
|
241
|
+
viewerUrl += "&pageChange=true";
|
|
242
|
+
}
|
|
243
|
+
if (this.downloadFileName) {
|
|
244
|
+
if (!this.downloadFileName.endsWith(".pdf")) {
|
|
245
|
+
this.downloadFileName += ".pdf";
|
|
150
246
|
}
|
|
247
|
+
viewerUrl += "&fileName=" + this.downloadFileName;
|
|
151
248
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* @return {?}
|
|
156
|
-
*/
|
|
157
|
-
PdfJsViewerComponent.prototype.ngOnInit = /**
|
|
158
|
-
* @return {?}
|
|
159
|
-
*/
|
|
160
|
-
function () {
|
|
161
|
-
window.addEventListener("message", this.receiveMessage.bind(this), false);
|
|
162
|
-
if (!this.externalWindow) { // Load pdf for embedded views
|
|
163
|
-
this.loadPdf();
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* @return {?}
|
|
168
|
-
*/
|
|
169
|
-
PdfJsViewerComponent.prototype.refresh = /**
|
|
170
|
-
* @return {?}
|
|
171
|
-
*/
|
|
172
|
-
function () {
|
|
173
|
-
this.loadPdf();
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
* @private
|
|
177
|
-
* @return {?}
|
|
178
|
-
*/
|
|
179
|
-
PdfJsViewerComponent.prototype.loadPdf = /**
|
|
180
|
-
* @private
|
|
181
|
-
* @return {?}
|
|
182
|
-
*/
|
|
183
|
-
function () {
|
|
184
|
-
if (!this._src) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
// console.log(`Tab is - ${this.viewerTab}`);
|
|
188
|
-
// if (this.viewerTab) {
|
|
189
|
-
// console.log(`Status of window - ${this.viewerTab.closed}`);
|
|
190
|
-
// }
|
|
191
|
-
if (this.externalWindow && (typeof this.viewerTab === 'undefined' || this.viewerTab.closed)) {
|
|
192
|
-
this.viewerTab = window.open('', '_blank', this.externalWindowOptions || '');
|
|
193
|
-
if (this.viewerTab == null) {
|
|
194
|
-
if (this.diagnosticLogs)
|
|
195
|
-
console.error("ng2-pdfjs-viewer: For 'externalWindow = true'. i.e opening in new tab to work, pop-ups should be enabled.");
|
|
196
|
-
return;
|
|
249
|
+
if (typeof this.openFile !== 'undefined') {
|
|
250
|
+
viewerUrl += "&openFile=" + this.openFile;
|
|
197
251
|
}
|
|
198
|
-
if (this.
|
|
199
|
-
|
|
252
|
+
if (typeof this.download !== 'undefined') {
|
|
253
|
+
viewerUrl += "&download=" + this.download;
|
|
200
254
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
var fileUrl;
|
|
204
|
-
//if (typeof this.src === "string") {
|
|
205
|
-
// fileUrl = this.src;
|
|
206
|
-
//}
|
|
207
|
-
if (this._src instanceof Blob) {
|
|
208
|
-
fileUrl = encodeURIComponent(URL.createObjectURL(this._src));
|
|
209
|
-
}
|
|
210
|
-
else if (this._src instanceof Uint8Array) {
|
|
211
|
-
/** @type {?} */
|
|
212
|
-
var blob = new Blob([this._src], { type: "application/pdf" });
|
|
213
|
-
fileUrl = encodeURIComponent(URL.createObjectURL(blob));
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
fileUrl = this._src;
|
|
217
|
-
}
|
|
218
|
-
/** @type {?} */
|
|
219
|
-
var viewerUrl;
|
|
220
|
-
if (this.viewerFolder) {
|
|
221
|
-
viewerUrl = this.viewerFolder + "/web/viewer.html";
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
viewerUrl = "assets/pdfjs/web/viewer.html";
|
|
225
|
-
}
|
|
226
|
-
viewerUrl += "?file=" + fileUrl;
|
|
227
|
-
if (typeof this.viewerId !== 'undefined') {
|
|
228
|
-
viewerUrl += "&viewerId=" + this.viewerId;
|
|
229
|
-
}
|
|
230
|
-
if (typeof this.onBeforePrint !== 'undefined') {
|
|
231
|
-
viewerUrl += "&beforePrint=true";
|
|
232
|
-
}
|
|
233
|
-
if (typeof this.onAfterPrint !== 'undefined') {
|
|
234
|
-
viewerUrl += "&afterPrint=true";
|
|
235
|
-
}
|
|
236
|
-
if (typeof this.onDocumentLoad !== 'undefined') {
|
|
237
|
-
viewerUrl += "&pagesLoaded=true";
|
|
238
|
-
}
|
|
239
|
-
if (typeof this.onPageChange !== 'undefined') {
|
|
240
|
-
viewerUrl += "&pageChange=true";
|
|
241
|
-
}
|
|
242
|
-
if (this.downloadFileName) {
|
|
243
|
-
if (!this.downloadFileName.endsWith(".pdf")) {
|
|
244
|
-
this.downloadFileName += ".pdf";
|
|
255
|
+
if (this.startDownload) {
|
|
256
|
+
viewerUrl += "&startDownload=" + this.startDownload;
|
|
245
257
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (typeof this.openFile !== 'undefined') {
|
|
249
|
-
viewerUrl += "&openFile=" + this.openFile;
|
|
250
|
-
}
|
|
251
|
-
if (typeof this.download !== 'undefined') {
|
|
252
|
-
viewerUrl += "&download=" + this.download;
|
|
253
|
-
}
|
|
254
|
-
if (this.startDownload) {
|
|
255
|
-
viewerUrl += "&startDownload=" + this.startDownload;
|
|
256
|
-
}
|
|
257
|
-
if (typeof this.viewBookmark !== 'undefined') {
|
|
258
|
-
viewerUrl += "&viewBookmark=" + this.viewBookmark;
|
|
259
|
-
}
|
|
260
|
-
if (typeof this.print !== 'undefined') {
|
|
261
|
-
viewerUrl += "&print=" + this.print;
|
|
262
|
-
}
|
|
263
|
-
if (this.startPrint) {
|
|
264
|
-
viewerUrl += "&startPrint=" + this.startPrint;
|
|
265
|
-
}
|
|
266
|
-
if (typeof this.fullScreen !== 'undefined') {
|
|
267
|
-
viewerUrl += "&fullScreen=" + this.fullScreen;
|
|
268
|
-
}
|
|
269
|
-
// if (this.showFullScreen) {
|
|
270
|
-
// viewerUrl += `&showFullScreen=${this.showFullScreen}`;
|
|
271
|
-
// }
|
|
272
|
-
if (typeof this.find !== 'undefined') {
|
|
273
|
-
viewerUrl += "&find=" + this.find;
|
|
274
|
-
}
|
|
275
|
-
if (this.lastPage) {
|
|
276
|
-
viewerUrl += "&lastpage=" + this.lastPage;
|
|
277
|
-
}
|
|
278
|
-
if (this.rotatecw) {
|
|
279
|
-
viewerUrl += "&rotatecw=" + this.rotatecw;
|
|
280
|
-
}
|
|
281
|
-
if (this.rotateccw) {
|
|
282
|
-
viewerUrl += "&rotateccw=" + this.rotateccw;
|
|
283
|
-
}
|
|
284
|
-
if (this.cursor) {
|
|
285
|
-
viewerUrl += "&cursor=" + this.cursor;
|
|
286
|
-
}
|
|
287
|
-
if (this.scroll) {
|
|
288
|
-
viewerUrl += "&scroll=" + this.scroll;
|
|
289
|
-
}
|
|
290
|
-
if (this.spread) {
|
|
291
|
-
viewerUrl += "&spread=" + this.spread;
|
|
292
|
-
}
|
|
293
|
-
if (this.locale) {
|
|
294
|
-
viewerUrl += "&locale=" + this.locale;
|
|
295
|
-
}
|
|
296
|
-
if (this.useOnlyCssZoom) {
|
|
297
|
-
viewerUrl += "&useOnlyCssZoom=" + this.useOnlyCssZoom;
|
|
298
|
-
}
|
|
299
|
-
if (this._page || this.zoom || this.nameddest || this.pagemode)
|
|
300
|
-
viewerUrl += "#";
|
|
301
|
-
if (this._page) {
|
|
302
|
-
viewerUrl += "&page=" + this._page;
|
|
303
|
-
}
|
|
304
|
-
if (this.zoom) {
|
|
305
|
-
viewerUrl += "&zoom=" + this.zoom;
|
|
306
|
-
}
|
|
307
|
-
if (this.nameddest) {
|
|
308
|
-
viewerUrl += "&nameddest=" + this.nameddest;
|
|
309
|
-
}
|
|
310
|
-
if (this.pagemode) {
|
|
311
|
-
viewerUrl += "&pagemode=" + this.pagemode;
|
|
312
|
-
}
|
|
313
|
-
if (this.errorOverride || this.errorAppend) {
|
|
314
|
-
viewerUrl += "&errorMessage=" + this.errorMessage;
|
|
315
|
-
if (this.errorOverride) {
|
|
316
|
-
viewerUrl += "&errorOverride=" + this.errorOverride;
|
|
258
|
+
if (typeof this.viewBookmark !== 'undefined') {
|
|
259
|
+
viewerUrl += "&viewBookmark=" + this.viewBookmark;
|
|
317
260
|
}
|
|
318
|
-
if (this.
|
|
319
|
-
viewerUrl += "&
|
|
261
|
+
if (typeof this.print !== 'undefined') {
|
|
262
|
+
viewerUrl += "&print=" + this.print;
|
|
320
263
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}
|
|
264
|
+
if (this.startPrint) {
|
|
265
|
+
viewerUrl += "&startPrint=" + this.startPrint;
|
|
266
|
+
}
|
|
267
|
+
if (typeof this.fullScreen !== 'undefined') {
|
|
268
|
+
viewerUrl += "&fullScreen=" + this.fullScreen;
|
|
269
|
+
}
|
|
270
|
+
// if (this.showFullScreen) {
|
|
271
|
+
// viewerUrl += `&showFullScreen=${this.showFullScreen}`;
|
|
272
|
+
// }
|
|
273
|
+
if (typeof this.find !== 'undefined') {
|
|
274
|
+
viewerUrl += "&find=" + this.find;
|
|
275
|
+
}
|
|
276
|
+
if (this.lastPage) {
|
|
277
|
+
viewerUrl += "&lastpage=" + this.lastPage;
|
|
278
|
+
}
|
|
279
|
+
if (this.rotatecw) {
|
|
280
|
+
viewerUrl += "&rotatecw=" + this.rotatecw;
|
|
281
|
+
}
|
|
282
|
+
if (this.rotateccw) {
|
|
283
|
+
viewerUrl += "&rotateccw=" + this.rotateccw;
|
|
284
|
+
}
|
|
285
|
+
if (this.cursor) {
|
|
286
|
+
viewerUrl += "&cursor=" + this.cursor;
|
|
287
|
+
}
|
|
288
|
+
if (this.scroll) {
|
|
289
|
+
viewerUrl += "&scroll=" + this.scroll;
|
|
290
|
+
}
|
|
291
|
+
if (this.spread) {
|
|
292
|
+
viewerUrl += "&spread=" + this.spread;
|
|
293
|
+
}
|
|
294
|
+
if (this.locale) {
|
|
295
|
+
viewerUrl += "&locale=" + this.locale;
|
|
296
|
+
}
|
|
297
|
+
if (this.useOnlyCssZoom) {
|
|
298
|
+
viewerUrl += "&useOnlyCssZoom=" + this.useOnlyCssZoom;
|
|
299
|
+
}
|
|
300
|
+
if (this._page || this.zoom || this.nameddest || this.pagemode)
|
|
301
|
+
viewerUrl += "#";
|
|
302
|
+
if (this._page) {
|
|
303
|
+
viewerUrl += "&page=" + this._page;
|
|
304
|
+
}
|
|
305
|
+
if (this.zoom) {
|
|
306
|
+
viewerUrl += "&zoom=" + this.zoom;
|
|
307
|
+
}
|
|
308
|
+
if (this.nameddest) {
|
|
309
|
+
viewerUrl += "&nameddest=" + this.nameddest;
|
|
310
|
+
}
|
|
311
|
+
if (this.pagemode) {
|
|
312
|
+
viewerUrl += "&pagemode=" + this.pagemode;
|
|
313
|
+
}
|
|
314
|
+
if (this.errorOverride || this.errorAppend) {
|
|
315
|
+
viewerUrl += "&errorMessage=" + this.errorMessage;
|
|
316
|
+
if (this.errorOverride) {
|
|
317
|
+
viewerUrl += "&errorOverride=" + this.errorOverride;
|
|
318
|
+
}
|
|
319
|
+
if (this.errorAppend) {
|
|
320
|
+
viewerUrl += "&errorAppend=" + this.errorAppend;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (this.externalWindow) {
|
|
324
|
+
this.viewerTab.location.href = viewerUrl;
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
this.iframe.nativeElement.src = viewerUrl;
|
|
328
|
+
}
|
|
329
|
+
// console.log(`
|
|
330
|
+
// pdfSrc = ${this.pdfSrc}
|
|
331
|
+
// fileUrl = ${fileUrl}
|
|
332
|
+
// externalWindow = ${this.externalWindow}
|
|
333
|
+
// downloadFileName = ${this.downloadFileName}
|
|
334
|
+
// viewerFolder = ${this.viewerFolder}
|
|
335
|
+
// openFile = ${this.openFile}
|
|
336
|
+
// download = ${this.download}
|
|
337
|
+
// startDownload = ${this.startDownload}
|
|
338
|
+
// viewBookmark = ${this.viewBookmark}
|
|
339
|
+
// print = ${this.print}
|
|
340
|
+
// startPrint = ${this.startPrint}
|
|
341
|
+
// fullScreen = ${this.fullScreen}
|
|
342
|
+
// find = ${this.find}
|
|
343
|
+
// lastPage = ${this.lastPage}
|
|
344
|
+
// rotatecw = ${this.rotatecw}
|
|
345
|
+
// rotateccw = ${this.rotateccw}
|
|
346
|
+
// cursor = ${this.cursor}
|
|
347
|
+
// scrollMode = ${this.scroll}
|
|
348
|
+
// spread = ${this.spread}
|
|
349
|
+
// page = ${this.page}
|
|
350
|
+
// zoom = ${this.zoom}
|
|
351
|
+
// nameddest = ${this.nameddest}
|
|
352
|
+
// pagemode = ${this.pagemode}
|
|
353
|
+
// pagemode = ${this.errorOverride}
|
|
354
|
+
// pagemode = ${this.errorAppend}
|
|
355
|
+
// pagemode = ${this.errorMessage}
|
|
356
|
+
// `);
|
|
357
|
+
};
|
|
358
|
+
PdfJsViewerComponent.decorators = [
|
|
359
|
+
{ type: core.Component, args: [{
|
|
360
|
+
selector: 'ng2-pdfjs-viewer',
|
|
361
|
+
template: "<iframe title=\"ng2-pdfjs-viewer\" [hidden]=\"externalWindow || (!externalWindow && !pdfSrc)\" #iframe width=\"100%\" height=\"100%\"></iframe>"
|
|
362
|
+
},] }
|
|
363
|
+
];
|
|
364
|
+
PdfJsViewerComponent.propDecorators = {
|
|
365
|
+
iframe: [{ type: core.ViewChild, args: ['iframe', { static: true },] }],
|
|
366
|
+
viewerId: [{ type: core.Input }],
|
|
367
|
+
onBeforePrint: [{ type: core.Output }],
|
|
368
|
+
onAfterPrint: [{ type: core.Output }],
|
|
369
|
+
onDocumentLoad: [{ type: core.Output }],
|
|
370
|
+
onPageChange: [{ type: core.Output }],
|
|
371
|
+
viewerFolder: [{ type: core.Input }],
|
|
372
|
+
externalWindow: [{ type: core.Input }],
|
|
373
|
+
showSpinner: [{ type: core.Input }],
|
|
374
|
+
downloadFileName: [{ type: core.Input }],
|
|
375
|
+
openFile: [{ type: core.Input }],
|
|
376
|
+
download: [{ type: core.Input }],
|
|
377
|
+
startDownload: [{ type: core.Input }],
|
|
378
|
+
viewBookmark: [{ type: core.Input }],
|
|
379
|
+
print: [{ type: core.Input }],
|
|
380
|
+
startPrint: [{ type: core.Input }],
|
|
381
|
+
fullScreen: [{ type: core.Input }],
|
|
382
|
+
find: [{ type: core.Input }],
|
|
383
|
+
zoom: [{ type: core.Input }],
|
|
384
|
+
nameddest: [{ type: core.Input }],
|
|
385
|
+
pagemode: [{ type: core.Input }],
|
|
386
|
+
lastPage: [{ type: core.Input }],
|
|
387
|
+
rotatecw: [{ type: core.Input }],
|
|
388
|
+
rotateccw: [{ type: core.Input }],
|
|
389
|
+
cursor: [{ type: core.Input }],
|
|
390
|
+
scroll: [{ type: core.Input }],
|
|
391
|
+
spread: [{ type: core.Input }],
|
|
392
|
+
locale: [{ type: core.Input }],
|
|
393
|
+
useOnlyCssZoom: [{ type: core.Input }],
|
|
394
|
+
errorOverride: [{ type: core.Input }],
|
|
395
|
+
errorAppend: [{ type: core.Input }],
|
|
396
|
+
errorMessage: [{ type: core.Input }],
|
|
397
|
+
diagnosticLogs: [{ type: core.Input }],
|
|
398
|
+
externalWindowOptions: [{ type: core.Input }],
|
|
399
|
+
page: [{ type: core.Input }],
|
|
400
|
+
pdfSrc: [{ type: core.Input }]
|
|
401
|
+
};
|
|
402
|
+
return PdfJsViewerComponent;
|
|
403
|
+
}());
|
|
403
404
|
|
|
404
|
-
/**
|
|
405
|
-
* @fileoverview added by tsickle
|
|
406
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
407
|
-
*/
|
|
408
|
-
var PdfJsViewerModule = /** @class */ (function () {
|
|
409
|
-
function PdfJsViewerModule() {
|
|
410
|
-
}
|
|
411
405
|
/**
|
|
412
|
-
* @
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
* @return {?}
|
|
406
|
+
* @fileoverview added by tsickle
|
|
407
|
+
* Generated from: index.ts
|
|
408
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
416
409
|
*/
|
|
417
|
-
function () {
|
|
418
|
-
|
|
419
|
-
|
|
410
|
+
var PdfJsViewerModule = /** @class */ (function () {
|
|
411
|
+
function PdfJsViewerModule() {
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* @return {?}
|
|
415
|
+
*/
|
|
416
|
+
PdfJsViewerModule.forRoot = /**
|
|
417
|
+
* @return {?}
|
|
418
|
+
*/
|
|
419
|
+
function () {
|
|
420
|
+
return {
|
|
421
|
+
ngModule: PdfJsViewerModule
|
|
422
|
+
};
|
|
420
423
|
};
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
]
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}());
|
|
424
|
+
PdfJsViewerModule.decorators = [
|
|
425
|
+
{ type: core.NgModule, args: [{
|
|
426
|
+
imports: [
|
|
427
|
+
common.CommonModule
|
|
428
|
+
],
|
|
429
|
+
declarations: [
|
|
430
|
+
PdfJsViewerComponent
|
|
431
|
+
],
|
|
432
|
+
exports: [
|
|
433
|
+
PdfJsViewerComponent
|
|
434
|
+
]
|
|
435
|
+
},] }
|
|
436
|
+
];
|
|
437
|
+
return PdfJsViewerModule;
|
|
438
|
+
}());
|
|
437
439
|
|
|
438
|
-
exports.PdfJsViewerModule = PdfJsViewerModule;
|
|
439
|
-
exports.PdfJsViewerComponent = PdfJsViewerComponent;
|
|
440
|
+
exports.PdfJsViewerModule = PdfJsViewerModule;
|
|
441
|
+
exports.PdfJsViewerComponent = PdfJsViewerComponent;
|
|
440
442
|
|
|
441
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
443
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
442
444
|
|
|
443
|
-
}))
|
|
445
|
+
}));
|