0.1.0 • Published 4 years ago
cordova-plugin-jspdf-printer v0.1.0
cordova-plugin-jspdf-printer
A plugin for cordova to print a jsPDF generated PDF on OSX/macOS 10.9+
Installation
Install the latest head version:
$ cordova plugin add cordova-plugin-jspdf-printer
Usage
The plugin creates an object printJSPDF
and is accessible after deviceready has been fired. This object contains a three functions:
printJSPDF.getPrinters(callback)
printJSPDF.getPrinters(function(x){
alert(x) // Array of Printer Names
});
printJSPDF.getPrinterDescription(printerName,callback)
printJSPDF.getPrinterDescription('printerName', function(d){
alert(d) // Description of Named Printer
});
printJSPDF.printPDF(doc.output(), printerName, width, height, callback)
// Create jsPDF Document
var doc = new jsPDF('p', 'mm', [165.3,287.85]);
doc.text('Sample Text', 15, 80);
// Print jsPDF Document
printJSPDF.printPDF(doc.output(), 'DYMO LabelWriter 450 Turbo', 165.3, 287.85, function(d){
console.log(d)
});
( Bypasses the system print dialog )
0.1.0
4 years ago