diff --git a/src/pages/deviceInfo/index.vue b/src/pages/deviceInfo/index.vue index d2c447a..770de53 100644 --- a/src/pages/deviceInfo/index.vue +++ b/src/pages/deviceInfo/index.vue @@ -204,13 +204,21 @@ async function onPrint(row: any) { const res = await getDeviceLabelBase64(row.id) closeLoadingPrint() if (isResError(res)) return - const pdf = new jsPDF('l', 'mm', [60, 40]) + const pdf = new jsPDF({ + orientation: 'l', + unit: 'mm', + format: [60, 40], + }) const imgData = res.data const imgWidth = 60 const imgHeight = 40 - - pdf.addImage(imgData, 'JPEG', 0, 0, imgWidth, imgHeight) + // const isEdge = navigator.userAgent.indexOf('Edg') !== -1 + // if (isEdge) { + // pdf.addImage(imgData, 'PNG', 2, -2, imgWidth, imgHeight) + // } else { + pdf.addImage(imgData, 'PNG', 2, -2, imgWidth, imgHeight) + // } pdf.autoPrint() window.open(pdf.output('bloburl'), '_blank')