回退双面打印配置
This commit is contained in:
@@ -301,9 +301,6 @@ ipcMain.handle("print-pdf", async (event, pdfDataOrUrl, printOptions = {}) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const duplexMode = printOptions?.duplex;
|
const duplexMode = printOptions?.duplex;
|
||||||
// pdf-to-printer 使用 side 选项,而不是 duplex
|
|
||||||
// side 可选值: "simplex" | "duplex" | "duplexshort" | "duplexlong"
|
|
||||||
const sideOption = duplexMode ? "duplexlong" : "simplex";
|
|
||||||
log.info(
|
log.info(
|
||||||
`准备打印PDF: ${pdfFilePath}, 打印机: ${targetPrinterName || "默认打印机"
|
`准备打印PDF: ${pdfFilePath}, 打印机: ${targetPrinterName || "默认打印机"
|
||||||
}, 双面打印: ${duplexMode ? "是" : "否"}`
|
}, 双面打印: ${duplexMode ? "是" : "否"}`
|
||||||
@@ -315,7 +312,6 @@ ipcMain.handle("print-pdf", async (event, pdfDataOrUrl, printOptions = {}) => {
|
|||||||
silent: true, // 静默打印
|
silent: true, // 静默打印
|
||||||
duplex: duplexMode || false, // 双面打印选项
|
duplex: duplexMode || false, // 双面打印选项
|
||||||
};
|
};
|
||||||
|
|
||||||
await ptp.print(pdfFilePath, printOptions_ptp);
|
await ptp.print(pdfFilePath, printOptions_ptp);
|
||||||
|
|
||||||
log.info("PDF打印请求已发送成功");
|
log.info("PDF打印请求已发送成功");
|
||||||
|
|||||||
Reference in New Issue
Block a user