-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16227ff
commit fd60dbe
Showing
11 changed files
with
39 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
var printer = require("../lib") | ||
, template = "N\nS4\nD15\nq400\nR\nB20,10,0,1,2,30,173,B,\"barcode\"\nP0\n"; | ||
var printer = require("..") | ||
, template = "N\nS4\nD15\nq400\nR\nB20,10,0,1,2,30,173,B,\"barcode\"\nP0\n"; | ||
|
||
function printZebra(barcode_text, printer_name){ | ||
printer.printDirect({data:template.replace(/barcode/, barcode_text) | ||
, printer:printer_name | ||
, type: "RAW" | ||
, success:function(){ | ||
console.log("printed: "+barcode_text); | ||
} | ||
, error:function(err){console.log(err);} | ||
}); | ||
printer.printDirect({data:template.replace(/barcode/, barcode_text) | ||
, printer:printer_name | ||
, type: "RAW" | ||
, success:function(){ | ||
console.log("printed: "+barcode_text); | ||
} | ||
, error:function(err){console.log(err);} | ||
}); | ||
} | ||
|
||
printZebra("123", "ZEBRA"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
var printer = require("../lib"); | ||
var printer = require(".."); | ||
|
||
console.log('default printer name: ' + (printer.getDefaultPrinterName() || 'is not defined on your computer')); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
var printer = require("../lib"), | ||
var printer = require(".."), | ||
util = require('util'), | ||
printers = printer.getPrinters(); | ||
|
||
printers.forEach(function(iPrinter, i){ | ||
console.log('' + i + 'ppd for printer "' + iPrinter.name + '":' + util.inspect(printer.getPrinterDriverOptions(iPrinter.name), {colors:true, depth:10} )); | ||
console.log('\tselected page size:'+ printer.getSelectedPaperSize(iPrinter.name) + '\n'); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var printer = require("../lib"), | ||
var printer = require(".."), | ||
util = require('util'); | ||
console.log("supported formats are:\n"+util.inspect(printer.getSupportedPrintFormats(), {colors:true, depth:10})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var printer = require("../lib"), //=require('pritner') | ||
var printer = require(".."), //=require('pritner') | ||
util = require('util'); | ||
console.log("supported job commands:\n"+util.inspect(printer.getSupportedJobCommands(), {colors:true, depth:10})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
var printer = require("../lib"); | ||
var printer = require(".."); | ||
|
||
printer.printDirect({data:"print from Node.JS buffer" // or simple String: "some text" | ||
//, printer:'Foxit Reader PDF Printer' // printer name, if missing then will print to default printer | ||
, type: 'RAW' // type: RAW, TEXT, PDF, JPEG, .. depends on platform | ||
, success:function(jobID){ | ||
console.log("sent to printer with ID: "+jobID); | ||
} | ||
, error:function(err){console.log(err);} | ||
//, printer:'Foxit Reader PDF Printer' // printer name, if missing then will print to default printer | ||
, type: 'RAW' // type: RAW, TEXT, PDF, JPEG, .. depends on platform | ||
, success:function(jobID){ | ||
console.log("sent to printer with ID: "+jobID); | ||
} | ||
, error:function(err){console.log(err);} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters