Browse Source

[web_demo] 设置pdf转图片的缩放比例为1.0

yanxin 1 year ago
parent
commit
c846e84d81

File diff suppressed because it is too large
+ 2 - 2
src/dist/assets/index-5cfe9584.js


File diff suppressed because it is too large
+ 1 - 1
src/dist/assets/index-03ba8bbf.css


+ 2 - 2
src/dist/index.html

@@ -4,8 +4,8 @@
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>DocumentAI Web Demo</title>
-    <script type="module" crossorigin src="./assets/index-5cfe9584.js"></script>
-    <link rel="stylesheet" href="./assets/index-03ba8bbf.css">
+    <script type="module" crossorigin src="./assets/index-52c7fb66.js"></script>
+    <link rel="stylesheet" href="./assets/index-c0e641eb.css">
   </head>
   <body>
     <div id="app"></div>

+ 2 - 2
src/pages/main/views/Detection/LayoutAnalysis.vue

@@ -11,7 +11,7 @@
         <h4>支持jpg, png, bmp, pdf等文件格式</h4>
       </el-row>
       <div class="common-layout">
-        <el-upload class="upload-demo" drag action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" :before-upload="beforeUpload" multiple>
+        <el-upload class="upload-demo" drag :before-upload="beforeUpload" multiple>
           <el-icon class="el-icon--upload"><upload-filled /></el-icon>
           <div class="el-upload__text">
             Drop file here or <em>click to upload</em>
@@ -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: 4.0 })
+      const viewport = page.getViewport({ scale: 1.0 })
       img_canvas.value.height = viewport.height;
       img_canvas.value.width = viewport.width;
       canvas.value.height = viewport.height;

+ 2 - 2
src/pages/main/views/ImageProcess/magicColor.vue

@@ -11,7 +11,7 @@
         <h4>支持jpg, png, bmp, pdf等文件格式</h4>
       </el-row>
       <div class="common-layout">
-        <el-upload class="upload-demo" drag action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" :before-upload="beforeUpload" multiple>
+        <el-upload class="upload-demo" drag :before-upload="beforeUpload" multiple>
           <el-icon class="el-icon--upload"><upload-filled /></el-icon>
           <div class="el-upload__text">
             Drop file here or <em>click to upload</em>
@@ -121,7 +121,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: 4.0 })
+      const viewport = page.getViewport({ scale: 1.0 })
       canvas.value.height = viewport.height;
       canvas.value.width = viewport.width;
       const destWidth = 398;

+ 2 - 2
src/pages/main/views/Recognize/ocr.vue

@@ -12,7 +12,7 @@
         <h4>支持jpg, png, bmp, pdf等文件格式</h4>
       </el-row>
       <div class="common-layout">
-        <el-upload class="upload-demo" drag action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" :before-upload="beforeUpload" multiple>
+        <el-upload class="upload-demo" drag :before-upload="beforeUpload" multiple>
           <el-icon class="el-icon--upload"><upload-filled /></el-icon>
           <div class="el-upload__text">
             Drop file here or <em>click to upload</em>
@@ -141,7 +141,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: 4.0 })
+      const viewport = page.getViewport({ scale: 1.0 })
       img_canvas.value.height = viewport.height;
       img_canvas.value.width = viewport.width;
       canvas.value.height = viewport.height;

+ 2 - 2
src/pages/main/views/Recognize/tableRec.vue

@@ -12,7 +12,7 @@
         <h4>支持jpg, png, bmp, pdf等文件格式</h4>
       </el-row>
       <div class="common-layout">
-        <el-upload class="upload-demo" drag action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" :before-upload="beforeUpload" multiple>
+        <el-upload class="upload-demo" drag :before-upload="beforeUpload" multiple>
           <el-icon class="el-icon--upload"><upload-filled /></el-icon>
           <div class="el-upload__text">
             Drop file here or <em>click to upload</em>
@@ -302,7 +302,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: 4.0 })
+      const viewport = page.getViewport({ scale: 1.0 })
       canvas.value.height = viewport.height;
       canvas.value.width = viewport.width;
       const destWidth = 398;