代码拉取完成,页面将自动刷新
npm install git+http://dev.ligotop.com/zhangheng/sumatra-pdf.git
npm install git+http://dev.ligotop.com/zhangheng/sumatra-pdf.git#fix-memory 在 package.json 里
"dependencies": {
...
"sumatra-pdf": "git+http://dev.ligotop.com/zhangheng/sumatra-pdf.git#fix-memory",
...
},
var Reader = require('sumatra-pdf');
var pdf = 'filepath';
//options = {pdf: 'path', restrict: false, ... }
var reader = new Reader(options);
// 查看模式,禁止下载和打印文件
// {fullscreen: true, ...}
reader.view(options);
// 后台打印,可用于打印套餐
// print_settings eg:
// "1-3,5,10-8,odd,fit,bin=2" prints pages 1, 3, 5, 9 (i.e. the odd pages from the ranges 1-3, 5-5 and 10-8) and scales them so that they fit into the printable area of the paper.
// "3x" : prints the document 3 times.
reader.silent_print({pdf: 'path', print_settings: '1-10', ...});
// 显示打印对话框,由用户决定怎么打印
// print_settings是否有效未测试
reader.dialog_print({pdf: 'path', print_settings: 'odd', ...});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。