Forráskód Böngészése

修改生成PDF为A4规格

panlijun 11 hónapja
szülő
commit
8aa1659b07

+ 4 - 4
sa-view/tb-orders/tb-orders-email.html

@@ -208,9 +208,9 @@
 							// 使用 jsPDF 将 canvas 转换成 PDF
 							const imgData = canvas.toDataURL('image/png');
 							const pdf = new jspdf.jsPDF({
-								orientation: 'p',
+								orientation: 'portrait',
 								unit: 'px',
-								format: [canvas.width, canvas.height]
+								format: 'a4'
 							});
 					
 							const imgProps = pdf.getImageProperties(imgData);
@@ -228,9 +228,9 @@
 							// 使用 jsPDF 将 canvas 转换成 PDF
 							const imgData = canvas.toDataURL('image/png');
 							const pdf = new jspdf.jsPDF({
-								orientation: 'p',
+								orientation: 'portrait',
 								unit: 'px',
-								format: [canvas.width, canvas.height]
+								format: 'a4'
 							});
 					
 							const imgProps = pdf.getImageProperties(imgData);

+ 4 - 4
sa-view/tb-orders/tb-orders-print.html

@@ -142,9 +142,9 @@
 							// 使用 jsPDF 将 canvas 转换成 PDF
 							const imgData = canvas.toDataURL('image/png');
 							const pdf = new jspdf.jsPDF({
-								orientation: 'p',
+								orientation: 'pportrait',
 								unit: 'px',
-								format: [canvas.width, canvas.height]
+								format: 'a4'
 							});
 					
 							const imgProps = pdf.getImageProperties(imgData);
@@ -162,9 +162,9 @@
 							// 使用 jsPDF 将 canvas 转换成 PDF
 							const imgData = canvas.toDataURL('image/png');
 							const pdf = new jspdf.jsPDF({
-								orientation: 'p',
+								orientation: 'portrait',
 								unit: 'px',
-								format: [canvas.width, canvas.height]
+								format: 'a4'
 							});
 					
 							const imgProps = pdf.getImageProperties(imgData);