修改base64报告的分辨率比例

This commit is contained in:
lxd 2025-01-17 10:09:37 +08:00
parent 500cb31c64
commit 8e4b2c3839

View File

@ -9,8 +9,8 @@ const htmlToPdf = {
taintTest: false, taintTest: false,
logging: false, logging: false,
useCORS: true, useCORS: true,
dpi: window.devicePixelRatio * 4, // 将分辨率提高到特定的DPI 提高四倍 dpi: window.devicePixelRatio * 1, // 将分辨率提高到特定的DPI 提高四倍
scale: 4 // 按比例增加分辨率 scale: 1 // 按比例增加分辨率
}).then((canvas) => { }).then((canvas) => {
const pdf = new jsPDF('p', 'mm', 'a4') // A4纸纵向 const pdf = new jsPDF('p', 'mm', 'a4') // A4纸纵向
const ctx = canvas.getContext('2d'), const ctx = canvas.getContext('2d'),
@ -55,8 +55,8 @@ const htmlToPdf = {
taintTest: false, taintTest: false,
logging: false, logging: false,
useCORS: true, useCORS: true,
dpi: window.devicePixelRatio * 4, // 将分辨率提高到特定的DPI 提高四倍 dpi: window.devicePixelRatio * 1, // 将分辨率提高到特定的DPI 提高四倍
scale: 4 // 按比例增加分辨率 scale: 1 // 按比例增加分辨率
}).then((canvas) => { }).then((canvas) => {
const pdf = new jsPDF('p', 'mm', 'a4') // A4纸纵向 const pdf = new jsPDF('p', 'mm', 'a4') // A4纸纵向
const ctx = canvas.getContext('2d'), const ctx = canvas.getContext('2d'),