环境:"electron": "^22.0.0"、麒麟系统V10(sp1)
1、思路:利用nodejs调linux的打印命令lp打印
2、代码:
const childProcess = require("child_process"); const sp = childProcess.exec('lp ' + "/data/usershare/1.pdf",function(err,stdout,stderr){ if(err){ console.log("子进程启动失败:",err); process.exit(); }else{ console.log("子进程标准输出:",stdout.toString()); } })
标签:21,err,process,打印,electron,linux,pdf From: https://www.cnblogs.com/handsomeziff/p/17008028.html