Quellcode durchsuchen

修改生成PDF为A4规格

panlijun vor 11 Monaten
Ursprung
Commit
8aa1659b07
2 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen
  1. 4 4
      sa-view/tb-orders/tb-orders-email.html
  2. 4 4
      sa-view/tb-orders/tb-orders-print.html

+ 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);