Browse Source

fix: 标签宽高问题

master
taqi be 1 month ago
parent
commit
690644eff3
  1. 6
      src/pages/deviceInfo/index.vue

6
src/pages/deviceInfo/index.vue

@ -199,12 +199,10 @@ async function onPrint(row: any) { @@ -199,12 +199,10 @@ async function onPrint(row: any) {
const res = await getDeviceLabelBase64(row.id)
if (isResError(res)) return
const pdf = new jsPDF('l', 'mm', [60, 40])
const pdfWidth = pdf.internal.pageSize.getWidth() //
const imgData = res.data
const imgWidth = pdfWidth
const imgHeight = (pdfWidth * 3) / 4
const imgWidth = 60
const imgHeight = 40
// PDF
pdf.addImage(imgData, 'JPEG', 0, 0, imgWidth, imgHeight)

Loading…
Cancel
Save