Browse Source

生成横向A4格式pdf

lxf 2 years ago
parent
commit
bce9bd992e
3 changed files with 5 additions and 5 deletions
  1. 2 2
      src/main.js
  2. 2 2
      src/utils/util.js
  3. 1 1
      src/views/salesMange/shipmentMange/document/index.vue

+ 2 - 2
src/main.js

@@ -52,7 +52,7 @@ import {
   getDict,
   getDictOne,
   getPdf,
-  getPdfA3,
+  getPdfTransverseA4,
   translateIntoEnglish,
   random
 } from '@/utils/util'
@@ -93,7 +93,7 @@ app.config.globalProperties.calculationWeek = calculationWeek
 app.config.globalProperties.getDict = getDict
 app.config.globalProperties.getDictOne = getDictOne
 app.config.globalProperties.getPdf = getPdf
-app.config.globalProperties.getPdfA3 = getPdfA3
+app.config.globalProperties.getPdfTransverseA4 = getPdfTransverseA4
 app.config.globalProperties.translateIntoEnglish = translateIntoEnglish
 app.config.globalProperties.random = random
 

+ 2 - 2
src/utils/util.js

@@ -222,7 +222,7 @@ export function getPdf(title) {
     });
   }, 1000);
 }
-export function getPdfA3(title) {
+export function getPdfTransverseA4(title) {
   html2Canvas(document.getElementById("pdfDom"), {
     // allowTaint: true,
     // taintTest: false,
@@ -232,7 +232,7 @@ export function getPdfA3(title) {
     // scale: 2, // 按比例增加分辨率
     allowTaint: true,
     useCORS: true, // 需要注意,element的 高度 宽度一定要在这里定义一下,不然会存在只下载了当前你能看到的页面   避雷避雷!!!
-    scale: 2, // 提升画面质量,但是会增加文件大小
+    scale: 4, // 提升画面质量,但是会增加文件大小
     height: document.getElementById("pdfDom").scrollHeight,
     windowHeight: document.getElementById("pdfDom").scrollHeight,
   }).then((canvas) => {

+ 1 - 1
src/views/salesMange/shipmentMange/document/index.vue

@@ -1397,7 +1397,7 @@ const clickDownload = () => {
     data.content = JSON.stringify(data.content)
     proxy.post('/documentsPdf/add', data).then();
     setTimeout(() => {
-      proxy.getPdfA3("报关单PDF文件");
+      proxy.getPdfTransverseA4("报关单PDF文件");
       nextTick(() => {
         setTimeout(() => {
           textShow.value = false;