-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprinter.stub.php
More file actions
369 lines (338 loc) · 7.81 KB
/
printer.stub.php
File metadata and controls
369 lines (338 loc) · 7.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<?php
const PRINTER_COPIES = 0;
const PRINTER_MODE = 1;
const PRINTER_TITLE = 2;
const PRINTER_DEVICENAME = 13;
const PRINTER_DRIVERVERSION = 14;
const PRINTER_OUTPUT_FILE = 15;
const PRINTER_RESOLUTION_Y = 4;
const PRINTER_RESOLUTION_X = 5;
const PRINTER_SCALE = 9;
const PRINTER_BACKGROUND_COLOR = 10;
const PRINTER_PAPER_LENGTH = 7;
const PRINTER_PAPER_WIDTH = 8;
const PRINTER_PAPER_FORMAT = 6;
const PRINTER_FORMAT_CUSTOM = 0;
const PRINTER_FORMAT_LETTER = 1;
const PRINTER_FORMAT_LEGAL = 5;
const PRINTER_FORMAT_A3 = 8;
const PRINTER_FORMAT_A4 = 9;
const PRINTER_FORMAT_A5 = 11;
const PRINTER_FORMAT_B4 = 12;
const PRINTER_FORMAT_B5 = 13;
const PRINTER_FORMAT_FOLIO = 14;
const PRINTER_ORIENTATION = 3;
const PRINTER_ORIENTATION_PORTRAIT = 1;
const PRINTER_ORIENTATION_LANDSCAPE = 2;
const PRINTER_TEXT_COLOR = 11;
const PRINTER_TEXT_ALIGN = 12;
const PRINTER_TA_BASELINE = 24;
const PRINTER_TA_BOTTOM = 8;
const PRINTER_TA_TOP = 0;
const PRINTER_TA_CENTER = 6;
const PRINTER_TA_LEFT = 0;
const PRINTER_TA_RIGHT = 2;
const PRINTER_PEN_SOLID = 0;
const PRINTER_PEN_DASH = 1;
const PRINTER_PEN_DOT = 2;
const PRINTER_PEN_DASHDOT = 3;
const PRINTER_PEN_DASHDOTDOT = 4;
const PRINTER_PEN_INVISIBLE = 5;
const PRINTER_BRUSH_SOLID = -1;
const PRINTER_BRUSH_CUSTOM = -2;
const PRINTER_BRUSH_DIAGONAL = 3;
const PRINTER_BRUSH_CROSS = 4;
const PRINTER_BRUSH_DIAGCROSS = 5;
const PRINTER_BRUSH_FDIAGONAL = 2;
const PRINTER_BRUSH_HORIZONTAL = 0;
const PRINTER_BRUSH_VERTICAL = 1;
const PRINTER_FW_THIN = 100;
const PRINTER_FW_ULTRALIGHT = 200;
const PRINTER_FW_LIGHT = 300;
const PRINTER_FW_NORMAL = 400;
const PRINTER_FW_MEDIUM = 500;
const PRINTER_FW_BOLD = 700;
const PRINTER_FW_ULTRABOLD = 800;
const PRINTER_FW_HEAVY = 900;
const PRINTER_ENUM_LOCAL = 2;
const PRINTER_ENUM_NAME = 8;
const PRINTER_ENUM_SHARED = 32;
const PRINTER_ENUM_DEFAULT = 1;
const PRINTER_ENUM_CONNECTIONS = 4;
const PRINTER_ENUM_NETWORK = 64;
const PRINTER_ENUM_REMOTE = 16;
/**
* Open a connection to a printer
*
* @param string|null $printername
* @return resource
*/
function printer_open(?string $printername){}
/**
* Close a connection to a printer
*
* @param $connection
* @return bool
*/
function printer_close($connection) : bool{}
/**
* Write data to a printer
*
* @param $connection
* @param string $content
* @return bool
*/
function printer_write($connection, string $content) : bool{}
/**
* List all printers and metadata
*
* @param int $enum_type
* @param string|null $name
* @param int|null $level
* @return array
*/
function printer_list(int $enum_type, ?string $name, ?int $level) : array{}
/**
* Set an option on a printer. See constants.
*
* @param $connection
* @param int $option
* @param $value
* @return bool
*/
function printer_set_option($connection, int $option, $value) : bool{}
/**
* Get options values previously set with printer_set_option
* @param $connection
* @param int $option
* @return void
*/
function printer_get_option($connection, int $option){}
/**
* Create a device context to start drawing with GDI
* @param $connection
* @return void
*/
function printer_create_dc($connection) : void{}
/**
* Delete a device context to end drawing with GDI
* @param $connection
* @return bool
*/
function printer_delete_dc($connection) : bool{}
/**
* Start a new document
*
* @param $connection
* @param string|null $doc_name
* @return bool
*/
function printer_start_doc($connection, ?string $doc_name) : bool{}
/**
* End a document
*
* @param $connection
* @return bool
*/
function printer_end_doc($connection) : bool{}
/**
* Start a page within a document
*
* @param $connection
* @return bool
*/
function printer_start_page($connection) : bool{}
/**
* End page within document
*
* @param $connection
* @return bool
*/
function printer_end_page($connection) : bool{}
/**
* Create a pen for drawing with GDI
*
* @param int $style
* @param int $width
* @param string $color
* @return void
*/
function printer_create_pen(int $style, int $width, string $color){}
/**
* Delete pen
*
* @param $pen
* @return bool
*/
function printer_delete_pen($pen) : bool{}
/**
* Select a pen to use for drawing with GDI
*
* @param $connection
* @param $pen
* @return bool
*/
function printer_select_pen($connection, $pen) : bool{}
/**
* Create a brish for drwing with GDI
* @param int $style
* @param string $param
* @return void
*/
function printer_create_brush(int $style, string $param){}
/**
* Delete brush
* @param $brush
* @return bool
*/
function printer_delete_brush($brush) : bool{}
/**
* Select brush to use for drawing with GDI
*
* @param $connection
* @param $brush
* @return bool
*/
function printer_select_brush($connection, $brush) : bool{}
/**
* Create a font for drawing text with GDI
*
* @param string $face
* @param int $height
* @param int $width
* @param int $weight
* @param bool $italic
* @param bool $underline
* @param bool $strikeout
* @param int $orientation
* @return void
*/
function printer_create_font(string $face, int $height, int $width, int $weight, bool $italic, bool $underline, bool $strikeout, int $orientation){}
/**
* Delete font
*
* @param $font
* @return bool
*/
function printer_delete_font($font) : bool{}
/**
* Select font for drawing with GDI
*
* @param $connection
* @param $font
* @return bool
*/
function printer_select_font($connection, $font) : bool{}
/**
* Calculate font height
*
* @param $connection
* @param int $height
* @return int|null
*/
function printer_logical_fontheight($connection, int $height) : ?int{}
/**
* Draw rounded rectangle
*
* @param $connection
* @param int $ul_x
* @param int $ul_y
* @param int $lr_x
* @param int $lr_y
* @param int $width
* @param int $height
* @return bool
*/
function printer_draw_roundrect($connection, int $ul_x, int $ul_y, int $lr_x, int $lr_y, int $width, int $height) : bool{}
/**
* Draw rectangle
*
* @param $connection
* @param int $ul_x
* @param int $ul_y
* @param int $lr_x
* @param int $lr_y
* @return bool
*/
function printer_draw_rectangle($connection, int $ul_x, int $ul_y, int $lr_x, int $lr_y) : bool{}
/**
* Draw text
*
* @param $connection
* @param string $text
* @param int $x
* @param int $y
* @return bool
*/
function printer_draw_text($connection, string $text, int $x, int $y) : bool{}
/**
* Draw ellipse
*
* @param $connection
* @param int $ul_x
* @param int $ul_y
* @param int $lr_x
* @param int $lr_y
* @return bool
*/
function printer_draw_ellipse($connection, int $ul_x, int $ul_y, int $lr_x, int $lr_y) : bool{}
/**
* Draw line
*
* @param $connection
* @param int $fx
* @param int $fy
* @param int $tx
* @param int $ty
* @return bool
*/
function printer_draw_line($connection, int $fx, int $fy, int $tx, int $ty) : bool{}
/**
* Draw chord
*
* @param $connection
* @param int $rec_x
* @param int $rec_y
* @param int $rec_x1
* @param int $rec_y1
* @param int $rad_x
* @param int $rad_y
* @param int $rad_x1
* @param int $rad_y1
* @return bool
*/
function printer_draw_chord($connection, int $rec_x, int $rec_y, int $rec_x1, int $rec_y1, int $rad_x, int $rad_y, int $rad_x1, int $rad_y1) : bool{}
/**
* Draw pie
*
* @param $connection
* @param int $rec_x
* @param int $rec_y
* @param int $rec_x1
* @param int $rec_y1
* @param int $rad1_x
* @param int $rad1_y
* @param int $rad2_x
* @param int $rad2_y
* @return bool
*/
function printer_draw_pie($connection, int $rec_x, int $rec_y, int $rec_x1, int $rec_y1, int $rad1_x, int $rad1_y, int $rad2_x, int $rad2_y) : bool{}
/**
* Draw BMP
*
* @param $connection
* @param string $filename
* @param int $x
* @param int $y
* @param int|null $width
* @param int|null $height
* @return bool
*/
function printer_draw_bmp($connection, string $filename, int $x, int $y, ?int $width, ?int $height) : bool{}
/**
* Abort print job
*
* @param $connection
* @return bool
*/
function printer_abort($connection) : bool{}