javascript - 如何设置nw.js中print的pdf_path?

查看:161
本文介绍了javascript - 如何设置nw.js中print的pdf_path?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

let printFile = {
                    autoprint: true,
                    mediaSize: {'name': 'CUSTOM', 'width_microns': 215900, 'height_microns': 299400, 'custom_display_name':'Voucher', 'is_default': true},
                    marginsType: 0,
                    marginsCustom: {"marginBottom":0,"marginLeft":10,"marginRight":10,"marginTop": 0},
                    headerFooterEnabled : false,
                    landscape: false,
                    shouldPrintBackgrounds: false,
                    copies: 0,
                    headerString: '',
                    footerString: '',
                    printer: '',
                    pdf_path: path.dirname(process.execPath)
                }

printer这个属性在生存PDF前,被我手动删除了。

但是那个path怎么设置都不对,不知道该怎么写这个PDF_PATH,向各位求教了

解决方案

pdf是路径加文件名~

这篇关于javascript - 如何设置nw.js中print的pdf_path?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆