@rafaolivas/printer
TypeScript icon, indicating that this package has built-in type declarations

0.4.8 • Public • Published

@rafaolivas/printer

Simple http service to print html content as a document in a system printer

oclif Version Downloads/week License

Installation

npm install -g @rafaolivas/printer

Usage

$ printer [options]
Listening at http://computer:2433/rut (format: undefined)

then do a POST request to http://computer:2433/print with body

{
    "document": "<h1>Hello world!</h1>"
}

This will print a document to your default printer.

Options

-c, --cert=cert                                             Path to the cert file to enable https protocol (must be provided along with key file)
-f, --format=(A3|A4|A5|Legal|Letter|Tabloid|Kiosk-Receipt)  Document format that will be printed
-h, --help                                                  show CLI help
-k, --key=key                                               Path to the key file to enable https protocol (must be provided along with cert file)
-p, --port=port                                             Port in wich the service will listen for requests, 2433 by default
-v, --version                                               show CLI version
--height=height                                             Height of the document. Only valid when format is not defined and width is also defined. Unit must be specified, e.g. 80mm, 30px, etc
--width=width                                               Width of the document. Only valid when format is not defined and height is also defined. Unit must be specified, e.g. 80mm, 30px, etc

Known problems

  • If you configure this service to run as a Scheduled Task on Windows you should also specify that the task will run from your $HOME directory, otherwise there may be permission problems.

Readme

Keywords

Package Sidebar

Install

npm i @rafaolivas/printer

Weekly Downloads

1

Version

0.4.8

License

MIT

Unpacked Size

9.9 kB

Total Files

6

Last publish

Collaborators

  • rafaolivas