Skip to content

Commit 2f7db3c

Browse files
authored
Get pdf.js from CDN (#675)
1 parent 926d59d commit 2f7db3c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/data/document.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import 'https://mozilla.github.io/pdf.js/build/pdf.js'
1+
import 'https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.min.js'
22
import 'https://cdnjs.cloudflare.com/ajax/libs/encoding-japanese/2.0.0/encoding.min.js'
33

44
import { BaseData } from './base.js'
55

6-
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://mozilla.github.io/pdf.js/build/pdf.worker.js'
6+
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.worker.min.js'
77

88
export default class DocumentData extends BaseData {
99
constructor(manager) {
@@ -19,7 +19,7 @@ export default class DocumentData extends BaseData {
1919
pdfjsLib
2020
.getDocument({
2121
data: reader.result,
22-
cMapUrl: 'https://mozilla.github.io/pdf.js/web/cmaps/',
22+
cMapUrl: 'https://cdn.jsdelivr.net/npm/[email protected]/cmaps/',
2323
cMapPacked: true,
2424
})
2525
.promise.then(async pdf => {

0 commit comments

Comments
 (0)