hsu-utils 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
package/es/RenderPDF/index.js
CHANGED
package/lib/RenderPDF/index.js
CHANGED
@@ -43,17 +43,21 @@ function load(pdfUrl) {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function () {
|
44
44
|
var pdf, loadingTask;
|
45
45
|
return __generator(this, function (_a) {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
switch (_a.label) {
|
47
|
+
case 0:
|
48
|
+
pdf = PDFMap.get(pdfUrl);
|
49
|
+
if (!pdf) {
|
50
|
+
loadingTask = (0, pdf_js_1.getDocument)({
|
51
|
+
url: pdfUrl,
|
52
|
+
cMapUrl: 'https://unpkg.com/browse/pdfjs-dist@2.13.216/cmaps/',
|
53
|
+
cMapPacked: true
|
54
|
+
});
|
55
|
+
pdf = loadingTask.promise;
|
56
|
+
PDFMap.set(pdfUrl, pdf);
|
57
|
+
}
|
58
|
+
return [4, pdf];
|
59
|
+
case 1: return [2, _a.sent()];
|
55
60
|
}
|
56
|
-
return [2, pdf];
|
57
61
|
});
|
58
62
|
});
|
59
63
|
}
|