php-doc-en/reference/printer/functions/printer-set-option.xml
Andrioli Darvin 70f4511a21 Replaced : by .
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@82362 c90b9560-bf6c-de11-be94-00142212c4b1
2002-05-15 19:24:36 +00:00

253 lines
8.4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- 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 the 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_LETTER</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 it's 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[
$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
-->