Add printer info structure file
This commit is contained in:
parent
d5e66f7cd9
commit
a8d25d6855
2 changed files with 42 additions and 32 deletions
40
docs/api/structures/printer-info.md
Normal file
40
docs/api/structures/printer-info.md
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
# PrinterInfo Object
|
||||||
|
|
||||||
|
* `name` String
|
||||||
|
* `description` String
|
||||||
|
* `status` Number
|
||||||
|
* `isDefault` Boolean
|
||||||
|
* `options` Object - Additional fields
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
name: 'Zebra_LP2844',
|
||||||
|
description: 'Zebra LP2844',
|
||||||
|
status: 3,
|
||||||
|
isDefault: false,
|
||||||
|
options: {
|
||||||
|
copies: '1',
|
||||||
|
'device-uri': 'usb://Zebra/LP2844?location=14200000',
|
||||||
|
finishings: '3',
|
||||||
|
'job-cancel-after': '10800',
|
||||||
|
'job-hold-until': 'no-hold',
|
||||||
|
'job-priority': '50',
|
||||||
|
'job-sheets': 'none,none',
|
||||||
|
'marker-change-time': '0',
|
||||||
|
'number-up': '1',
|
||||||
|
'printer-commands': 'none',
|
||||||
|
'printer-info': 'Zebra LP2844',
|
||||||
|
'printer-is-accepting-jobs': 'true',
|
||||||
|
'printer-is-shared': 'true',
|
||||||
|
'printer-location': '',
|
||||||
|
'printer-make-and-model': 'Zebra EPL2 Label Printer',
|
||||||
|
'printer-state': '3',
|
||||||
|
'printer-state-change-time': '1484872644',
|
||||||
|
'printer-state-reasons': 'offline-report',
|
||||||
|
'printer-type': '36932',
|
||||||
|
'printer-uri-supported': 'ipp://localhost/printers/Zebra_LP2844',
|
||||||
|
system_driverinfo: 'Z'
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
```
|
|
@ -918,39 +918,9 @@ when the JS promise is rejected.
|
||||||
|
|
||||||
#### `contents.getPrinters()`
|
#### `contents.getPrinters()`
|
||||||
|
|
||||||
Get the system printer list, the result is an array of printer descriptions.
|
Get the system printer list.
|
||||||
|
|
||||||
```js
|
Returns [PrinterInfo[]](structures/printer-info.md)
|
||||||
[{
|
|
||||||
name: 'Zebra_LP2844',
|
|
||||||
description: 'Zebra LP2844',
|
|
||||||
status: 3,
|
|
||||||
isDefault: 0,
|
|
||||||
options: {
|
|
||||||
copies: '1',
|
|
||||||
'device-uri': 'usb://Zebra/LP2844?location=14200000',
|
|
||||||
finishings: '3',
|
|
||||||
'job-cancel-after': '10800',
|
|
||||||
'job-hold-until': 'no-hold',
|
|
||||||
'job-priority': '50',
|
|
||||||
'job-sheets': 'none,none',
|
|
||||||
'marker-change-time': '0',
|
|
||||||
'number-up': '1',
|
|
||||||
'printer-commands': 'none',
|
|
||||||
'printer-info': 'Zebra LP2844',
|
|
||||||
'printer-is-accepting-jobs': 'true',
|
|
||||||
'printer-is-shared': 'true',
|
|
||||||
'printer-location': '',
|
|
||||||
'printer-make-and-model': 'Zebra EPL2 Label Printer',
|
|
||||||
'printer-state': '3',
|
|
||||||
'printer-state-change-time': '1484872644',
|
|
||||||
'printer-state-reasons': 'offline-report',
|
|
||||||
'printer-type': '36932',
|
|
||||||
'printer-uri-supported': 'ipp://localhost/printers/Zebra_LP2844',
|
|
||||||
system_driverinfo: 'Z'
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `contents.print([options])`
|
#### `contents.print([options])`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue