@toolspack/ttd-pdfjs 0.0.6 → 0.0.8
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/README.md +3 -1
- package/lib/ttd-pdfjs.common.js +63 -58
- package/lib/ttd-pdfjs.umd.js +63 -58
- package/lib/ttd-pdfjs.umd.min.js +3 -3
- package/package.json +1 -1
- package/src/packages/pdfjs/PdfView216.vue +9 -3
package/package.json
CHANGED
|
@@ -159,7 +159,7 @@ export default {
|
|
|
159
159
|
const renderTask = await page.render(renderContext)
|
|
160
160
|
|
|
161
161
|
// Wait for rendering to finish
|
|
162
|
-
|
|
162
|
+
renderTask.promise
|
|
163
163
|
vm.pageRendering = false
|
|
164
164
|
if (vm.pageNumPending !== null) {
|
|
165
165
|
// New page rendering is pending
|
|
@@ -202,8 +202,10 @@ export default {
|
|
|
202
202
|
if (this.pdfDoc) {
|
|
203
203
|
if (this.viewport) {
|
|
204
204
|
const { canvas } = this.$refs
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
if (canvas) {
|
|
206
|
+
const cxt = canvas.getContext('2d')
|
|
207
|
+
cxt.clearRect(0, 0, this.viewport.width, this.viewport.height);
|
|
208
|
+
}
|
|
207
209
|
}
|
|
208
210
|
this.viewport = null
|
|
209
211
|
this.pdfDoc.destroy();
|
|
@@ -276,6 +278,10 @@ export default {
|
|
|
276
278
|
// 这要通过调用 ondragover 事件的 event.preventDefault() 方法:
|
|
277
279
|
event.preventDefault()
|
|
278
280
|
},
|
|
281
|
+
updateScale() {
|
|
282
|
+
this.compuscale = this.scale
|
|
283
|
+
this.renderPage(this.pageNum)
|
|
284
|
+
},
|
|
279
285
|
},
|
|
280
286
|
mounted() {
|
|
281
287
|
this.compuscale = this.scale
|