source: www/manuals/PHP_manual/function.printer-set-option.html@ 1

Last change on this file since 1 was 1, checked in by george, 17 years ago

Prvotní import všeho

File size: 9.1 KB
Line 
1<HTML
2><HEAD
3><TITLE
4>printer_set_option</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
8REL="HOME"
9TITLE="Manuál PHP"
10HREF="index.html"><LINK
11REL="UP"
12TITLE="Printer functions"
13HREF="ref.printer.html"><LINK
14REL="PREVIOUS"
15TITLE="printer_select_pen"
16HREF="function.printer-select-pen.html"><LINK
17REL="NEXT"
18TITLE="printer_start_doc"
19HREF="function.printer-start-doc.html"><META
20HTTP-EQUIV="Content-type"
21CONTENT="text/html; charset=ISO-8859-2"></HEAD
22><BODY
23CLASS="refentry"
24BGCOLOR="#FFFFFF"
25TEXT="#000000"
26LINK="#0000FF"
27VLINK="#840084"
28ALINK="#0000FF"
29><DIV
30CLASS="NAVHEADER"
31><TABLE
32SUMMARY="Header navigation table"
33WIDTH="100%"
34BORDER="0"
35CELLPADDING="0"
36CELLSPACING="0"
37><TR
38><TH
39COLSPAN="3"
40ALIGN="center"
41>Manuál PHP</TH
42></TR
43><TR
44><TD
45WIDTH="10%"
46ALIGN="left"
47VALIGN="bottom"
48><A
49HREF="function.printer-select-pen.html"
50ACCESSKEY="P"
51>Pøedcházející</A
52></TD
53><TD
54WIDTH="80%"
55ALIGN="center"
56VALIGN="bottom"
57></TD
58><TD
59WIDTH="10%"
60ALIGN="right"
61VALIGN="bottom"
62><A
63HREF="function.printer-start-doc.html"
64ACCESSKEY="N"
65>Dal¹í</A
66></TD
67></TR
68></TABLE
69><HR
70ALIGN="LEFT"
71WIDTH="100%"></DIV
72><H1
73><A
74NAME="function.printer-set-option"
75></A
76>printer_set_option</H1
77><DIV
78CLASS="refnamediv"
79><A
80NAME="AEN73371"
81></A
82><P
83> (no version information, might be only in CVS)</P
84>printer_set_option&nbsp;--&nbsp;Configure the printer connection</DIV
85><DIV
86CLASS="refsect1"
87><A
88NAME="AEN73374"
89></A
90><H2
91>Description</H2
92>bool <B
93CLASS="methodname"
94>printer_set_option</B
95> ( resource handle, int option, mixed value)<BR
96></BR
97><P
98>&#13; The function sets the following options for the current connection.
99 <TT
100CLASS="parameter"
101><I
102>handle</I
103></TT
104> must be a valid handle to a printer.
105 For <TT
106CLASS="parameter"
107><I
108>option</I
109></TT
110> can be one of the following constants:
111 <P
112></P
113><UL
114><LI
115><P
116>&#13; <TT
117CLASS="parameter"
118><I
119>PRINTER_COPIES</I
120></TT
121>:
122 sets how many copies should be printed, <TT
123CLASS="parameter"
124><I
125>value</I
126></TT
127>
128 must be an integer.
129 </P
130></LI
131><LI
132><P
133>&#13; <TT
134CLASS="parameter"
135><I
136>PRINTER_MODE</I
137></TT
138>:
139 specifies the type of data (text, raw or emf),
140 <TT
141CLASS="parameter"
142><I
143>value</I
144></TT
145> must be a string.
146 </P
147></LI
148><LI
149><P
150>&#13; <TT
151CLASS="parameter"
152><I
153>PRINTER_TITLE</I
154></TT
155>:
156 specifies the name of the document, <TT
157CLASS="parameter"
158><I
159>value</I
160></TT
161>
162 must be a string.
163 </P
164></LI
165><LI
166><P
167>&#13; <TT
168CLASS="parameter"
169><I
170>PRINTER_ORIENTATION</I
171></TT
172>:
173 specifies the orientation of the paper, <TT
174CLASS="parameter"
175><I
176>value</I
177></TT
178>
179 can be either PRINTER_ORIENTATION_PORTRAIT or
180 PRINTER_ORIENTATION_LANDSCAPE
181 </P
182></LI
183><LI
184><P
185>&#13; <TT
186CLASS="parameter"
187><I
188>PRINTER_RESOLUTION_Y</I
189></TT
190>:
191 specifies the y-resolution in DPI, <TT
192CLASS="parameter"
193><I
194>value</I
195></TT
196>
197 must be an integer.
198 </P
199></LI
200><LI
201><P
202>&#13; <TT
203CLASS="parameter"
204><I
205>PRINTER_RESOLUTION_X</I
206></TT
207>:
208 specifies the x-resolution in DPI, <TT
209CLASS="parameter"
210><I
211>value</I
212></TT
213>
214 must be an integer.
215 </P
216></LI
217><LI
218><P
219>&#13; <TT
220CLASS="parameter"
221><I
222>PRINTER_PAPER_FORMAT</I
223></TT
224>:
225 specifies the a predefined paper format, set <TT
226CLASS="parameter"
227><I
228>value</I
229></TT
230>
231 to PRINTER_FORMAT_CUSTOM if you want to specify a custom format with
232 PRINTER_PAPER_WIDTH and PRINTER_PAPER_LENGTH. <TT
233CLASS="parameter"
234><I
235>value</I
236></TT
237>
238 can be one of the following constants.
239 </P
240><P
241></P
242><UL
243><LI
244><P
245>&#13; <TT
246CLASS="parameter"
247><I
248> PRINTER_FORMAT_CUSTOM</I
249></TT
250>:
251 let's you specify a custom paper format.
252 </P
253></LI
254><LI
255><P
256>&#13; <TT
257CLASS="parameter"
258><I
259> PRINTER_FORMAT_LETTER</I
260></TT
261>:
262 specifies standard letter format (8 1/2- by 11-inches).
263 </P
264></LI
265><LI
266><P
267>&#13; <TT
268CLASS="parameter"
269><I
270> PRINTER_FORMAT_LETTER</I
271></TT
272>:
273 specifies standard legal format (8 1/2- by 14-inches).
274 </P
275></LI
276><LI
277><P
278>&#13; <TT
279CLASS="parameter"
280><I
281>PRINTER_FORMAT_A3</I
282></TT
283>:
284 specifies standard A3 format (297- by 420-millimeters).
285 </P
286></LI
287><LI
288><P
289>&#13; <TT
290CLASS="parameter"
291><I
292>PRINTER_FORMAT_A4</I
293></TT
294>:
295 specifies standard A4 format (210- by 297-millimeters).
296 </P
297></LI
298><LI
299><P
300>&#13; <TT
301CLASS="parameter"
302><I
303>PRINTER_FORMAT_A5</I
304></TT
305>:
306 specifies standard A5 format (148- by 210-millimeters).
307 </P
308></LI
309><LI
310><P
311>&#13; <TT
312CLASS="parameter"
313><I
314>PRINTER_FORMAT_B4</I
315></TT
316>:
317 specifies standard B4 format (250- by 354-millimeters).
318 </P
319></LI
320><LI
321><P
322>&#13; <TT
323CLASS="parameter"
324><I
325>PRINTER_FORMAT_B5</I
326></TT
327>:
328 specifies standard B5 format (182- by 257-millimeter).
329 </P
330></LI
331><LI
332><P
333>&#13; <TT
334CLASS="parameter"
335><I
336>PRINTER_FORMAT_FOLIO</I
337></TT
338>:
339 specifies standard FOLIO format (8 1/2- by 13-inch).
340 </P
341></LI
342></UL
343></LI
344><LI
345><P
346>&#13; <TT
347CLASS="parameter"
348><I
349>PRINTER_PAPER_LENGTH</I
350></TT
351>:
352 if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM,
353 PRINTER_PAPER_LENGTH specifies a custom paper length in mm,
354 <TT
355CLASS="parameter"
356><I
357>value</I
358></TT
359> must be an integer.
360 </P
361></LI
362><LI
363><P
364>&#13; <TT
365CLASS="parameter"
366><I
367>PRINTER_PAPER_WIDTH</I
368></TT
369>:
370 if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM,
371 PRINTER_PAPER_WIDTH specifies a custom paper width in mm,
372 <TT
373CLASS="parameter"
374><I
375>value</I
376></TT
377> must be an integer.
378 </P
379></LI
380><LI
381><P
382>&#13; <TT
383CLASS="parameter"
384><I
385>PRINTER_SCALE</I
386></TT
387>:
388 specifies the factor by which the printed output is to be scaled.
389 the page size is scaled from the physical page size by a factor
390 of scale/100. for example if you set the scale to 50, the output
391 would be half of it's original size. <TT
392CLASS="parameter"
393><I
394>value</I
395></TT
396>
397 must be an integer.
398 </P
399></LI
400><LI
401><P
402>&#13; <TT
403CLASS="parameter"
404><I
405>PRINTER_BACKGROUND_COLOR</I
406></TT
407>:
408 specifies the background color for the actual device context,
409 <TT
410CLASS="parameter"
411><I
412>value</I
413></TT
414> must be a string containing the rgb
415 information in hex format i.e. "005533".
416 </P
417></LI
418><LI
419><P
420>&#13; <TT
421CLASS="parameter"
422><I
423>PRINTER_TEXT_COLOR</I
424></TT
425>:
426 specifies the text color for the actual device context,
427 <TT
428CLASS="parameter"
429><I
430>value</I
431></TT
432> must be a string containing the rgb
433 information in hex format i.e. "005533".
434 </P
435></LI
436><LI
437><P
438>&#13; <TT
439CLASS="parameter"
440><I
441>PRINTER_TEXT_ALIGN</I
442></TT
443>:
444 specifies the text alignment for the actual device context,
445 <TT
446CLASS="parameter"
447><I
448>value</I
449></TT
450> can be combined through OR'ing the
451 following constants:
452 </P
453><P
454></P
455><UL
456><LI
457><P
458>&#13; <TT
459CLASS="parameter"
460><I
461>PRINTER_TA_BASELINE</I
462></TT
463>:
464 text will be aligned at the base line.
465 </P
466></LI
467><LI
468><P
469>&#13; <TT
470CLASS="parameter"
471><I
472>PRINTER_TA_BOTTOM</I
473></TT
474>:
475 text will be aligned at the bottom.
476 </P
477></LI
478><LI
479><P
480>&#13; <TT
481CLASS="parameter"
482><I
483>PRINTER_TA_TOP</I
484></TT
485>:
486 text will be aligned at the top.
487 </P
488></LI
489><LI
490><P
491>&#13; <TT
492CLASS="parameter"
493><I
494>PRINTER_TA_CENTER</I
495></TT
496>:
497 text will be aligned at the center.
498 </P
499></LI
500><LI
501><P
502>&#13; <TT
503CLASS="parameter"
504><I
505>PRINTER_TA_LEFT</I
506></TT
507>:
508 text will be aligned at the left.
509 </P
510></LI
511><LI
512><P
513>&#13; <TT
514CLASS="parameter"
515><I
516>PRINTER_TA_RIGHT</I
517></TT
518>:
519 text will be aligned at the right.
520 </P
521></LI
522></UL
523></LI
524></UL
525>
526 </P
527><TABLE
528WIDTH="100%"
529BORDER="0"
530CELLPADDING="0"
531CELLSPACING="0"
532CLASS="EXAMPLE"
533><TR
534><TD
535><DIV
536CLASS="example"
537><A
538NAME="AEN73492"
539></A
540><P
541><B
542>Pøíklad 1. <B
543CLASS="function"
544>printer_set_option()</B
545> example</B
546></P
547><TABLE
548BORDER="0"
549BGCOLOR="#E0E0E0"
550CELLPADDING="5"
551><TR
552><TD
553><PRE
554CLASS="php"
555>$handle = printer_open();
556printer_set_option($handle, PRINTER_SCALE, 75);
557printer_set_option($handle, PRINTER_TEXT_ALIGN, PRINTER_TA_LEFT);
558printer_close($handle);</PRE
559></TD
560></TR
561></TABLE
562></DIV
563></TD
564></TR
565></TABLE
566></DIV
567><DIV
568CLASS="NAVFOOTER"
569><HR
570ALIGN="LEFT"
571WIDTH="100%"><TABLE
572SUMMARY="Footer navigation table"
573WIDTH="100%"
574BORDER="0"
575CELLPADDING="0"
576CELLSPACING="0"
577><TR
578><TD
579WIDTH="33%"
580ALIGN="left"
581VALIGN="top"
582><A
583HREF="function.printer-select-pen.html"
584ACCESSKEY="P"
585>Pøedcházející</A
586></TD
587><TD
588WIDTH="34%"
589ALIGN="center"
590VALIGN="top"
591><A
592HREF="index.html"
593ACCESSKEY="H"
594>Domù</A
595></TD
596><TD
597WIDTH="33%"
598ALIGN="right"
599VALIGN="top"
600><A
601HREF="function.printer-start-doc.html"
602ACCESSKEY="N"
603>Dal¹í</A
604></TD
605></TR
606><TR
607><TD
608WIDTH="33%"
609ALIGN="left"
610VALIGN="top"
611>printer_select_pen</TD
612><TD
613WIDTH="34%"
614ALIGN="center"
615VALIGN="top"
616><A
617HREF="ref.printer.html"
618ACCESSKEY="U"
619>Nahoru</A
620></TD
621><TD
622WIDTH="33%"
623ALIGN="right"
624VALIGN="top"
625>printer_start_doc</TD
626></TR
627></TABLE
628></DIV
629></BODY
630></HTML
631>
Note: See TracBrowser for help on using the repository browser.