hsu-utils 0.0.22 → 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
@@ -19,10 +19,10 @@ function load(pdfUrl) {
|
|
19
19
|
cMapUrl: 'https://unpkg.com/browse/pdfjs-dist@2.13.216/cmaps/',
|
20
20
|
cMapPacked: true
|
21
21
|
});
|
22
|
-
pdf =
|
22
|
+
pdf = loadingTask.promise;
|
23
23
|
PDFMap.set(pdfUrl, pdf);
|
24
24
|
}
|
25
|
-
return pdf;
|
25
|
+
return yield pdf;
|
26
26
|
});
|
27
27
|
}
|
28
28
|
function getNumPages(pdfUrl) {
|
package/lib/RenderPDF/index.js
CHANGED
@@ -46,18 +46,17 @@ function load(pdfUrl) {
|
|
46
46
|
switch (_a.label) {
|
47
47
|
case 0:
|
48
48
|
pdf = PDFMap.get(pdfUrl);
|
49
|
-
if (
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
case 2: return [2, pdf];
|
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()];
|
61
60
|
}
|
62
61
|
});
|
63
62
|
});
|