cvs: phpdoc /ja/functions java.xml printer.xml

From: Date: Sun, 01 Jul 2001 03:39:55 +0000
Subject: cvs: phpdoc /ja/functions java.xml printer.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969335774@lists.php.net to get a copy of this message
hirokawa Sat Jun 30 23:39:55 2001 EDT Added files: /phpdoc/ja/functions java.xml printer.xml Log: added java.xml and printer.xml in japanese manual.

Index: phpdoc/ja/functions/java.xml +++ phpdoc/ja/functions/java.xml <reference id="ref.java"> <title>Java</title> <titleabbrev>PHP / Java の連携</titleabbrev> <partintro> <para> PHPとJavaの連携をとして考えられる手段は2種類あります。JavaをPHPに統合 する手法、この手法はより安定で効率的な手法です、または、PHPをJavaサー ブレット環境に統合する手法です。前者は、ext/java で提供され、後者はサ ーブレットサーバとのインターフェイスであるSAPIモジュールです。 </para> <para> PHP 4 ext/java は、PHPからJavaオブジェクトのメソッドを生成し、コール する簡単で効率的な手段を提供します。このJVMはJNIを用いて作成され、全 てはこのプロセスで動作します。ext/javaの構築手順は、 php4/ext/java/README にあります。 <example> <title>Java の例</title> <programlisting role="php"> &lt;?php // Java クラス java.lang.System のインスタンスをPHPに作成する $system = new Java("java.lang.System"); // プロパティへのアクセスのデモ print "Java version=".$system-&gt;getProperty("java.version")." &lt;br&gt;"; print "Java vendor=" .$system-&gt;getProperty("java.vendor")." &lt;br&gt;"; print "OS=".$system-&gt;getProperty("os.name")." ". $system-&gt;getProperty("os.version")." on ". $system-&gt;getProperty("os.arch")." &lt;br&gt;"; // java.util.Date の例 $formatter = new Java("java.text.SimpleDateFormat", "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz"); print $formatter-&gt;format(new Java("java.util.Date")); ?&gt; </programlisting> </example> <example> <title>AWT の例</title> <programlisting role="php"> &lt;?php // この例は、CGIとして実行されることのみを考慮しています。 $frame = new Java("java.awt.Frame", "Zend"); $button = new Java("java.awt.Button", "Hello Java world!"); $frame-&gt;add("North", $button); $frame-&gt;validate(); $frame-&gt;pack(); $frame-&gt;visible = True; $thread = new Java("java.lang.Thread"); $thread-&gt;sleep(10000); $frame-&gt;dispose(); ?&gt; </programlisting> </example> 注意: <itemizedlist> <listitem> <simpara> new Java() は、有効なコンストラクタある場合、クラスのインスタンス を生成します。引数が指定されない場合には、デフォルトのコンストラ クタにより"java.lang.System"のようなクラスにアクセスするとよいで しょう。このクラスは、静的な手法でそのクラスの機能の多くを公開し ています。 </simpara> </listitem> <listitem> <simpara> あるインスタンスのメンバーにアクセスする際には、まずbeanプロパティ が探されてから、次にpublicフィールドが探されます。言い換えると、 "print $date.time" はまず "$date.getTime()" と解釈され、続いて "$date.time" と解釈されます。 </simpara> </listitem> <listitem> <simpara> 静的メンバおよびインスタンスメンバは共に同じ構文でアクセス可能です。 さらに、javaオブジェクトが"java.lang.Class"型の場合、このクラスの静 的メンバ(フィールドとメソッド)にアクセス可能です。 </simpara> </listitem> <listitem> <para> 例外が発生するとPHPの警告が出力され、結果はNULLとなります。警告は "@"記号を付けてメソッドをコールすることに抑圧できます。以下のAPI を直近のエラーを取得し、リセットするために使用することができます。 <itemizedlist> <listitem><simpara><function>java_last_exception_get</function></simpara></listitem> <listitem><simpara><function>java_last_exception_clear</function></simpara></listitem> </itemizedlist> </para> </listitem> <listitem> <simpara> オーバーロードの解決は、二つの言語の間で型の違いがあるため一般には 困難な問題です。PHP のJava拡張機能は簡単ですが最も一致するオーバー ロードを定義するかなり効率的な手段を使用しています。 加えて、PHPのメソッド名は大文字小文字を区別しないため、選択される オーバーロードの数は増加する傾向があります。 メソッドが一度選択されると、パラメータの値は必要に応じて調整されま す。このため、(倍精度実数が論理値に変換されるといった)データの劣化 が発生する可能性があります。 </simpara> </listitem> <listitem> <simpara> PHPでは伝統的に配列とハッシュテーブルは相互に完全に可換でした。PHPの ハッシュテーブルは整数または配列の添字のみを使用できることに注意して 下さい。また、Javaのprimitive型の配列は疎とすることができないことに も注意して下さい。これらの構造は値で渡されるため、メモリと時間の消 費量が大きくする可能性があります。 </simpara> </listitem> </itemizedlist> </para> <para> PHP4 sapi/servlet はPHPプロセッサ全体をサーブレットとして実行するために ext//javaにより定義された機構の上に構築されています。 この形態のPHPの側からこの実装が基本的に優れている点は、サーブレットを サポートするWebサーバが通常JVMをプールし、再利用することに注力している ことです。このサーブレットSAPIモジュールの構築手順は、php4/sapi/README にあります。 注意: <itemizedlist> <listitem> <simpara> このコードは、全てのサーブレットエンジンで実行可能であるように作成 されていますが、現在ApacheのJakarta/tomcatでしかテストされていませ ん。他のエンジンでこのコードを実行する際に必要なパッチ、バグレポー ト、成功事例等をお知らせ下さい。 </simpara> </listitem> <listitem> <simpara> PHP は、動作ディレクトリを変更する特徴があります。sapi/サーブレット はもとに戻そうとしますが、PHPが実行されている間、サーブレットエンジ ンはCLASSPATHい相対ディレクトリにより指定されている全てのクラスをロ ードできないか、管理用およびJSPコンパイル用に使用されている作業ディ レクトリを見つけることができなくなる可能性があります。 </simpara> </listitem> </itemizedlist> </para> </partintro> <refentry id="function.java-last-exception-clear"> <refnamediv> <refname>java_last_exception_clear</refname> <refpurpose>直近の例外をクリアする</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>void <function>java_last_exception_clear</function></funcdef> <void/> </funcprototype> </funcsynopsis> </refsect1> </refentry> <refentry id="function.java-last-exception-get"> <refnamediv> <refname>java_last_exception_get</refname> <refpurpose>直近のJava例外を取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>exception <function>java_last_exception_get</function></funcdef> <void/> </funcprototype> </funcsynopsis> <para> 以下の例は、Java例外ハンドラをPHPから使用する方法を示すものです。 <example> <title>Java例外ハンドラ</title> <programlisting role="php"> <?php $stack = new Java("java.util.Stack"); $stack-&gt;push(1); // 以下のコードは実行に成功します $result = $stack->pop(); $ex = java_last_exception_get(); if (!$ex) print "$result\n"; // 以下のコードは失敗します (エラー出力は、@により抑制されています) $result = @$stack-&gt;pop(); $ex = java_last_exception_get(); if ($ex) print $ex->toString(); // 直近の例外をクリア java_last_exception_clear(); ?> </programlisting> </example> </para> </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: --> Index: phpdoc/ja/functions/printer.xml +++ phpdoc/ja/functions/printer.xml <reference id="ref.printer"> <title>プリンタ関数</title> <titleabbrev>プリンタ</titleabbrev> <partintro> <simpara> 以下の関数は、Windows 9.x, ME, NT4, 2000でのみ利用可能です。これらの 関数は、PHP 4 (4.0.4)で追加されました。 </simpara> </partintro> <refentry id="function.printer-open"> <refnamediv> <refname>printer_open</refname> <refpurpose>プリンタへの接続をオープンする</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>printer_open</function></funcdef> <paramdef>[string <parameter>devicename</parameter>]</paramdef> </funcprototype> </funcsynopsis> <para> この関数は、プリンタ<parameter>devicename</parameter>への接続を試み、成功時にハンドル、失敗時にfalseを返します。 </para> <para> パラメータが指定されない場合、この関数はデフォルトのプリンタへの接続をオープンします。(php.iniにprinter.default_printerとして指定されていない場合は、PHPはデフォルトのプリンタの検出を試みます) </para> <para> <function>printer_open</function> は、デバイスコンテキストも開始します。 </para> <example> <title><function>printer_open</function> の例</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>プリンタのスプールファイルを削除する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_abort</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> この関数は、プリンタのスプールファイルを削除します。 </para> <para> <parameter>handle</parameter> には、プリンタへの有効なハンドルを指定する必要があります。 </para> <example> <title><function>printer_abort</function> の例</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>プリンタへの接続を閉じる</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_close</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> この関数は、プリンタへの接続をクローズします。 <function>printer_close</function> は、アクティブなデバイスコンテキストへもクローズします。 </para> <para> <parameter>handle</parameter> は、プリンタへの有効なハンドルである必要があります。 </para> <example> <title><function>printer_close</function> の例</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>プリンタへデータを書き込む</refpurpose> </refnamediv> <refsect1> <title>説明</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> <parameter>content</parameter> を直接プリンタに書き込み、成功時にtrue、失敗した場合にfalseを返します。 </para> <para> <parameter>handle</parameter> は、プリンタへの有効なハンドルである必要があります。 </para> <example> <title><function>printer_write</function> の例</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>サーバで付加されたプリンタの配列を返す</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>array <function>printer_list</function></funcdef> <paramdef>int <parameter>enumtype</parameter></paramdef> <paramdef>[string <parameter>name</parameter></paramdef> <paramdef>[int <parameter>level</parameter>]]</paramdef> </funcprototype> </funcsynopsis> <para> この関数は、利用可能なプリンタとその機能を調べます。 <parameter>level</parameter>には、情報要求のレベルを設定します。 これは、1,2,4 または 5とすることが可能です、<parameter>enumtype</parameter> は次の定義済みの定数のどれかとする必要があります。 <itemizedlist> <listitem> <simpara> <parameter>PRINTER_ENUM_LOCAL</parameter>: ローカルにインストールされたプリンタを数えます。 </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_NAME</parameter>: <parameter>name</parameter>のサーバ、ドメインまたはプリントプロバイダになることができるものを数えます。 </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_SHARED</parameter>: このパラメータは単独では使用できず、他のパラメータ、共有プリンタを検出するためのPRINTER_ENUM_LOCAL、とともに使用する必要があります。 </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_DEFAULT</parameter>: (Win9.x のみ) デフォルトのプリンタを数えます。 </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_CONNECTIONS</parameter>: (WinNT/2000 のみ) ユーザが接続済みのプリンタを数えます。 </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_NETWORK</parameter>: (WinNT/2000 のみ) コンピュータのドメインにあるネットワークプリンタを数えます。 <parameter>level</parameter> が 1の場合のみ有効です。 </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_REMOTE</parameter>: (WinNT/2000 のみ) コンピュータのドメインにあるネットワークプリンタとプリンタサーバを数えます。 <parameter>level</parameter> が 1の場合のみ有効です。 </simpara> </listitem> </itemizedlist> </para> <example> <title><function>printer_list</function> の例</title> <programlisting role="php"> /* ローカルな共有プリンタを検出 */ 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>プリンタの接続を設定する</refpurpose> </refnamediv> <refsect1> <title>説明</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>プリンタ設定データを取得する</refpurpose> </refnamediv> <refsect1> <title>説明</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>新規デバイスコンテキストを作成する</refpurpose> </refnamediv> <refsect1> <title>説明</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>デバイスコンテキストを削除する</refpurpose> </refnamediv> <refsect1> <title>説明</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>新規ドキュメントを開始する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_start_doc</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>[string <parameter>document</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>ドキュメントを閉じる</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_end_doc</function> </funcdef> <paramdef>resource <parameter>handle</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. 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>新規ページを開始する</refpurpose> </refnamediv> <refsect1> <title>説明</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>アクティブなページを閉じる</refpurpose> </refnamediv> <refsect1> <title>説明</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>新規ペンを作成する</refpurpose> </refnamediv> <refsect1> <title>説明</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>ペンを削除する</refpurpose> </refnamediv> <refsect1> <title>説明</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>ペンを選択する</refpurpose> </refnamediv> <refsect1> <title>説明</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>新規ブラシを作成する</refpurpose> </refnamediv> <refsect1> <title>説明</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>ブラシを削除する</refpurpose> </refnamediv> <refsect1> <title>説明</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>ブラシを選択する</refpurpose> </refnamediv> <refsect1> <title>説明</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>新規フォントを作成する</refpurpose> </refnamediv> <refsect1> <title>説明</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> <parameter>italic</parameter> can be true or false, and sets whether the font should be italic. <parameter>underline</parameter> can be true or false, and sets whether the font should be underlined. <parameter>strikeout</parameter> can be true or false, and sets whether the font should be striked out. <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>フォントを削除する</refpurpose> </refnamediv> <refsect1> <title>説明</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>フォントを選択する</refpurpose> </refnamediv> <refsect1> <title>説明</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>論理フォントの高さを取得する</refpurpose> </refnamediv> <refsect1> <title>説明</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>角が丸い矩形を描画する</refpurpose> </refnamediv> <refsect1> <title>説明</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>矩形を描画する</refpurpose> </refnamediv> <refsect1> <title>説明</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>楕円を描画する</refpurpose> </refnamediv> <refsect1> <title>説明</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>テキストを描画する</refpurpose> </refnamediv> <refsect1> <title>説明</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>線を描画する</refpurpose> </refnamediv> <refsect1> <title>説明</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>弦を描画する</refpurpose> </refnamediv> <refsect1> <title>説明</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>円弧を描画する</refpurpose> </refnamediv> <refsect1> <title>説明</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>ビットマップを描画する</refpurpose> </refnamediv> <refsect1> <title>説明</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> この関数は、ビットマップ<parameter>filename</parameter>を座標<parameter>x</parameter>, <parameter>y</parameter>に描画します。<parameter>handle</parameter>はプリンタへの有効なハンドルである必要があります。 </para> <para> この関数は成功時にtrue、それ以外の場合にfalseを返します。 </para> <example> <title><function>printer_draw_bmp</function> の例</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: -->
« previous php.doc (#969335774) next »