node-pdfium
Advanced tools
+26
| const pdfium = require('bindings')({ bindings: 'pdfium.node', module_root: __dirname }); | ||
| exports.printPDF = function printPDF({ | ||
| pageList = [], | ||
| width = 0, | ||
| height = 0, | ||
| dpi = 324, | ||
| copies = 1, | ||
| filePath, | ||
| printerName, | ||
| }) { | ||
| return new Promise((resolve, reject) => { | ||
| try { | ||
| pdfium.printPDF(printerName, filePath, { | ||
| pageList, | ||
| width, | ||
| height, | ||
| dpi, | ||
| copies, | ||
| }); | ||
| resolve(null); | ||
| } catch (e) { | ||
| reject(e); | ||
| } | ||
| }); | ||
| }; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| module.exports = require('./lib/pdfium'); | ||
| module.exports = require('./pdfium'); |
+1
-1
| { | ||
| "name": "node-pdfium", | ||
| "version": "2.1.1", | ||
| "version": "2.1.2", | ||
| "description": "node bindings for pdfium", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+1
-1
| const path = require('path'); | ||
| const pdfium = require('../lib/pdfium'); | ||
| const pdfium = require('../'); | ||
@@ -5,0 +5,0 @@ describe('basic pdfium use', () => { |
| const pdfium = require('bindings')('pdfium.node'); | ||
| exports.printPDF = function printPDF({ | ||
| pageList = [], | ||
| width = 0, | ||
| height = 0, | ||
| dpi = 324, | ||
| copies = 1, | ||
| filePath, | ||
| printerName, | ||
| }) { | ||
| return new Promise((resolve, reject) => { | ||
| try { | ||
| pdfium.printPDF(printerName, filePath, { | ||
| pageList, | ||
| width, | ||
| height, | ||
| dpi, | ||
| copies, | ||
| }); | ||
| resolve(null); | ||
| } catch (e) { | ||
| reject(e); | ||
| } | ||
| }); | ||
| }; |
9415369
0