提交 9c4f2908 authored 作者: CRS's avatar CRS

nwe

上级 112d4c3d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import html2Canvas from 'html2canvas' import html2Canvas from 'html2canvas'
import JsPDF from 'jspdf' import JsPDF from 'jspdf'
import { import {
Loading Message, Loading
} from 'element-ui' } from 'element-ui'
let loading; let loading;
export default{ export default{
...@@ -17,8 +17,13 @@ export default{ ...@@ -17,8 +17,13 @@ export default{
html2Canvas(document.querySelector('#pdfDom'), { html2Canvas(document.querySelector('#pdfDom'), {
allowTaint: true allowTaint: true
}).then(function (canvas) { }).then(function (canvas) {
let contentWidth = canvas.width console.log(canvas)
let contentHeight = canvas.height let contentWidth = canvas.width;
let contentHeight = canvas.height;
if (contentWidth === '' || contentWidth === undefined || contentHeight === '' || contentHeight === undefined) {
loading.close();
Message.error('转换pdf失败,请稍后再试!')
}
let pageHeight = contentWidth / 595 * 842 let pageHeight = contentWidth / 595 * 842
let leftHeight = contentHeight let leftHeight = contentHeight
let position = 0 let position = 0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论