<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >printer_set_option</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Manual PHP" HREF="index.html"><LINK REL="UP" TITLE="Printer Functions" HREF="ref.printer.html"><LINK REL="PREVIOUS" TITLE="printer_select_pen" HREF="function.printer-select-pen.html"><LINK REL="NEXT" TITLE="printer_start_doc" HREF="function.printer-start-doc.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-2"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.printer-select-pen.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.printer-start-doc.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.printer-set-option" ></A >printer_set_option</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN98087" ></A ><P > (no version information, might be only in CVS)</P >printer_set_option -- Configure the printer connection</DIV ><DIV CLASS="refsect1" ><A NAME="AEN98090" ></A ><H2 >Description</H2 >bool <B CLASS="methodname" >printer_set_option</B > ( resource handle, int option, mixed value)<BR ></BR ><P > The function sets the following options for the current connection. <VAR CLASS="parameter" >handle</VAR > must be a valid handle to a printer. For <VAR CLASS="parameter" >option</VAR > can be one of the following constants: <P ></P ><UL ><LI ><P > <VAR CLASS="parameter" >PRINTER_COPIES</VAR >: sets how many copies should be printed, <VAR CLASS="parameter" >value</VAR > must be an integer. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_MODE</VAR >: specifies the type of data (text, raw or emf), <VAR CLASS="parameter" >value</VAR > must be a string. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_TITLE</VAR >: specifies the name of the document, <VAR CLASS="parameter" >value</VAR > must be a string. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_ORIENTATION</VAR >: specifies the orientation of the paper, <VAR CLASS="parameter" >value</VAR > can be either PRINTER_ORIENTATION_PORTRAIT or PRINTER_ORIENTATION_LANDSCAPE </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_RESOLUTION_Y</VAR >: specifies the y-resolution in DPI, <VAR CLASS="parameter" >value</VAR > must be an integer. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_RESOLUTION_X</VAR >: specifies the x-resolution in DPI, <VAR CLASS="parameter" >value</VAR > must be an integer. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_PAPER_FORMAT</VAR >: specifies the a predefined paper format, set <VAR CLASS="parameter" >value</VAR > to PRINTER_FORMAT_CUSTOM if you want to specify a custom format with PRINTER_PAPER_WIDTH and PRINTER_PAPER_LENGTH. <VAR CLASS="parameter" >value</VAR > can be one of the following constants. </P ><P ></P ><UL ><LI ><P > <VAR CLASS="parameter" > PRINTER_FORMAT_CUSTOM</VAR >: let's you specify a custom paper format. </P ></LI ><LI ><P > <VAR CLASS="parameter" > PRINTER_FORMAT_LETTER</VAR >: specifies standard letter format (8 1/2- by 11-inches). </P ></LI ><LI ><P > <VAR CLASS="parameter" > PRINTER_FORMAT_LETTER</VAR >: specifies standard legal format (8 1/2- by 14-inches). </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_FORMAT_A3</VAR >: specifies standard A3 format (297- by 420-millimeters). </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_FORMAT_A4</VAR >: specifies standard A4 format (210- by 297-millimeters). </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_FORMAT_A5</VAR >: specifies standard A5 format (148- by 210-millimeters). </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_FORMAT_B4</VAR >: specifies standard B4 format (250- by 354-millimeters). </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_FORMAT_B5</VAR >: specifies standard B5 format (182- by 257-millimeter). </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_FORMAT_FOLIO</VAR >: specifies standard FOLIO format (8 1/2- by 13-inch). </P ></LI ></UL ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_PAPER_LENGTH</VAR >: if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM, PRINTER_PAPER_LENGTH specifies a custom paper length in mm, <VAR CLASS="parameter" >value</VAR > must be an integer. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_PAPER_WIDTH</VAR >: if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM, PRINTER_PAPER_WIDTH specifies a custom paper width in mm, <VAR CLASS="parameter" >value</VAR > must be an integer. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_SCALE</VAR >: 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. <VAR CLASS="parameter" >value</VAR > must be an integer. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_BACKGROUND_COLOR</VAR >: specifies the background color for the actual device context, <VAR CLASS="parameter" >value</VAR > must be a string containing the rgb information in hex format i.e. "005533". </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_TEXT_COLOR</VAR >: specifies the text color for the actual device context, <VAR CLASS="parameter" >value</VAR > must be a string containing the rgb information in hex format i.e. "005533". </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_TEXT_ALIGN</VAR >: specifies the text alignment for the actual device context, <VAR CLASS="parameter" >value</VAR > can be combined through OR'ing the following constants: </P ><P ></P ><UL ><LI ><P > <VAR CLASS="parameter" >PRINTER_TA_BASELINE</VAR >: text will be aligned at the base line. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_TA_BOTTOM</VAR >: text will be aligned at the bottom. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_TA_TOP</VAR >: text will be aligned at the top. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_TA_CENTER</VAR >: text will be aligned at the center. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_TA_LEFT</VAR >: text will be aligned at the left. </P ></LI ><LI ><P > <VAR CLASS="parameter" >PRINTER_TA_RIGHT</VAR >: text will be aligned at the right. </P ></LI ></UL ></LI ></UL > </P ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN98208" ></A ><P ><B >Exemplu 1. <B CLASS="function" >printer_set_option()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br />$handle </font><font color="#007700">= </font><font color="#0000BB">printer_open</font><font color="#007700">();<br /></font><font color="#0000BB">printer_set_option</font><font color="#007700">(</font><font color="#0000BB">$handle</font><font color="#007700">, </font><font color="#0000BB">PRINTER_SCALE</font><font color="#007700">, </font><font color="#0000BB">75</font><font color="#007700">);<br /></font><font color="#0000BB">printer_set_option</font><font color="#007700">(</font><font color="#0000BB">$handle</font><font color="#007700">, </font><font color="#0000BB">PRINTER_TEXT_ALIGN</font><font color="#007700">, </font><font color="#0000BB">PRINTER_TA_LEFT</font><font color="#007700">);<br /></font><font color="#0000BB">printer_close</font><font color="#007700">(</font><font color="#0000BB">$handle</font><font color="#007700">);<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.printer-select-pen.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Acasã</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.printer-start-doc.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >printer_select_pen</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.printer.html" ACCESSKEY="U" >Sus</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >printer_start_doc</TD ></TR ></TABLE ></DIV ></BODY ></HTML >