|
@@ -134,7 +134,7 @@ function getPdfImage(index: number) {
|
|
|
loadingTask.promise.then((pdf: any) => {
|
|
|
state.numPages = pdf.numPages;
|
|
|
pdf.getPage(index).then((page: any) => {
|
|
|
- const viewport = page.getViewport({ scale: 1.0 })
|
|
|
+ const viewport = page.getViewport({ scale: 2.0 })
|
|
|
img_canvas.value.height = viewport.height;
|
|
|
img_canvas.value.width = viewport.width;
|
|
|
canvas.value.height = viewport.height;
|
|
@@ -158,7 +158,12 @@ function getPdfImage(index: number) {
|
|
|
showImg.onload = () => {
|
|
|
canvas.value.width = showImg.width;
|
|
|
canvas.value.height = showImg.height;
|
|
|
+ if (fa_canvas != null) {
|
|
|
+ fa_canvas.dispose();
|
|
|
+ fa_canvas = null;
|
|
|
+ }
|
|
|
fa_canvas = new fabric.Canvas(canvas.value);
|
|
|
+ fa_canvas.clear()
|
|
|
figure_rects.splice(0)
|
|
|
table_rects.splice(0)
|
|
|
figureSelectedItem.value = -1;
|
|
@@ -271,7 +276,12 @@ const beforeUpload = (file: File): boolean | Promise<boolean> => {
|
|
|
showImg.onload = () => {
|
|
|
canvas.value.width = showImg.width;
|
|
|
canvas.value.height = showImg.height;
|
|
|
+ if (fa_canvas != null) {
|
|
|
+ fa_canvas.dispose();
|
|
|
+ fa_canvas = null;
|
|
|
+ }
|
|
|
fa_canvas = new fabric.Canvas(canvas.value);
|
|
|
+ fa_canvas.clear()
|
|
|
figure_rects.splice(0)
|
|
|
table_rects.splice(0)
|
|
|
figureSelectedItem.value = -1;
|