PHP Printer Functions

EditRocket provides the following information on Printer functions in the PHP source code builder.

void printer_abort ( resource $printer_handle ) - This function deletes the printers spool file.

void printer_close ( resource $printer_handle ) - This function closes the printer connection. printer_close() also closes the active device context.

resource 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.

void printer_create_dc ( resource $printer_handle ) - The function creates a new device context. A device context is used to customize the graphic objects of the document.

resource printer_create_font ( string $face , int $height , int $width , int $font_weight , bool $italic , bool $underline , bool $strikeout , int $orientation ) - The function creates a new font and returns a handle to it. A font is used to draw text.

resource 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.

void printer_delete_brush ( resource $brush_handle ) - The function deletes the selected brush.

bool printer_delete_dc ( resource $printer_handle ) - The function deletes the device context.

void printer_delete_font ( resource $font_handle ) - The function deletes the selected font.

void printer_delete_pen ( resource $pen_handle ) - The function deletes the selected pen.

bool printer_draw_bmp ( resource $printer_handle , string $filename , int $x , int $y [, int $width ], int $height ) - The function draws an bmp.

void printer_draw_chord ( resource $printer_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.

void printer_draw_elipse ( resource $printer_handle , int $ul_x , int $ul_y , int $lr_x , int $lr_y ) - The function draws an ellipse.

void printer_draw_line ( resource $printer_handle , int $from_x , int $from_y , int $to_x , int $to_y ) - The function draws a line using the selected pen.

void printer_draw_pie ( resource $printer_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 draws an pie.

void printer_draw_rectangle ( resource $printer_handle , int $ul_x , int $ul_y , int $lr_x , int $lr_y ) - The function draws a rectangle.

void printer_draw_roundrect ( resource $printer_handle , int $ul_x , int $ul_y , int $lr_x , int $lr_y , int $width , int $height ) - The function draws a rectangle with rounded corners.

void printer_draw_text ( resource $printer_handle , string $text , int $x , int $y ) - The function draws text at position x, y using the selected font.

bool printer_end_doc ( resource $printer_handle ) - Closes a new document in the printer spooler. The document is now ready for printing.

bool printer_end_page ( resource $printer_handle ) - The function closes the active page in the active document.

mixed printer_get_option ( resource $printer_handle , string $option ) - The function retrieves the configuration setting of option.

array printer_list ( int $enumtype [, string $name [, int $level ]] ) - The function enumerates available printers and their capabilities.

int printer_logical_fontheight ( resource $printer_handle , int $height ) - The function calculates the logical font height of height.

resource printer_open ([ string $printername ] ) - This function tries to open a connection to the given printer.

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.

void printer_select_font ( resource $printer_handle , resource $font_handle ) - The function selects a font to draw text.

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.

bool printer_set_option ( resource $printer_handle , int $option , mixed $value ) - The function sets options for the current connection.

bool printer_start_doc ( resource $printer_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.

bool printer_start_page ( resource $printer_handle ) - The function creates a new page in the active document.

bool printer_write ( resource $printer_handle , string $content ) - Writes content directly to the printer.