1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.7 $ -->
<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>
<methodsynopsis>
<type>mixed</type><methodname>printer_open</methodname>
<methodparam choice="opt"><type>string</type><parameter>devicename</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、プリンタ<parameter>devicename</parameter>への接続を
試み、成功時にハンドル、失敗時に&false;を返します。
</para>
<para>
パラメータが指定されない場合、この関数はデフォルトのプリンタへ
の接続をオープンします。(<filename>php.ini</filename>に
<literal>printer.default_printer</literal>として指定されていな
い場合は、PHPはデフォルトのプリンタの検出を試みます)
</para>
<para>
<function>printer_open</function> は、デバイスコンテキストも
開始します。
</para>
<example>
<title><function>printer_open</function> の例</title>
<programlisting role="php">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_abort</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、プリンタのスプールファイルを削除します。
</para>
<para>
<parameter>handle</parameter> には、プリンタへの有効なハンドルを
指定する必要があります。
</para>
<example>
<title><function>printer_abort</function> の例</title>
<programlisting role="php">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_close</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、プリンタへの接続をクローズします。
<function>printer_close</function> は、アクティブなデバイスコンテ
キストへもクローズします。
</para>
<para>
<parameter>handle</parameter> は、プリンタへの有効なハンドルである必要があります。
</para>
<example>
<title><function>printer_close</function> の例</title>
<programlisting role="php">
<![CDATA[
$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>
<methodsynopsis>
<type>bool</type><methodname>printer_write</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>string</type><parameter>content</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>content</parameter> を直接プリンタに書き込み、成功時に
&true;、失敗した場合に&false;を返します。
</para>
<para>
<parameter>handle</parameter> は、プリンタへの有効なハンドルであ
る必要があります。
</para>
<example>
<title><function>printer_write</function> の例</title>
<programlisting role="php">
<![CDATA[
$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>
<methodsynopsis>
<type>array</type><methodname>printer_list</methodname>
<methodparam><type>int</type><parameter>enumtype</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>level</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
/* ローカルな共有プリンタを検出 */
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>
<methodsynopsis>
<type>bool</type><methodname>printer_set_option</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>option</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
The function sets the following options for the current connection:
<parameter>handle</parameter> must be a valid handle to a printer.
For <parameter>option</parameter> can be one of the following constants:
<itemizedlist>
<listitem>
<simpara>
<parameter>PRINTER_COPIES</parameter>:
sets how many copies should be printed, <parameter>value</parameter>
must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_MODE</parameter>:
specifies the type of data (text, raw or emf),
<parameter>value</parameter> must be a string.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TITLE</parameter>:
specifies the name of the document, <parameter>value</parameter>
must be a string.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_ORIENTATION</parameter>:
specifies the orientation of the paper, <parameter>value</parameter>
can be either PRINTER_ORIENTATION_PORTRAIT or
PRINTER_ORIENTATION_LANDSCAPE
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_RESOLUTION_Y</parameter>:
specifies the y-resolution in DPI, <parameter>value</parameter>
must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_RESOLUTION_X</parameter>:
specifies the x-resolution in DPI, <parameter>value</parameter>
must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_PAPER_FORMAT</parameter>:
specifies the a predefined paper format, set <parameter>value</parameter>
to PRINTER_FORMAT_CUSTOM if you want to specify a custom format with
PRINTER_PAPER_WIDTH and PRINTER_PAPER_LENGTH. <parameter>value</parameter>
can be one of the following constants.
</simpara>
<itemizedlist>
<listitem>
<simpara>
<parameter> PRINTER_FORMAT_CUSTOM</parameter>:
let's you specify a custom paper format.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter> PRINTER_FORMAT_LETTER</parameter>:
specifies standard letter format (8 1/2- by 11-inches).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter> PRINTER_FORMAT_LETTER</parameter>:
specifies standard legal format (8 1/2- by 14-inches).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_A3</parameter>:
specifies standard A3 format (297- by 420-millimeters).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_A4</parameter>:
specifies standard A4 format (210- by 297-millimeters).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_A5</parameter>:
specifies standard A5 format (148- by 210-millimeters).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_B4</parameter>:
specifies standard B4 format (250- by 354-millimeters).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_B5</parameter>:
specifies standard B5 format (182- by 257-millimeter).
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_FORMAT_FOLIO</parameter>:
specifies standard FOLIO format (8 1/2- by 13-inch).
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_PAPER_LENGTH</parameter>:
if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM,
PRINTER_PAPER_LENGTH specifies a custom paper length in mm,
<parameter>value</parameter> must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_PAPER_WIDTH</parameter>:
if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM,
PRINTER_PAPER_WIDTH specifies a custom paper width in mm,
<parameter>value</parameter> must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_SCALE</parameter>:
specifies the factor by which the printed output is to be scaled.
the page size is scaled from the physical page size by a factor
of scale/100. for example if you set the scale to 50, the output
would be half of it's original size. <parameter>value</parameter>
must be an integer.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_BACKGROUND_COLOR</parameter>:
specifies the background color for the actual device context,
<parameter>value</parameter> must be a string containing the rgb
information in hex format i.e. "005533".
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TEXT_COLOR</parameter>:
specifies the text color for the actual device context,
<parameter>value</parameter> must be a string containing the rgb
information in hex format i.e. "005533".
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TEXT_ALIGN</parameter>:
specifies the text alignment for the actual device context,
<parameter>value</parameter> can be combined through OR'ing the
following constants:
</simpara>
<itemizedlist>
<listitem>
<simpara>
<parameter>PRINTER_TA_BASELINE</parameter>:
text will be aligned at the base line.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_BOTTOM</parameter>:
text will be aligned at the bottom.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_TOP</parameter>:
text will be aligned at the top.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_CENTER</parameter>:
text will be aligned at the center.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_LEFT</parameter>:
text will be aligned at the left.
</simpara>
</listitem>
<listitem>
<simpara>
<parameter>PRINTER_TA_RIGHT</parameter>:
text will be aligned at the right.
</simpara>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</para>
<example>
<title><function>printer_set_option</function> example</title>
<programlisting role="php">
<![CDATA[
$handle = printer_open();
printer_set_option($handle, PRINTER_SCALE, 75);
printer_set_option($handle, PRINTER_TEXT_ALIGN, PRINTER_TA_LEFT);
printer_close($handle);
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.printer-get-option">
<refnamediv>
<refname>printer_get_option</refname>
<refpurpose>プリンタ設定データを取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>mixed</type><methodname>printer_get_option</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>string</type><parameter>option</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_create_dc</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>bool</type><methodname>printer_delete_dc</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>bool</type><methodname>printer_start_doc</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>document</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>bool</type><methodname>printer_end_doc</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<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>新規ページを開始する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>bool</type><methodname>printer_start_page</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>bool</type><methodname>printer_end_page</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>mixed</type><methodname>printer_create_pen</methodname>
<methodparam><type>int</type><parameter>style</parameter></methodparam>
<methodparam><type>int</type><parameter>width</parameter></methodparam>
<methodparam><type>string</type><parameter>color</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>bool</type><methodname>printer_delete_pen</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>void</type><methodname>printer_select_pen</methodname>
<methodparam><type>resource</type><parameter>printer_handle</parameter></methodparam>
<methodparam><type>resource</type><parameter>pen_handle</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>mixed</type><methodname>printer_create_brush</methodname>
<methodparam><type>int</type><parameter>style</parameter></methodparam>
<methodparam><type>string</type><parameter>color</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>bool</type><methodname>printer_delete_brush</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>void</type><methodname>printer_select_brush</methodname>
<methodparam><type>resource</type><parameter>printer_handle</parameter></methodparam>
<methodparam><type>resource</type><parameter>brush_handle</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>mixed</type><methodname>printer_create_font</methodname>
<methodparam><type>string</type><parameter>face</parameter></methodparam>
<methodparam><type>int</type><parameter>height</parameter></methodparam>
<methodparam><type>int</type><parameter>width</parameter></methodparam>
<methodparam><type>int</type><parameter>font_weight</parameter></methodparam>
<methodparam><type>bool</type><parameter>italic</parameter></methodparam>
<methodparam><type>bool</type><parameter>underline</parameter></methodparam>
<methodparam><type>bool</type><parameter>strikeout</parameter></methodparam>
<methodparam><type>int</type><parameter>orientaton</parameter></methodparam>
</methodsynopsis>
<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>フォントを削除する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>bool</type><methodname>printer_delete_font</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>void</type><methodname>printer_select_font</methodname>
<methodparam><type>resource</type><parameter>printer_handle</parameter></methodparam>
<methodparam><type>resource</type><parameter>font_handle</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>int</type><methodname>printer_logical_fontheight</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>height</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_draw_roundrect</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>ul_x</parameter></methodparam>
<methodparam><type>int</type><parameter>ul_y</parameter></methodparam>
<methodparam><type>int</type><parameter>lr_x</parameter></methodparam>
<methodparam><type>int</type><parameter>lr_y</parameter></methodparam>
<methodparam><type>int</type><parameter>width</parameter></methodparam>
<methodparam><type>int</type><parameter>height</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_draw_rectangle</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>ul_x</parameter></methodparam>
<methodparam><type>int</type><parameter>ul_y</parameter></methodparam>
<methodparam><type>int</type><parameter>lr_x</parameter></methodparam>
<methodparam><type>int</type><parameter>lr_y</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_draw_elipse</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>ul_x</parameter></methodparam>
<methodparam><type>int</type><parameter>ul_y</parameter></methodparam>
<methodparam><type>int</type><parameter>lr_x</parameter></methodparam>
<methodparam><type>int</type><parameter>lr_y</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_draw_text</methodname>
<methodparam><type>resource</type><parameter>printer_handle</parameter></methodparam>
<methodparam><type>string</type><parameter>text</parameter></methodparam>
<methodparam><type>int</type><parameter>x</parameter></methodparam>
<methodparam><type>int</type><parameter>y</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_draw_line</methodname>
<methodparam><type>resource</type><parameter>printer_handle</parameter></methodparam>
<methodparam><type>int</type><parameter>from_x</parameter></methodparam>
<methodparam><type>int</type><parameter>from_y</parameter></methodparam>
<methodparam><type>int</type><parameter>to_x</parameter></methodparam>
<methodparam><type>int</type><parameter>to_y</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_draw_chord</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>rec_x</parameter></methodparam>
<methodparam><type>int</type><parameter>rec_y</parameter></methodparam>
<methodparam><type>int</type><parameter>rec_x1</parameter></methodparam>
<methodparam><type>int</type><parameter>rec_y1</parameter></methodparam>
<methodparam><type>int</type><parameter>rad_x</parameter></methodparam>
<methodparam><type>int</type><parameter>rad_y</parameter></methodparam>
<methodparam><type>int</type><parameter>rad_x1</parameter></methodparam>
<methodparam><type>int</type><parameter>rad_y1</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_draw_pie</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>rec_x</parameter></methodparam>
<methodparam><type>int</type><parameter>rec_y</parameter></methodparam>
<methodparam><type>int</type><parameter>rec_x1</parameter></methodparam>
<methodparam><type>int</type><parameter>rec_y1</parameter></methodparam>
<methodparam><type>int</type><parameter>rad1_x</parameter></methodparam>
<methodparam><type>int</type><parameter>rad1_y</parameter></methodparam>
<methodparam><type>int</type><parameter>rad2_x</parameter></methodparam>
<methodparam><type>int</type><parameter>rad2_y</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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>
<methodsynopsis>
<type>void</type><methodname>printer_draw_bmp</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam><type>int</type><parameter>x</parameter></methodparam>
<methodparam><type>int</type><parameter>y</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
$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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|