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
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/printer.xml, last change in rev 1.6 -->
<refentry id="function.printer-set-option">
<refnamediv>
<refname>printer_set_option</refname>
<refpurpose>Configure the printer connection</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>printer_set_option</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>option</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
The function sets the following options for the current connection.
<parameter>handle</parameter> must be a valid handle to a printer.
For <parameter>option</parameter> can be one of the following constants:
<itemizedlist>
<listitem>
<simpara>
<parameter>PRINTER_COPIES</parameter>:
sets how many copies should be printed, <parameter>value</parameter>
must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_MODE</parameter>:
specifies the type of data (text, raw or emf),
<parameter>value</parameter> must be a string.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TITLE</parameter>:
specifies the name of the document, <parameter>value</parameter>
must be a string.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_ORIENTATION</parameter>:
specifies the orientation of the paper, <parameter>value</parameter>
can be either PRINTER_ORIENTATION_PORTRAIT or
PRINTER_ORIENTATION_LANDSCAPE
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_RESOLUTION_Y</parameter>:
specifies the y-resolution in DPI, <parameter>value</parameter>
must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_RESOLUTION_X</parameter>:
specifies the x-resolution in DPI, <parameter>value</parameter>
must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_PAPER_FORMAT</parameter>:
specifies a predefined paper format, set <parameter>value</parameter>
to PRINTER_FORMAT_CUSTOM if you want to specify a custom format with
PRINTER_PAPER_WIDTH and PRINTER_PAPER_LENGTH. <parameter>value</parameter>
can be one of the following constants.
</simpara>
<itemizedlist>
<listitem>
<simpara>
<parameter> PRINTER_FORMAT_CUSTOM</parameter>:
let's you specify a custom paper format.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter> PRINTER_FORMAT_LETTER</parameter>:
specifies standard letter format (8 1/2- by 11-inches).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter> PRINTER_FORMAT_LEGAL</parameter>:
specifies standard legal format (8 1/2- by 14-inches).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_A3</parameter>:
specifies standard A3 format (297- by 420-millimeters).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_A4</parameter>:
specifies standard A4 format (210- by 297-millimeters).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_A5</parameter>:
specifies standard A5 format (148- by 210-millimeters).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_B4</parameter>:
specifies standard B4 format (250- by 354-millimeters).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_B5</parameter>:
specifies standard B5 format (182- by 257-millimeter).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_FOLIO</parameter>:
specifies standard FOLIO format (8 1/2- by 13-inch).
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_PAPER_LENGTH</parameter>:
if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM,
PRINTER_PAPER_LENGTH specifies a custom paper length in mm,
<parameter>value</parameter> must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_PAPER_WIDTH</parameter>:
if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM,
PRINTER_PAPER_WIDTH specifies a custom paper width in mm,
<parameter>value</parameter> must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_SCALE</parameter>:
specifies the factor by which the printed output is to be scaled.
the page size is scaled from the physical page size by a factor
of scale/100. for example if you set the scale to 50, the output
would be half of its original size. <parameter>value</parameter>
must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_BACKGROUND_COLOR</parameter>:
specifies the background color for the actual device context,
<parameter>value</parameter> must be a string containing the rgb
information in hex format i.e. "005533".
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TEXT_COLOR</parameter>:
specifies the text color for the actual device context,
<parameter>value</parameter> must be a string containing the rgb
information in hex format i.e. "005533".
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TEXT_ALIGN</parameter>:
specifies the text alignment for the actual device context,
<parameter>value</parameter> can be combined through OR'ing the
following constants:
</simpara>
<itemizedlist>
<listitem>
<simpara>
<parameter>PRINTER_TA_BASELINE</parameter>:
text will be aligned at the base line.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_BOTTOM</parameter>:
text will be aligned at the bottom.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_TOP</parameter>:
text will be aligned at the top.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_CENTER</parameter>:
text will be aligned at the center.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_LEFT</parameter>:
text will be aligned at the left.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_RIGHT</parameter>:
text will be aligned at the right.
</simpara>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</para>
<example>
<title><function>printer_set_option</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$handle = printer_open();
printer_set_option($handle, PRINTER_SCALE, 75);
printer_set_option($handle, PRINTER_TEXT_ALIGN, PRINTER_TA_LEFT);
printer_close($handle);
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|