https://github.com/rmja/restprint
Handy rest api for printing to local printers
https://github.com/rmja/restprint
api printing rest
Last synced: 4 months ago
JSON representation
Handy rest api for printing to local printers
- Host: GitHub
- URL: https://github.com/rmja/restprint
- Owner: rmja
- License: mit
- Created: 2019-06-13T19:01:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-27T15:26:29.000Z (almost 6 years ago)
- Last Synced: 2025-08-23T19:36:12.854Z (4 months ago)
- Topics: api, printing, rest
- Language: C#
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RestPrint
RestPrint is a simple rest api that exposes the printers on the machine on where it is run through a simple JSON based REST api.
Example actions are:
Get all installed printers:
```
curl -k https://localhost:9721/Printers
```
Print raw (ESC/POS, Zebra, etc.):
```
curl -k https://localhost:9721/Printers/MyPrinter/Jobs -X POST -H "Content-Type: application/octet-stream" --data-binary @myfile.bin
```
## Install
Install the tool using the following command:
```
dotnet tool install -g restprint
```
## Run
Run the server using the `restprint` command. To allow browsers to print, one can allow cors origins with the `--origins` option:
```
restprint --urls https://localhost:9721 --origins https://my-pos-system:5000;https://my-other-pos-system:5000
```
## Test Tool
```
dotnet pack
dotnet tool install -g --add-source ./bin/Debug restprint
dotnet tool uninstall -g restprint
```
## Deploy Tool
```
dotnet pack --configuration Release
dotnet nuget push .\bin\Release\RestPrint.0.0.1.nupkg --source https://api.nuget.org/v3/index.json --api-key
```