Skip to content

Commit bcadf3b

Browse files
authored
Update README.md
1 parent 46c952c commit bcadf3b

File tree

1 file changed

+38
-18
lines changed

1 file changed

+38
-18
lines changed

README.md

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
# Raw Printing HTTP Server
2-
Simple HTTP Server to send binary data from browser (javascript) to client local printer. It supports ESC/POS codes and works well with Generic/Text Only Driver. It supports all browser that has XHR implementation.
2+
Simple HTTP Server to send binary data from browser (javascript) to client local or network printer. It supports ESC/POS codes and works well with Generic/Text Only Driver. It supports all browser that has XHR implementation.
3+
4+
## How It Works
5+
<pre>
6+
Cloud (API)
7+
8+
&#x2193; send Print Document (Base64 String)
9+
10+
Browser
11+
12+
&#x2193; Relay the print document
13+
14+
Raw Printing HTTP Server
15+
16+
&#x2193; Convert Base64 to byte array then send
17+
18+
Local or Network Printer
19+
</pre>
20+
21+
## Installation
22+
* Download the zip package [here](https://github.com/lockerace/RawPrintingHTTPServer/releases/latest)
23+
* Extract the zip package
24+
* Run setup.exe
25+
* Follow the steps
26+
* Run Raw Printing HTTP Server from Start (Auto start whenever user sign in)
27+
328
## Configurations
4-
Config file will be in the same directory you install the service named `config.json`.
29+
Config file will be in `%PROGRAMDATA%\lockerace\RawPrintingHTTPServer` named `config.json`.
530
parameters :
631
* allowedDomains: string[] => list of allowed origin domains (please include protocol & port)
732
* port: int => port number to listen (default: 9100)
@@ -16,7 +41,7 @@ example :
1641
"port": 9100
1742
}
1843
```
19-
## Paths :
44+
## Endpoints :
2045
* GET `/` => view current status of the server and remove already allowed domains via GUI
2146
response :
2247
* type: `html`
@@ -31,6 +56,15 @@ response :
3156
* example :
3257
`{ "machineName" : "Somebody-PC", "printers" : ["Microsoft XPS Document Writer", "Fax"] }`
3358

59+
* GET `/permissions` => check whether origin allowed to print
60+
61+
response :
62+
* type: `json`
63+
* values:
64+
* allowed: boolean => whether origin allowed to print or not
65+
* example :
66+
`{ "allowed": true }`
67+
3468
* GET `/permissions` => ask local user permission to allow requested domain to print
3569

3670
query parameters :
@@ -40,20 +74,6 @@ response :
4074
* type: `html`
4175
* description: dialog with 2 buttons, allow and block
4276

43-
* POST `/permissions` => add/remove allowed domain origin to print
44-
45-
accept: `json`
46-
47-
body parameters :
48-
* host: string (required) => domain origin that will be allowed to print which include protocol & port. e.g.: `http://localhost:4200`
49-
* status: string (required) => valid status values :
50-
* `allow`
51-
* `remove`
52-
53-
response :
54-
* type: `html`
55-
* description: script to close allow origin dialog opened at GET `/permission`
56-
5777
* POST `/` => send print job information to printer
5878

5979
accept: `json`
@@ -120,4 +140,4 @@ class AppComponent {
120140
```
121141

122142
# Credits
123-
[Michael Davies](https://www.codeproject.com/Tips/704989/Print-Direct-To-Windows-Printer-EPOS-Receipt)
143+
[Michael Davies](https://www.codeproject.com/Tips/704989/Print-Direct-To-Windows-Printer-EPOS-Receipt)

0 commit comments

Comments
 (0)