kiggede i min php manual og fandt
er taget direkte fra manualen
-----------------------------------------------------------
CXXIX. Printer Functions
Introduktion
These functions are only available under Windows 9.x, ME, NT4 and 2000. They have been added in PHP 4.0.4.
Installation
This PECL extension is not bundled with PHP.
Windows users must enable php_printer.dll inside of php.ini in order to use these functions. Unbundled PECL extensions may be downloaded from: http://pecl4win.php.net/
Runtime Konfiguration
Virkemåden af disse funktioner er berørt af indstillinger i php.ini.
Tabel 1. Printer configuration options
Name Default Changeable Changelog
printer.default_printer "" PHP_INI_ALL
For flere detaljer og definationer af PHP_INI_* constanterne, se ini_set() dokumentation.
Ressourcetyper
This extension defines handles to a printer connection, to a brush, to a font and to a pen.
Indholdsfortegnelse
printer_abort -- Deletes the printer's spool file
printer_close -- Close an open printer connection
printer_create_brush -- Create a new brush
printer_create_dc -- Create a new device context
printer_create_font -- Create a new font
printer_create_pen -- Create a new pen
printer_delete_brush -- Delete a brush
printer_delete_dc -- Delete a device context
printer_delete_font -- Delete a font
printer_delete_pen -- Delete a pen
printer_draw_bmp -- Draw a bmp
printer_draw_chord -- Draw a chord
printer_draw_elipse -- Draw an ellipse
printer_draw_line -- Draw a line
printer_draw_pie -- Draw a pie
printer_draw_rectangle -- Draw a rectangle
printer_draw_roundrect -- Draw a rectangle with rounded corners
printer_draw_text -- Draw text
printer_end_doc -- Close document
printer_end_page -- Close active page
printer_get_option -- Retrieve printer configuration data
printer_list -- Return an array of printers attached to the server
printer_logical_fontheight -- Get logical font height
printer_open -- Open connection to a printer
printer_select_brush -- Select a brush
printer_select_font -- Select a font
printer_select_pen -- Select a pen
printer_set_option -- Configure the printer connection
printer_start_doc -- Start a new document
printer_start_page -- Start a new page
printer_write -- Write data to the printer
--------------------------------------------------------
printer_open
(PECL)
printer_open -- Open connection to a printer
Description
resource 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.
Eksempel 1. printer_open() example
<?php
$handle = printer_open("HP Deskjet 930c");
$handle = printer_open();
?>
---------------------------------------------------------
printer_write
(PECL)
printer_write -- Write data to the printer
Description
bool printer_write ( resource handle, string content )
Writes content directly to the printer. Returnerer TRUE ved succes, FALSE ved fejl.
handle must be a valid handle to a printer.
Eksempel 1. printer_write() example
<?php
$handle = printer_open();
printer_write($handle, "Text to print");
printer_close($handle);
?>
-------------------------------------------------------
printer_get_option
(PECL)
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.
Eksempel 1. printer_get_option() example
<?php
$handle = printer_open();
echo printer_get_option($handle, PRINTER_DRIVERVERSION);
printer_close($handle);
?>
---------------------------------------------------------
printer_close
(PECL)
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.
Eksempel 1. printer_close() example
<?php
$handle = printer_open();
printer_close($handle);
?>
---------------------------------------------------------
tænker at det er det du har brug for.
manualen kan downloades her
http://www.php.net/docs.php
Indlæg senest redigeret d. 20.07.2007 05:43 af Bruger #10878