@toolspack/ttd-pdfjs 0.0.8 → 0.0.9
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/.eslintignore +2 -2
- package/README.md +3 -2
- package/lib/demo.html +1 -8
- package/lib/ttd-pdfjs.common.js +6416 -8924
- package/lib/ttd-pdfjs.umd.js +6444 -8951
- package/lib/ttd-pdfjs.umd.min.js +4 -13
- package/package.json +1 -1
- package/src/packages/pdfjs/PdfView216.vue +2 -10
- /package/lib/static/fonts/{element-icons.732389de.ttf → element-icons.f1a45d74.ttf} +0 -0
- /package/lib/static/fonts/{element-icons.535877f5.woff → element-icons.ff18efd1.woff} +0 -0
package/package.json
CHANGED
|
@@ -56,7 +56,6 @@ if (getChromeVersion()) {
|
|
|
56
56
|
const PDFJS = require('pdfjs-dist')
|
|
57
57
|
|
|
58
58
|
const defautScale = 1.0
|
|
59
|
-
|
|
60
59
|
// PDFJS.GlobalWorkerOptions.workerSrc = require('pdfjs-dist/legacy/build/pdf.worker.min.js')
|
|
61
60
|
PDFJS.GlobalWorkerOptions.workerSrc = require('pdfjs-dist/build/pdf.worker.min.js')
|
|
62
61
|
// https://unpkg.com/pdfjs-dist@2.16.105/cmaps/
|
|
@@ -156,10 +155,8 @@ export default {
|
|
|
156
155
|
canvasContext: canvas.getContext('2d'),
|
|
157
156
|
viewport,
|
|
158
157
|
}
|
|
159
|
-
const renderTask = await page.render(renderContext)
|
|
160
|
-
|
|
161
158
|
// Wait for rendering to finish
|
|
162
|
-
|
|
159
|
+
await page.render(renderContext).promise
|
|
163
160
|
vm.pageRendering = false
|
|
164
161
|
if (vm.pageNumPending !== null) {
|
|
165
162
|
// New page rendering is pending
|
|
@@ -236,11 +233,6 @@ export default {
|
|
|
236
233
|
console.log('----PdfView---', url)
|
|
237
234
|
let pdfDoc_
|
|
238
235
|
try {
|
|
239
|
-
// const pdfData = await fetch(
|
|
240
|
-
// new URL(url, window.location).href,
|
|
241
|
-
// );
|
|
242
|
-
// const arrayBufferPdf = await pdfData.arrayBuffer(); // 转成 ArrayBuffer 塞给 pdf.js
|
|
243
|
-
// pdfDoc_ = await PDFJS.getDocument({ data: arrayBufferPdf }).promise;
|
|
244
236
|
pdfDoc_ = await PDFJS.getDocument({
|
|
245
237
|
url: encodeURI(url),
|
|
246
238
|
cMapUrl,
|
|
@@ -291,7 +283,7 @@ export default {
|
|
|
291
283
|
// }
|
|
292
284
|
},
|
|
293
285
|
beforeDestroy() {
|
|
294
|
-
console.log('---', this.pdfDoc)
|
|
286
|
+
// console.log('---', this.pdfDoc)
|
|
295
287
|
if (this.pdfDoc) {
|
|
296
288
|
this.closepdf();
|
|
297
289
|
}
|
|
File without changes
|
|
File without changes
|