From eccf52758ff1016e92a819795d8e35b9279e8a8b Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Fri, 22 Jun 2001 09:59:29 +0000 Subject: [PATCH] reverting the removal of printer.xml r1.1 i can't see any errors produced by this file and it is definetly *not* a PEAR package but a native extension for Win32 systems git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@49999 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/printer.xml | 1681 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1681 insertions(+) create mode 100644 functions/printer.xml diff --git a/functions/printer.xml b/functions/printer.xml new file mode 100644 index 0000000000..7ae6084d36 --- /dev/null +++ b/functions/printer.xml @@ -0,0 +1,1681 @@ + + Printer functions + Printer + + + These functions are only available under Windows 9.x, ME, NT4 and + 2000. They have been added in PHP 4 (4.0.4). + + + + + + + printer_open + Open connection to a printer + + + Description + + + mixed printer_open + [string devicename] + + + + This function tries to open a connection to the printer + devicename, and returns a handle on success + or false on failure. + + + If no parameter was given it tries to open a + connection to the default printer (if not specified in php.ini as + printer.default_printer, php tries to detect it). + + + printer_open also starts a device context. + + + <function>printer_open</function> example + +$handle = printer_open("HP Deskjet 930c"); +$handle = printer_open(); + + + + + + + + + printer_abort + Deletes the printer's spool file + + + Description + + + void printer_abort + resource handle + + + + This function deletes the printers spool file. + + + handle must be a valid handle to a printer. + + + <function>printer_abort</function> example + +$handle = printer_open(); +printer_abort($handle); +printer_close($handle); + + + + + + + + printer_close + Close an open printer connection + + + Description + + + void printer_close + resource handle + + + + This function closes the printer connection. + printer_close also closes the active device + context. + + + handle must be a valid handle to a printer. + + + <function>printer_close</function> example + +$handle = printer_open(); +printer_close($handle); + + + + + + + + + printer_write + Write data to the printer + + + Description + + + bool printer_write + resource handle + string content + + + + Writes content directly to the printer, and + returns true on success or false if it failed. + + + handle must be a valid handle to a printer. + + + <function>printer_write</function> example + +$handle = printer_open(); +printer_write($handle, "Text to print"); +printer_close($handle); + + + + + + + + + printer_list + Return an array of printers attached to the server + + + + Description + + + array printer_list + int enumtype + [string name + [int level]] + + + + The function enumerates available printers and their capabilities. + level sets the level of information request. + Can be 1,2,4 or 5. enumtype must be one of the + following predefined constants: + + + + PRINTER_ENUM_LOCAL: + enumerates the locally installed printers. + + + + + PRINTER_ENUM_NAME: + enumerates the printer of name, can be a server, + domain or print provider. + + + + + PRINTER_ENUM_SHARED: + this parameter can't be used alone, it has to be OR'ed with other + parameters, i.e. PRINTER_ENUM_LOCAL to detect the locally shared + printers. + + + + + PRINTER_ENUM_DEFAULT: + (Win9.x only) enumerates the default printer. + + + + + PRINTER_ENUM_CONNECTIONS: + (WinNT/2000 only) enumerates the printers to which the user has + made connections. + + + + + PRINTER_ENUM_NETWORK: + (WinNT/2000 only) enumerates network printers in the computer's + domain. Only valid if level is 1. + + + + + PRINTER_ENUM_REMOTE: + (WinNT/2000 only) enumerates network printers and print servers in the + computer's domain. Only valid if level is 1. + + + + + + <function>printer_list</function> example + +/* detect locally shared printer */ +var_dump( printer_list(PRINTER_ENUM_LOCAL | PRINTER_ENUM_SHARED) ); + + + + + + + + + printer_set_option + Configure the printer connection + + + Description + + + bool printer_set_option + resource handle + int option + mixed value + + + + The function sets the following options for the current connection: + handle must be a valid handle to a printer. + For option can be one of the following constants: + + + + PRINTER_COPIES: + sets how many copies should be printed, value + must be an integer. + + + + + PRINTER_MODE: + specifies the type of data (text, raw or emf), + value must be a string. + + + + + PRINTER_TITLE: + specifies the name of the document, value + must be a string. + + + + + PRINTER_ORIENTATION: + specifies the orientation of the paper, value + can be either PRINTER_ORIENTATION_PORTRAIT or + PRINTER_ORIENTATION_LANDSCAPE + + + + + PRINTER_RESOLUTION_Y: + specifies the y-resolution in DPI, value + must be an integer. + + + + + PRINTER_RESOLUTION_X: + specifies the x-resolution in DPI, value + must be an integer. + + + + + PRINTER_PAPER_FORMAT: + specifies the a predefined paper format, set value + to PRINTER_FORMAT_CUSTOM if you want to specify a custom format with + PRINTER_PAPER_WIDTH and PRINTER_PAPER_LENGTH. value + can be one of the following constants. + + + + + PRINTER_FORMAT_CUSTOM: + let's you specify a custom paper format. + + + + + PRINTER_FORMAT_LETTER: + specifies standard letter format (8 1/2- by 11-inches). + + + + + PRINTER_FORMAT_LETTER: + specifies standard legal format (8 1/2- by 14-inches). + + + + + PRINTER_FORMAT_A3: + specifies standard A3 format (297- by 420-millimeters). + + + + + PRINTER_FORMAT_A4: + specifies standard A4 format (210- by 297-millimeters). + + + + + PRINTER_FORMAT_A5: + specifies standard A5 format (148- by 210-millimeters). + + + + + PRINTER_FORMAT_B4: + specifies standard B4 format (250- by 354-millimeters). + + + + + PRINTER_FORMAT_B5: + specifies standard B5 format (182- by 257-millimeter). + + + + + PRINTER_FORMAT_FOLIO: + specifies standard FOLIO format (8 1/2- by 13-inch). + + + + + + + PRINTER_PAPER_LENGTH: + if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM, + PRINTER_PAPER_LENGTH specifies a custom paper length in mm, + value must be an integer. + + + + + PRINTER_PAPER_WIDTH: + if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM, + PRINTER_PAPER_WIDTH specifies a custom paper width in mm, + value must be an integer. + + + + + PRINTER_SCALE: + 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. value + must be an integer. + + + + + PRINTER_BACKGROUND_COLOR: + specifies the background color for the actual device context, + value must be a string containing the rgb + information in hex format i.e. "005533". + + + + + PRINTER_TEXT_COLOR: + specifies the text color for the actual device context, + value must be a string containing the rgb + information in hex format i.e. "005533". + + + + + PRINTER_TEXT_ALIGN: + specifies the text alignment for the actual device context, + value can be combined through OR'ing the + following constants: + + + + + PRINTER_TA_BASELINE: + text will be aligned at the base line. + + + + + PRINTER_TA_BOTTOM: + text will be aligned at the bottom. + + + + + PRINTER_TA_TOP: + text will be aligned at the top. + + + + + PRINTER_TA_CENTER: + text will be aligned at the center. + + + + + PRINTER_TA_LEFT: + text will be aligned at the left. + + + + + PRINTER_TA_RIGHT: + text will be aligned at the right. + + + + + + + + <function>printer_set_option</function> example + +$handle = printer_open(); +printer_set_option($handle, PRINTER_SCALE, 75); +printer_set_option($handle, PRINTER_TEXT_ALIGN, PRINTER_TA_LEFT); +printer_close($handle); + + + + + + + + + printer_get_option + Retrieve printer configuration data + + + Description + + + mixed printer_get_option + resource handle + string option + + + + The function retrieves the configuration setting of option. + handle must be a valid handle to a printer. + Take a look at printer_set_option for the settings that can + be retrieved, additionally the following settings can be retrieved: + + + + PRINTER_DEVICENAME + returns the devicename of the printer. + + + + + PRINTER_DRIVERVERSION + returns the printer driver version. + + + + + + <function>printer_get_option</function> example + +$handle = printer_open(); +print printer_get_option($handle, PRINTER_DRIVERVERSION); +printer_close($handle); + + + + + + + + + printer_create_dc + Create a new device context + + + Description + + + void printer_create_dc + resource handle + + + + The function creates a new device context. A device context is used + to customize the graphic objects of the document. + handle must be a valid handle to a printer. + + + <function>printer_create_dc</function> example + +$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); + + + + + + + + + printer_delete_dc + Delete a device context + + + Description + + + bool printer_delete_dc + resource handle + + + + The function deletes the device context and returns true on success, + or false if an error occurred. For an example see + printer_create_dc. handle + must be a valid handle to a printer. + + + + + + + + printer_start_doc + Start a new document + + + Description + + + bool printer_start_doc + resource handle + [string document] + + + + 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. handle must be a valid handle to a + printer. The optional parameter document can be + used to set an alternative document name. + + + <function>printer_start_doc</function> example + +$handle = printer_open(); +printer_start_doc($handle, "My Document"); +printer_start_page($handle); + +printer_end_page($handle); +printer_end_doc($handle); +printer_close($handle); + + + + + + + + + printer_end_doc + Close document + + + Description + + + bool printer_end_doc + + resource handle + + + + + 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 printer_start_doc. + handle must be a valid handle to a printer. + + + + + + + + printer_start_page + Start a new page + + + Description + + + bool printer_start_page + + resource handle + + + + + The function creates a new page in the active document. For an + example see printer_start_doc. + handle must be a valid handle to a printer. + + + + + + + + printer_end_page + Close active page + + + Description + + + bool printer_end_page + + resource handle + + + + + The function closes the active page in the active document. For an + example see printer_start_doc. + handle must be a valid handle to a printer. + + + + + + + + printer_create_pen + Create a new pen + + + Description + + + mixed printer_create_pen + + int style + int width + string color + + + + 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 + printer_select_pen. color + must be a color in RGB hex format, i.e. "000000" for black, + width specifies the width of the pen whereas + style must be one of the following constants: + + + + PRINTER_PEN_SOLID: + creates a solid pen. + + + + + PRINTER_PEN_DASH: + creates a dashed pen. + + + + + PRINTER_PEN_DOT: + creates a dotted pen. + + + + + PRINTER_PEN_DASHDOT: + creates a pen with dashes and dots. + + + + + PRINTER_PEN_DASHDOTDOT: + creates a pen with dashes and double dots. + + + + + PRINTER_PEN_INVISIBLE: + creates an invisible pen. + + + + + + + + + + + printer_delete_pen + Delete a pen + + + Description + + + bool printer_delete_pen + + resource handle + + + + The function deletes the selected pen. For an example see + printer_select_pen. It returns true on success, + or false otherwise. handle must be a valid + handle to a pen. + + + + + + + + printer_select_pen + Select a pen + + + Description + + + void printer_select_pen + + resource printer_handle + resource pen_handle + + + + 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. printer_handle must be a valid handle + to a printer. pen_handle must be a valid handle + to a pen. + + + + <function>printer_select_pen</function> example + + +$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); + + + + + + + + printer_create_brush + Create a new brush + + + Description + + + mixed printer_create_brush + + int style + string color + + + + The function creates a new brush and returns a handle to it. A brush + is used to fill shapes. For an example see + printer_select_brush. color + must be a color in RGB hex format, i.e. "000000" for black, + style must be one of the following constants: + + + + PRINTER_BRUSH_SOLID: + creates a brush with a solid color. + + + + + PRINTER_BRUSH_DIAGONAL: + creates a brush with a 45-degree upward left-to-right hatch ( / ). + + + + + PRINTER_BRUSH_CROSS: + creates a brush with a cross hatch ( + ). + + + + + PRINTER_BRUSH_DIAGCROSS: + creates a brush with a 45 cross hatch ( x ). + + + + + PRINTER_BRUSH_FDIAGONAL: + creates a brush with a 45-degree downward left-to-right hatch ( \ ). + + + + + PRINTER_BRUSH_HORIZONTAL: + creates a brush with a horizontal hatch ( - ). + + + + + PRINTER_BRUSH_VERTICAL: + creates a brush with a vertical hatch ( | ). + + + + + PRINTER_BRUSH_CUSTOM: + creates a custom brush from an BMP file. The second parameter + is used to specify the BMP instead of the RGB color code. + + + + + + + + + + printer_delete_brush + Delete a brush + + + Description + + + bool printer_delete_brush + + resource handle + + + + The function deletes the selected brush. For an example see + printer_select_brush. It returns true on + success, or false otherwise. handle + must be a valid handle to a brush. + + + + + + + printer_select_brush + Select a brush + + + Description + + + void printer_select_brush + + resource printer_handle + resource brush_handle + + + + 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. printer_handle must be a valid handle + to a printer. brush_handle must be a valid handle + to a brush. + + + + <function>printer_select_brush</function> example + + +$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); + + + + + + + + printer_create_font + Create a new font + + + Description + + + mixed printer_create_font + + string face + int height + int width + int font_weight + bool italic + bool underline + bool strikeout + int orientaton + + + + The function creates a new font and returns a handle to it. A font is + used to draw text. For an example see + printer_select_font. face + must be a string specifying the font face. height + specifies the font height, and width the font + width. The font_weight specifies the font weight + (400 is normal), and can be one of the following predefined constants. + + + + PRINTER_FW_THIN: + sets the font weight to thin (100). + + + + + PRINTER_FW_ULTRALIGHT: + sets the font weight to ultra light (200). + + + + + PRINTER_FW_LIGHT: + sets the font weight to light (300). + + + + + PRINTER_FW_NORMAL: + sets the font weight to normal (400). + + + + + PRINTER_FW_MEDIUM: + sets the font weight to medium (500). + + + + + PRINTER_FW_BOLD: + sets the font weight to bold (700). + + + + + PRINTER_FW_ULTRABOLD: + sets the font weight to ultra bold (800). + + + + + PRINTER_FW_HEAVY: + sets the font weight to heavy (900). + + + + italic can be true or false, and sets whether the font should be italic. + underline can be true or false, and sets whether the font should be underlined. + strikeout can be true or false, and sets whether the font should be striked out. + orientation specifies a rotation. + For an example see printer_select_font. + + + + + + + printer_delete_font + Delete a font + + + Description + + + bool printer_delete_font + + resource handle + + + + The function deletes the selected font. For an example see + printer_select_font. It returns true on success, + or false otherwise. handle must be a valid + handle to a font. + + + + + + + printer_select_font + Select a font + + + Description + + + void printer_select_font + + resource printer_handle + resource font_handle + + + + The function selects a font to draw text. + printer_handle must be a valid handle to a + printer. font_handle must be a valid handle + to a font. + + + + <function>printer_select_font</function> example + + +$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); + + + + + + + + printer_logical_fontheight + Get logical font height + + + Description + + + int printer_logical_fontheight + + resource handle + int height + + + + The function calculates the logical font height of + height. handle must + be a valid handle to a printer. + + + + <function>printer_logical_fontheight</function> example + + +$handle = printer_open(); +print printer_logical_fontheight($handle, 72); +printer_close($handle); + + + + + + + + printer_draw_roundrect + Draw a rectangle with rounded corners + + + Description + + + void printer_draw_roundrect + + resource handle + int ul_x + int ul_y + int lr_x + int lr_y + int width + int height + + + + The function simply draws a rectangle with rounded corners. + + + handle must be a valid handle to a printer. + + + ul_x is the upper left x coordinate of the rectangle. + + + ul_y is the upper left y coordinate of the rectangle. + + + lr_x is the lower right x coordinate of the rectangle. + + + lr_y is the lower right y coordinate of the rectangle. + + + width is the width of the ellipse. + + + height is the height of the ellipse. + + + + <function>printer_draw_roundrect</function> example + +$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); + + + + + + + + printer_draw_rectangle + Draw a rectangle + + + Description + + + void printer_draw_rectangle + + resource handle + int ul_x + int ul_y + int lr_x + int lr_y + + + + The function simply draws a rectangle. + + + handle must be a valid handle to a printer. + + + ul_x is the upper left x coordinate of the rectangle. + + + ul_y is the upper left y coordinate of the rectangle. + + + lr_x is the lower right x coordinate of the rectangle. + + + lr_y is the lower right y coordinate of the rectangle. + + + + <function>printer_draw_rectangle</function> example + + +$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); + + + + + + + + printer_draw_elipse + Draw an ellipse + + + Description + + + void printer_draw_elipse + + resource handle + int ul_x + int ul_y + int lr_x + int lr_y + + + + The function simply draws an ellipse. + handle must be a valid handle to a printer. + + + ul_x is the upper left x coordinate of the ellipse. + + + ul_y is the upper left y coordinate of the ellipse. + + + lr_x is the lower right x coordinate of the ellipse. + + + lr_y is the lower right y coordinate of the ellipse. + + + + <function>printer_draw_elipse</function> example + + +$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); + + + + + + + + printer_draw_text + Draw text + + + Description + + + void printer_draw_text + + resource printer_handle + string text + int x + int y + + + + The function simply draws text at position + x, y using the selected + font. printer_handle must be a valid handle to + a printer. + + + <function>printer_draw_text</function> example + +$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); + + + + + + + + printer_draw_line + Draw a line + + + Description + + + void printer_draw_line + resource printer_handle + int from_x + int from_y + int to_x + int to_y + + + + The function simply draws a line from position + from_x, from_y to + position to_x, to_y + using the selected pen. printer_handle must + be a valid handle to a printer. + + + <function>printer_draw_line</function> example + +$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); + + + + + + + + printer_draw_chord + Draw a chord + + + Description + + + void printer_draw_chord + + resource handle + int rec_x + int rec_y + int rec_x1 + int rec_y1 + int rad_x + int rad_y + int rad_x1 + int rad_y1 + + + + The function simply draws an chord. + handle must be a valid handle to a printer. + + + rec_x is the upper left x coordinate of the + bounding rectangle. + + + rec_y is the upper left y coordinate of the + bounding rectangle. + + + rec_x1 is the lower right x coordinate of the + bounding rectangle. + + + rec_y1 is the lower right y coordinate of + the bounding rectangle. + + + rad_x is x coordinate of the radial defining + the beginning of the chord. + + + rad_y is y coordinate of the radial defining + the beginning of the chord. + + + rad_x1 is x coordinate of the radial defining + the end of the chord. + + + rad_y1 is y coordinate of the radial defining + the end of the chord. + + + <function>printer_draw_chord</function> example + +$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); + + + + + + + + printer_draw_pie + Draw a pie + + + Description + + + void printer_draw_pie + resource handle + int rec_x + int rec_y + int rec_x1 + int rec_y1 + int rad1_x + int rad1_y + int rad2_x + int rad2_y + + + + The function simply draws an pie. + handle must be a valid handle to a printer. + + + rec_x is the upper left x coordinate of + the bounding rectangle. + + + rec_y is the upper left y coordinate of + the bounding rectangle. + + + rec_x1 is the lower right x coordinate of + the bounding rectangle. + + + rec_y1 is the lower right y coordinate of + the bounding rectangle. + + + rad1_x is x coordinate of the first + radial's ending. + + + rad1_y is y coordinate of the first + radial's ending. + + + rad2_x is x coordinate of the second + radial's ending. + + + rad2_y is y coordinate of the second + radial's ending. + + + <function>printer_draw_chord</function> example + +$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); + + + + + + + + printer_draw_bmp + Draw a bmp + + + Description + + + void printer_draw_bmp + + resource handle + string filename + int x + int y + + + + The function simply draws an bmp the bitmap + filename at position x, + y. handle must be a + valid handle to a printer. + + + The function returns true on success, or otherwise false. + + + <function>printer_draw_bmp</function> example + +$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); + + + + + +