File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change 28
28
else
29
29
throw new TypeError (' invalid src type' );
30
30
31
- // see https://github.com/mozilla/pdf.js/blob/628e70fbb5dea3b9066aa5c34cca70aaafef8db2/src/display/dom_utils.js#L64
32
- source .CMapReaderFactory = function () {
33
-
34
- this .fetch = function (query ) {
35
-
36
- return import (' raw-loader!pdfjs-dist/cmaps/' + query .name + ' .bcmap' /* webpackChunkName: "pdfjs/noprefetch-[request]" */ )
37
- .then (function (bcmap ) {
38
-
39
- return {
40
- cMapData: bcmap,
41
- compressionType: pdfjsLib .CMapCompressionType .BINARY ,
42
- };
43
- });
44
- }
45
- };
46
-
47
-
48
31
var loadingTask = pdfjsLib .getDocument (source).promise ;
49
32
loadingTask .__PDFDocumentLoadingTask = true ; // since PDFDocumentLoadingTask is not public
50
33
Original file line number Diff line number Diff line change
1
+ import pdfjsLib from 'pdfjs-dist/webpack.js' ;
2
+
3
+
4
+ // see https://github.com/mozilla/pdf.js/blob/628e70fbb5dea3b9066aa5c34cca70aaafef8db2/src/display/dom_utils.js#L64
5
+
6
+ export default function ( ) {
7
+
8
+ this . fetch = function ( query ) {
9
+
10
+ return import ( 'raw-loader!pdfjs-dist/cmaps/' + query . name + '.bcmap' /* webpackChunkName: "pdfjs/noprefetch-[request]" */ )
11
+ . then ( function ( bcmap ) {
12
+
13
+ return {
14
+ cMapData : bcmap ,
15
+ compressionType : pdfjsLib . CMapCompressionType . BINARY ,
16
+ } ;
17
+ } ) ;
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments