mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-17 01:18:55 +00:00

See: http://www.w3.org/TR/2000/REC-xml-20001006#sec-TextDecl git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@55419 c90b9560-bf6c-de11-be94-00142212c4b1
1693 lines
54 KiB
XML
1693 lines
54 KiB
XML
<?xml encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.9 $ -->
|
|
<reference id="ref.printer">
|
|
<title>Printer functions</title>
|
|
<titleabbrev>Printer</titleabbrev>
|
|
<partintro>
|
|
<simpara>
|
|
These functions are only available under Windows 9.x, ME, NT4 and
|
|
2000. They have been added in PHP 4 (4.0.4).
|
|
</simpara>
|
|
</partintro>
|
|
|
|
|
|
<refentry id="function.printer-open">
|
|
<refnamediv>
|
|
<refname>printer_open</refname>
|
|
<refpurpose>Open connection to a printer</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>mixed <function>printer_open</function></funcdef>
|
|
<paramdef>string <parameter><optional>devicename</optional></parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
This function tries to open a connection to the printer
|
|
<parameter>devicename</parameter>, and returns a handle on success
|
|
or &false; on failure.
|
|
</para>
|
|
<para>
|
|
If no parameter was given it tries to open a
|
|
connection to the default printer (if not specified in
|
|
<filename>php.ini</filename> as
|
|
<literal>printer.default_printer</literal>, php tries to detect it).
|
|
</para>
|
|
<para>
|
|
<function>printer_open</function> also starts a device context.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_open</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open("HP Deskjet 930c");
|
|
$handle = printer_open();
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-abort">
|
|
<refnamediv>
|
|
<refname>printer_abort</refname>
|
|
<refpurpose>Deletes the printer's spool file</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_abort</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
This function deletes the printers spool file.
|
|
</para>
|
|
<para>
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_abort</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_abort($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-close">
|
|
<refnamediv>
|
|
<refname>printer_close</refname>
|
|
<refpurpose>Close an open printer connection</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_close</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
This function closes the printer connection.
|
|
<function>printer_close</function> also closes the active device
|
|
context.
|
|
</para>
|
|
<para>
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_close</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-write">
|
|
<refnamediv>
|
|
<refname>printer_write</refname>
|
|
<refpurpose>Write data to the printer</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_write</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>string <parameter>content</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Writes <parameter>content</parameter> directly to the printer, and
|
|
returns &true; on success or &false; if it failed.
|
|
</para>
|
|
<para>
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_write</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_write($handle, "Text to print");
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-list">
|
|
<refnamediv>
|
|
<refname>printer_list</refname>
|
|
<refpurpose>Return an array of printers attached to the server
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>printer_list</function></funcdef>
|
|
<paramdef>int <parameter>enumtype</parameter></paramdef>
|
|
<paramdef>string <parameter><optional>name</optional></parameter></paramdef>
|
|
<paramdef>int <parameter><optional>level</optional></parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function enumerates available printers and their capabilities.
|
|
<parameter>level</parameter> sets the level of information request.
|
|
Can be 1,2,4 or 5. <parameter>enumtype</parameter> must be one of the
|
|
following predefined constants:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_ENUM_LOCAL</parameter>:
|
|
enumerates the locally installed printers.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_ENUM_NAME</parameter>:
|
|
enumerates the printer of <parameter>name</parameter>, can be a server,
|
|
domain or print provider.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_ENUM_SHARED</parameter>:
|
|
this parameter can't be used alone, it has to be OR'ed with other
|
|
parameters, i.e. PRINTER_ENUM_LOCAL to detect the locally shared
|
|
printers.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_ENUM_DEFAULT</parameter>:
|
|
(Win9.x only) enumerates the default printer.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_ENUM_CONNECTIONS</parameter>:
|
|
(WinNT/2000 only) enumerates the printers to which the user has
|
|
made connections.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_ENUM_NETWORK</parameter>:
|
|
(WinNT/2000 only) enumerates network printers in the computer's
|
|
domain. Only valid if <parameter>level</parameter> is 1.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_ENUM_REMOTE</parameter>:
|
|
(WinNT/2000 only) enumerates network printers and print servers in the
|
|
computer's domain. Only valid if <parameter>level</parameter> is 1.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<example>
|
|
<title><function>printer_list</function> example</title>
|
|
<programlisting role="php">
|
|
/* detect locally shared printer */
|
|
var_dump( printer_list(PRINTER_ENUM_LOCAL | PRINTER_ENUM_SHARED) );
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-set-option">
|
|
<refnamediv>
|
|
<refname>printer_set_option</refname>
|
|
<refpurpose>Configure the printer connection</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_set_option</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>int <parameter>option</parameter></paramdef>
|
|
<paramdef>mixed <parameter>value</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<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">
|
|
$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>
|
|
|
|
|
|
<refentry id="function.printer-get-option">
|
|
<refnamediv>
|
|
<refname>printer_get_option</refname>
|
|
<refpurpose>Retrieve printer configuration data</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>mixed <function>printer_get_option</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>string <parameter>option</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function retrieves the configuration setting of <parameter>option</parameter>.
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
Take a look at <function>printer_set_option</function> for the settings that can
|
|
be retrieved, additionally the following settings can be retrieved:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_DEVICENAME</parameter>
|
|
returns the devicename of the printer.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_DRIVERVERSION</parameter>
|
|
returns the printer driver version.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<example>
|
|
<title><function>printer_get_option</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
print printer_get_option($handle, PRINTER_DRIVERVERSION);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-create-dc">
|
|
<refnamediv>
|
|
<refname>printer_create_dc</refname>
|
|
<refpurpose>Create a new device context</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_create_dc</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function creates a new device context. A device context is used
|
|
to customize the graphic objects of the document.
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_create_dc</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle);
|
|
printer_start_page($handle);
|
|
|
|
printer_create_dc($handle);
|
|
/* do some stuff with the dc */
|
|
printer_set_option($handle, PRINTER_TEXT_COLOR, "333333");
|
|
printer_draw_text($handle, 1, 1, "text");
|
|
printer_delete_dc($handle);
|
|
|
|
/* create another dc */
|
|
printer_create_dc($handle);
|
|
printer_set_option($handle, PRINTER_TEXT_COLOR, "000000");
|
|
printer_draw_text($handle, 1, 1, "text");
|
|
/* do some stuff with the dc */
|
|
|
|
printer_delete_dc($handle);
|
|
|
|
printer_endpage($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-delete-dc">
|
|
<refnamediv>
|
|
<refname>printer_delete_dc</refname>
|
|
<refpurpose>Delete a device context</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_delete_dc</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function deletes the device context and returns &true; on success,
|
|
or &false; if an error occurred. For an example see
|
|
<function>printer_create_dc</function>. <parameter>handle</parameter>
|
|
must be a valid handle to a printer.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-start-doc">
|
|
<refnamediv>
|
|
<refname>printer_start_doc</refname>
|
|
<refpurpose>Start a new document</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_start_doc</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>string <parameter><optional>document</optional></parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function creates a new document in the printer spooler. A document
|
|
can contain multiple pages, it's used to schedule the print job in the
|
|
spooler. <parameter>handle</parameter> must be a valid handle to a
|
|
printer. The optional parameter <parameter>document</parameter> can be
|
|
used to set an alternative document name.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_start_doc</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-end-doc">
|
|
<refnamediv>
|
|
<refname>printer_end_doc</refname>
|
|
<refpurpose>Close document</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_end_doc</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Closes a new document in the printer spooler. The document
|
|
is now ready for printing. For an example see
|
|
<function>printer_start_doc</function>.
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-start-page">
|
|
<refnamediv>
|
|
<refname>printer_start_page</refname>
|
|
<refpurpose>Start a new page</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_start_page</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function creates a new page in the active document. For an
|
|
example see <function>printer_start_doc</function>.
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-end-page">
|
|
<refnamediv>
|
|
<refname>printer_end_page</refname>
|
|
<refpurpose>Close active page</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_end_page</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function closes the active page in the active document. For an
|
|
example see <function>printer_start_doc</function>.
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-create-pen">
|
|
<refnamediv>
|
|
<refname>printer_create_pen</refname>
|
|
<refpurpose>Create a new pen</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>mixed <function>printer_create_pen</function>
|
|
</funcdef>
|
|
<paramdef>int <parameter>style</parameter></paramdef>
|
|
<paramdef>int <parameter>width</parameter></paramdef>
|
|
<paramdef>string <parameter>color</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function creates a new pen and returns a handle to it. A pen is
|
|
used to draw lines and curves. For an example see
|
|
<function>printer_select_pen</function>. <parameter>color</parameter>
|
|
must be a color in RGB hex format, i.e. "000000" for black,
|
|
<parameter>width</parameter> specifies the width of the pen whereas
|
|
<parameter>style</parameter> must be one of the following constants:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_PEN_SOLID</parameter>:
|
|
creates a solid pen.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_PEN_DASH</parameter>:
|
|
creates a dashed pen.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_PEN_DOT</parameter>:
|
|
creates a dotted pen.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_PEN_DASHDOT</parameter>:
|
|
creates a pen with dashes and dots.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_PEN_DASHDOTDOT</parameter>:
|
|
creates a pen with dashes and double dots.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_PEN_INVISIBLE</parameter>:
|
|
creates an invisible pen.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-delete-pen">
|
|
<refnamediv>
|
|
<refname>printer_delete_pen</refname>
|
|
<refpurpose>Delete a pen</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_delete_pen</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function deletes the selected pen. For an example see
|
|
<function>printer_select_pen</function>. It returns &true; on success,
|
|
or &false; otherwise. <parameter>handle</parameter> must be a valid
|
|
handle to a pen.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.printer-select-pen">
|
|
<refnamediv>
|
|
<refname>printer_select_pen</refname>
|
|
<refpurpose>Select a pen</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_select_pen</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>printer_handle</parameter></paramdef>
|
|
<paramdef>resource <parameter>pen_handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function selects a pen as the active drawing object of the actual
|
|
device context. A pen is used to draw lines and curves. I.e. if you draw
|
|
a single line the pen is used. If you draw an rectangle the pen is used
|
|
to draw the borders, while the brush is used to fill the shape.
|
|
If you haven't selected a pen before drawing shapes, the shape won't be
|
|
outlined. <parameter>printer_handle</parameter> must be a valid handle
|
|
to a printer. <parameter>pen_handle</parameter> must be a valid handle
|
|
to a pen.
|
|
</para>
|
|
<example>
|
|
<title>
|
|
<function>printer_select_pen</function> example
|
|
</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$pen = printer_create_pen(PRINTER_PEN_SOLID, 30, "2222FF");
|
|
printer_select_pen($handle, $pen);
|
|
|
|
printer_draw_line($handle, 1, 60, 500, 60);
|
|
|
|
printer_delete_pen($pen);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-create-brush">
|
|
<refnamediv>
|
|
<refname>printer_create_brush</refname>
|
|
<refpurpose>Create a new brush</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>mixed <function>printer_create_brush</function>
|
|
</funcdef>
|
|
<paramdef>int <parameter>style</parameter></paramdef>
|
|
<paramdef>string <parameter>color</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function creates a new brush and returns a handle to it. A brush
|
|
is used to fill shapes. For an example see
|
|
<function>printer_select_brush</function>. <parameter>color</parameter>
|
|
must be a color in RGB hex format, i.e. "000000" for black,
|
|
<parameter>style</parameter> must be one of the following constants:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_BRUSH_SOLID</parameter>:
|
|
creates a brush with a solid color.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_BRUSH_DIAGONAL</parameter>:
|
|
creates a brush with a 45-degree upward left-to-right hatch ( / ).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_BRUSH_CROSS</parameter>:
|
|
creates a brush with a cross hatch ( + ).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_BRUSH_DIAGCROSS</parameter>:
|
|
creates a brush with a 45 cross hatch ( x ).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_BRUSH_FDIAGONAL</parameter>:
|
|
creates a brush with a 45-degree downward left-to-right hatch ( \ ).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_BRUSH_HORIZONTAL</parameter>:
|
|
creates a brush with a horizontal hatch ( - ).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_BRUSH_VERTICAL</parameter>:
|
|
creates a brush with a vertical hatch ( | ).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_BRUSH_CUSTOM</parameter>:
|
|
creates a custom brush from an BMP file. The second parameter
|
|
is used to specify the BMP instead of the RGB color code.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-delete-brush">
|
|
<refnamediv>
|
|
<refname>printer_delete_brush</refname>
|
|
<refpurpose>Delete a brush</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_delete_brush</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function deletes the selected brush. For an example see
|
|
<function>printer_select_brush</function>. It returns &true; on
|
|
success, or &false; otherwise. <parameter>handle</parameter>
|
|
must be a valid handle to a brush.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-select-brush">
|
|
<refnamediv>
|
|
<refname>printer_select_brush</refname>
|
|
<refpurpose>Select a brush</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_select_brush</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>printer_handle</parameter></paramdef>
|
|
<paramdef>resource <parameter>brush_handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function selects a brush as the active drawing object of the actual
|
|
device context. A brush is used to fill shapes. If you draw an rectangle
|
|
the brush is used to draw the shapes, while the pen is used to draw the
|
|
border.
|
|
If you haven't selected a brush before drawing shapes, the shape won't
|
|
be filled. <parameter>printer_handle</parameter> must be a valid handle
|
|
to a printer. <parameter>brush_handle</parameter> must be a valid handle
|
|
to a brush.
|
|
</para>
|
|
<example>
|
|
<title>
|
|
<function>printer_select_brush</function> example
|
|
</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000");
|
|
printer_select_pen($handle, $pen);
|
|
$brush = printer_create_brush(PRINTER_BRUSH_CUSTOM, "c:\\brush.bmp");
|
|
printer_select_brush($handle, $brush);
|
|
|
|
printer_draw_rectangle($handle, 1,1,500,500);
|
|
|
|
printer_delete_brush($brush);
|
|
|
|
$brush = printer_create_brush(PRINTER_BRUSH_SOLID, "000000");
|
|
printer_select_brush($handle, $brush);
|
|
printer_draw_rectangle($handle, 1,501,500,1001);
|
|
printer_delete_brush($brush);
|
|
|
|
printer_delete_pen($pen);
|
|
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-create-font">
|
|
<refnamediv>
|
|
<refname>printer_create_font</refname>
|
|
<refpurpose>Create a new font</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>mixed <function>printer_create_font</function>
|
|
</funcdef>
|
|
<paramdef>string <parameter>face</parameter></paramdef>
|
|
<paramdef>int <parameter>height</parameter></paramdef>
|
|
<paramdef>int <parameter>width</parameter></paramdef>
|
|
<paramdef>int <parameter>font_weight</parameter></paramdef>
|
|
<paramdef>bool <parameter>italic</parameter></paramdef>
|
|
<paramdef>bool <parameter>underline</parameter></paramdef>
|
|
<paramdef>bool <parameter>strikeout</parameter></paramdef>
|
|
<paramdef>int <parameter>orientaton</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function creates a new font and returns a handle to it. A font is
|
|
used to draw text. For an example see
|
|
<function>printer_select_font</function>. <parameter>face</parameter>
|
|
must be a string specifying the font face. <parameter>height</parameter>
|
|
specifies the font height, and <parameter>width</parameter> the font
|
|
width. The <parameter>font_weight</parameter> specifies the font weight
|
|
(400 is normal), and can be one of the following predefined constants.
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_FW_THIN</parameter>:
|
|
sets the font weight to thin (100).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_FW_ULTRALIGHT</parameter>:
|
|
sets the font weight to ultra light (200).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_FW_LIGHT</parameter>:
|
|
sets the font weight to light (300).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_FW_NORMAL</parameter>:
|
|
sets the font weight to normal (400).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_FW_MEDIUM</parameter>:
|
|
sets the font weight to medium (500).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_FW_BOLD</parameter>:
|
|
sets the font weight to bold (700).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_FW_ULTRABOLD</parameter>:
|
|
sets the font weight to ultra bold (800).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>PRINTER_FW_HEAVY</parameter>:
|
|
sets the font weight to heavy (900).
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
<parameter>italic</parameter> can be &true; or &false;,
|
|
and sets whether the font should be italic.
|
|
</para>
|
|
<para>
|
|
<parameter>underline</parameter> can be &true; or &false;,
|
|
and sets whether the font should be underlined.
|
|
</para>
|
|
<para>
|
|
<parameter>strikeout</parameter> can be &true; or &false;,
|
|
and sets whether the font should be striked out.
|
|
</para>
|
|
<para>
|
|
<parameter>orientation</parameter> specifies a rotation.
|
|
For an example see <function>printer_select_font</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-delete-font">
|
|
<refnamediv>
|
|
<refname>printer_delete_font</refname>
|
|
<refpurpose>Delete a font</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>printer_delete_font</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function deletes the selected font. For an example see
|
|
<function>printer_select_font</function>. It returns &true; on success,
|
|
or &false; otherwise. <parameter>handle</parameter> must be a valid
|
|
handle to a font.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-select-font">
|
|
<refnamediv>
|
|
<refname>printer_select_font</refname>
|
|
<refpurpose>Select a font</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_select_font</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>printer_handle</parameter></paramdef>
|
|
<paramdef>resource <parameter>font_handle</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function selects a font to draw text.
|
|
<parameter>printer_handle</parameter> must be a valid handle to a
|
|
printer. <parameter>font_handle</parameter> must be a valid handle
|
|
to a font.
|
|
</para>
|
|
<example>
|
|
<title>
|
|
<function>printer_select_font</function> example
|
|
</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$font = printer_create_font("Arial", 148, 76, PRINTER_FW_MEDIUM, false, false, false, -50);
|
|
printer_select_font($handle, $font);
|
|
printer_draw_text($handle, "PHP is simply cool", 40, 40);
|
|
printer_delete_font($font);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-logical-fontheight">
|
|
<refnamediv>
|
|
<refname>printer_logical_fontheight</refname>
|
|
<refpurpose>Get logical font height</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>printer_logical_fontheight</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>int <parameter>height</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function calculates the logical font height of
|
|
<parameter>height</parameter>. <parameter>handle</parameter> must
|
|
be a valid handle to a printer.
|
|
</para>
|
|
<example>
|
|
<title>
|
|
<function>printer_logical_fontheight</function> example
|
|
</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
print printer_logical_fontheight($handle, 72);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-draw-roundrect">
|
|
<refnamediv>
|
|
<refname>printer_draw_roundrect</refname>
|
|
<refpurpose>Draw a rectangle with rounded corners</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_draw_roundrect</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>int <parameter>ul_x</parameter></paramdef>
|
|
<paramdef>int <parameter>ul_y</parameter></paramdef>
|
|
<paramdef>int <parameter>lr_x</parameter></paramdef>
|
|
<paramdef>int <parameter>lr_y</parameter></paramdef>
|
|
<paramdef>int <parameter>width</parameter></paramdef>
|
|
<paramdef>int <parameter>height</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function simply draws a rectangle with rounded corners.
|
|
</para>
|
|
<para>
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<para>
|
|
<parameter>ul_x</parameter> is the upper left x coordinate of the rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>ul_y</parameter> is the upper left y coordinate of the rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>lr_x</parameter> is the lower right x coordinate of the rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>lr_y</parameter> is the lower right y coordinate of the rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>width</parameter> is the width of the ellipse.
|
|
</para>
|
|
<para>
|
|
<parameter>height</parameter> is the height of the ellipse.
|
|
</para>
|
|
<example>
|
|
<title>
|
|
<function>printer_draw_roundrect</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000");
|
|
printer_select_pen($handle, $pen);
|
|
|
|
$brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF");
|
|
printer_select_brush($handle, $brush);
|
|
|
|
printer_draw_roundrect($handle, 1, 1, 500, 500, 200, 200);
|
|
|
|
printer_delete_brush($brush);
|
|
printer_delete_pen($pen);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-draw-rectangle">
|
|
<refnamediv>
|
|
<refname>printer_draw_rectangle</refname>
|
|
<refpurpose>Draw a rectangle</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_draw_rectangle</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>int <parameter>ul_x</parameter></paramdef>
|
|
<paramdef>int <parameter>ul_y</parameter></paramdef>
|
|
<paramdef>int <parameter>lr_x</parameter></paramdef>
|
|
<paramdef>int <parameter>lr_y</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function simply draws a rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<para>
|
|
<parameter>ul_x</parameter> is the upper left x coordinate of the rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>ul_y</parameter> is the upper left y coordinate of the rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>lr_x</parameter> is the lower right x coordinate of the rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>lr_y</parameter> is the lower right y coordinate of the rectangle.
|
|
</para>
|
|
<example>
|
|
<title>
|
|
<function>printer_draw_rectangle</function> example
|
|
</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000");
|
|
printer_select_pen($handle, $pen);
|
|
|
|
$brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF");
|
|
printer_select_brush($handle, $brush);
|
|
|
|
printer_draw_rectangle($handle, 1, 1, 500, 500);
|
|
|
|
printer_delete_brush($brush);
|
|
printer_delete_pen($pen);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-draw-elipse">
|
|
<refnamediv>
|
|
<refname>printer_draw_elipse</refname>
|
|
<refpurpose>Draw an ellipse</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_draw_elipse</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>int <parameter>ul_x</parameter></paramdef>
|
|
<paramdef>int <parameter>ul_y</parameter></paramdef>
|
|
<paramdef>int <parameter>lr_x</parameter></paramdef>
|
|
<paramdef>int <parameter>lr_y</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function simply draws an ellipse.
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<para>
|
|
<parameter>ul_x</parameter> is the upper left x coordinate of the ellipse.
|
|
</para>
|
|
<para>
|
|
<parameter>ul_y</parameter> is the upper left y coordinate of the ellipse.
|
|
</para>
|
|
<para>
|
|
<parameter>lr_x</parameter> is the lower right x coordinate of the ellipse.
|
|
</para>
|
|
<para>
|
|
<parameter>lr_y</parameter> is the lower right y coordinate of the ellipse.
|
|
</para>
|
|
<example>
|
|
<title>
|
|
<function>printer_draw_elipse</function> example
|
|
</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000");
|
|
printer_select_pen($handle, $pen);
|
|
|
|
$brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF");
|
|
printer_select_brush($handle, $brush);
|
|
|
|
printer_draw_elipse($handle, 1, 1, 500, 500);
|
|
|
|
printer_delete_brush($brush);
|
|
printer_delete_pen($pen);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-draw-text">
|
|
<refnamediv>
|
|
<refname>printer_draw_text</refname>
|
|
<refpurpose>Draw text</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_draw_text</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>printer_handle</parameter></paramdef>
|
|
<paramdef>string <parameter>text</parameter></paramdef>
|
|
<paramdef>int <parameter>x</parameter></paramdef>
|
|
<paramdef>int <parameter>y</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function simply draws <parameter>text</parameter> at position
|
|
<parameter>x</parameter>, <parameter>y</parameter> using the selected
|
|
font. <parameter>printer_handle</parameter> must be a valid handle to
|
|
a printer.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_draw_text</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$font = printer_create_font("Arial",72,48,400,false,false,false,0);
|
|
printer_select_font($handle, $font);
|
|
printer_draw_text($handle, "test", 10, 10);
|
|
printer_delete_font($font);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-draw-line">
|
|
<refnamediv>
|
|
<refname>printer_draw_line</refname>
|
|
<refpurpose>Draw a line</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_draw_line</function></funcdef>
|
|
<paramdef>resource <parameter>printer_handle</parameter></paramdef>
|
|
<paramdef>int <parameter>from_x</parameter></paramdef>
|
|
<paramdef>int <parameter>from_y</parameter></paramdef>
|
|
<paramdef>int <parameter>to_x</parameter></paramdef>
|
|
<paramdef>int <parameter>to_y</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function simply draws a line from position
|
|
<parameter>from_x</parameter>, <parameter>from_y</parameter> to
|
|
position <parameter>to_x</parameter>, <parameter>to_y</parameter>
|
|
using the selected pen. <parameter>printer_handle</parameter> must
|
|
be a valid handle to a printer.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_draw_line</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$pen = printer_create_pen(PRINTER_PEN_SOLID, 30, "000000");
|
|
printer_select_pen($handle, $pen);
|
|
|
|
printer_draw_line($handle, 1, 10, 1000, 10);
|
|
printer_draw_line($handle, 1, 60, 500, 60);
|
|
|
|
printer_delete_pen($pen);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-draw-chord">
|
|
<refnamediv>
|
|
<refname>printer_draw_chord</refname>
|
|
<refpurpose>Draw a chord</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_draw_chord</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>int <parameter>rec_x</parameter></paramdef>
|
|
<paramdef>int <parameter>rec_y</parameter></paramdef>
|
|
<paramdef>int <parameter>rec_x1</parameter></paramdef>
|
|
<paramdef>int <parameter>rec_y1</parameter></paramdef>
|
|
<paramdef>int <parameter>rad_x</parameter></paramdef>
|
|
<paramdef>int <parameter>rad_y</parameter></paramdef>
|
|
<paramdef>int <parameter>rad_x1</parameter></paramdef>
|
|
<paramdef>int <parameter>rad_y1</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function simply draws an chord.
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<para>
|
|
<parameter>rec_x</parameter> is the upper left x coordinate of the
|
|
bounding rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>rec_y</parameter> is the upper left y coordinate of the
|
|
bounding rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>rec_x1</parameter> is the lower right x coordinate of the
|
|
bounding rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>rec_y1</parameter> is the lower right y coordinate of
|
|
the bounding rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>rad_x</parameter> is x coordinate of the radial defining
|
|
the beginning of the chord.
|
|
</para>
|
|
<para>
|
|
<parameter>rad_y</parameter> is y coordinate of the radial defining
|
|
the beginning of the chord.
|
|
</para>
|
|
<para>
|
|
<parameter>rad_x1</parameter> is x coordinate of the radial defining
|
|
the end of the chord.
|
|
</para>
|
|
<para>
|
|
<parameter>rad_y1</parameter> is y coordinate of the radial defining
|
|
the end of the chord.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_draw_chord</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000");
|
|
printer_select_pen($handle, $pen);
|
|
|
|
$brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF");
|
|
printer_select_brush($handle, $brush);
|
|
|
|
printer_draw_chord($handle, 1, 1, 500, 500, 1, 1, 500, 1);
|
|
|
|
printer_delete_brush($brush);
|
|
printer_delete_pen($pen);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-draw-pie">
|
|
<refnamediv>
|
|
<refname>printer_draw_pie</refname>
|
|
<refpurpose>Draw a pie</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_draw_pie</function></funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>int <parameter>rec_x</parameter></paramdef>
|
|
<paramdef>int <parameter>rec_y</parameter></paramdef>
|
|
<paramdef>int <parameter>rec_x1</parameter></paramdef>
|
|
<paramdef>int <parameter>rec_y1</parameter></paramdef>
|
|
<paramdef>int <parameter>rad1_x</parameter></paramdef>
|
|
<paramdef>int <parameter>rad1_y</parameter></paramdef>
|
|
<paramdef>int <parameter>rad2_x</parameter></paramdef>
|
|
<paramdef>int <parameter>rad2_y</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function simply draws an pie.
|
|
<parameter>handle</parameter> must be a valid handle to a printer.
|
|
</para>
|
|
<para>
|
|
<parameter>rec_x</parameter> is the upper left x coordinate of
|
|
the bounding rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>rec_y</parameter> is the upper left y coordinate of
|
|
the bounding rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>rec_x1</parameter> is the lower right x coordinate of
|
|
the bounding rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>rec_y1</parameter> is the lower right y coordinate of
|
|
the bounding rectangle.
|
|
</para>
|
|
<para>
|
|
<parameter>rad1_x</parameter> is x coordinate of the first
|
|
radial's ending.
|
|
</para>
|
|
<para>
|
|
<parameter>rad1_y</parameter> is y coordinate of the first
|
|
radial's ending.
|
|
</para>
|
|
<para>
|
|
<parameter>rad2_x</parameter> is x coordinate of the second
|
|
radial's ending.
|
|
</para>
|
|
<para>
|
|
<parameter>rad2_y</parameter> is y coordinate of the second
|
|
radial's ending.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_draw_chord</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
$pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000");
|
|
printer_select_pen($handle, $pen);
|
|
|
|
$brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF");
|
|
printer_select_brush($handle, $brush);
|
|
|
|
printer_draw_pie($handle, 1, 1, 500, 500, 1, 1, 500, 1);
|
|
|
|
printer_delete_brush($brush);
|
|
printer_delete_pen($pen);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.printer-draw-bmp">
|
|
<refnamediv>
|
|
<refname>printer_draw_bmp</refname>
|
|
<refpurpose>Draw a bmp</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>printer_draw_bmp</function>
|
|
</funcdef>
|
|
<paramdef>resource <parameter>handle</parameter></paramdef>
|
|
<paramdef>string <parameter>filename</parameter></paramdef>
|
|
<paramdef>int <parameter>x</parameter></paramdef>
|
|
<paramdef>int <parameter>y</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function simply draws an bmp the bitmap
|
|
<parameter>filename</parameter> at position <parameter>x</parameter>,
|
|
<parameter>y</parameter>. <parameter>handle</parameter> must be a
|
|
valid handle to a printer.
|
|
</para>
|
|
<para>
|
|
The function returns &true; on success, or otherwise &false;.
|
|
</para>
|
|
<example>
|
|
<title><function>printer_draw_bmp</function> example</title>
|
|
<programlisting role="php">
|
|
$handle = printer_open();
|
|
printer_start_doc($handle, "My Document");
|
|
printer_start_page($handle);
|
|
|
|
printer_draw_bmp($handle, "c:\\image.bmp", 1, 1);
|
|
|
|
printer_end_page($handle);
|
|
printer_end_doc($handle);
|
|
printer_close($handle);
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
</reference>
|
|
<!-- 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
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
-->
|