@gohcltech/edge-print-client 2.0.61-develop → 2.0.70-develop
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/edge-print.d.ts +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,10 +119,22 @@ Each `PrinterInfo` object includes:
|
|
|
119
119
|
| `duplex` | `boolean?` | `true` if the printer supports double-sided printing |
|
|
120
120
|
| `trays` | `TrayInfo[]?` | Input trays/bins (see below) |
|
|
121
121
|
| `papers` | `string[]?` | All supported paper sizes (e.g. `["Letter", "A4"]`) |
|
|
122
|
+
| `mediaTypes` | `string[]?` | Stock types the driver reports (e.g. `["Plain", "Bond"]`). Absent for most printers — see below |
|
|
122
123
|
| `copiesMax` | `number?` | Maximum copies the driver accepts in one job |
|
|
123
124
|
| `orientations` | `string[]?` | Supported orientations (e.g. `["portrait", "landscape"]`) |
|
|
124
125
|
| `virtualPrinter` | `boolean?` | `true` for Developer (virtual) printers injected by the agent |
|
|
125
126
|
|
|
127
|
+
**On `mediaTypes`.** The field is usually absent. Of eleven drivers surveyed,
|
|
128
|
+
eight listed no stock types at all, and a ninth listed them only under a
|
|
129
|
+
vendor-private key whose values are the driver's internal codes rather than
|
|
130
|
+
names you could choose from — the agent reports nothing in that case too. When
|
|
131
|
+
the field is absent the agent accepts whatever stock you ask for rather than
|
|
132
|
+
guessing. When it *is*
|
|
133
|
+
present the strings are the driver's own and are not always self-describing, so
|
|
134
|
+
read them off the target machine (the agent's Printers tab lists them) rather
|
|
135
|
+
than assuming a vocabulary. Passing a value the printer does not list rejects
|
|
136
|
+
with `unsupported_value`, and the error's `supported` array names the real ones.
|
|
137
|
+
|
|
126
138
|
1.x agents sent `is_default`, `share_name`, `copies_max` and `virtual_printer`.
|
|
127
139
|
Those spellings are still accepted on read and mapped onto the camelCase fields
|
|
128
140
|
above, so nothing downstream sees the old names. **Removed in 3.0.**
|
|
@@ -223,6 +235,7 @@ Two limits worth knowing before you build on this:
|
|
|
223
235
|
| `colorType` | `'color' \| 'grayscale' \| 'black-white'?` | Color mode |
|
|
224
236
|
| `paperSize` | `string?` | Paper size from `PrinterInfo.papers` (e.g. `"Letter"`) |
|
|
225
237
|
| `tray` | `string?` | Tray name from `TrayInfo.name` (e.g. `"Tray 1"`) |
|
|
238
|
+
| `mediaType` | `string?` | Stock type from `PrinterInfo.mediaTypes` (e.g. `"Bond"`). Rejected for `raw`/`html` content and network targets |
|
|
226
239
|
|
|
227
240
|
**`data`** — `PrintData[]`
|
|
228
241
|
|
package/dist/edge-print.d.ts
CHANGED
|
@@ -66,6 +66,16 @@ export interface PrintConfig {
|
|
|
66
66
|
* Omit to use the printer's current default.
|
|
67
67
|
*/
|
|
68
68
|
tray?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Media / stock type, exactly as returned by {@link PrinterInfo.mediaTypes}
|
|
71
|
+
* (e.g. `"Plain"`, `"Bond"`, `"Thermal"`). Changes how the printer feeds and
|
|
72
|
+
* fuses the page. Omit to use the printer's current default.
|
|
73
|
+
*
|
|
74
|
+
* Not supported for `raw` or `html` content, or a network target — those
|
|
75
|
+
* paths never reach the printer's driver. Requesting it there rejects with
|
|
76
|
+
* `unsupported_for_path`.
|
|
77
|
+
*/
|
|
78
|
+
mediaType?: string;
|
|
69
79
|
}
|
|
70
80
|
/**
|
|
71
81
|
* A single unit of content to be printed.
|
|
@@ -178,6 +188,18 @@ export interface PrinterInfo {
|
|
|
178
188
|
* Pass one of these values to {@link PrintConfig.paperSize}.
|
|
179
189
|
*/
|
|
180
190
|
papers?: string[];
|
|
191
|
+
/**
|
|
192
|
+
* Stock types the driver reports — card stock, labels, envelopes and so on.
|
|
193
|
+
* Pass one of these values to {@link PrintConfig.mediaType}.
|
|
194
|
+
*
|
|
195
|
+
* Absent for most printers — many drivers report no stock types, and some
|
|
196
|
+
* report them only under a vendor-private key whose values are internal
|
|
197
|
+
* codes rather than choosable names. The agent reports nothing in either
|
|
198
|
+
* case and then accepts whatever is asked rather than guessing. When the
|
|
199
|
+
* field *is* present, the strings are the driver's own and may not be
|
|
200
|
+
* self-describing.
|
|
201
|
+
*/
|
|
202
|
+
mediaTypes?: string[];
|
|
181
203
|
/** Maximum number of copies the driver accepts in a single job. */
|
|
182
204
|
copiesMax?: number;
|
|
183
205
|
/** Page orientations the driver supports (e.g. `["portrait", "landscape"]`). */
|