PHP_PRINTER.DLL : how to use printer_create_dc?

From: Date: Thu, 01 Feb 2007 00:34:42 +0000
Subject: PHP_PRINTER.DLL : how to use printer_create_dc?
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-4473@lists.php.net to get a copy of this message
According to the sample at http://www.php.net/manual/en/function.printer-create-dc.php <?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_end_page($handle); printer_end_doc($handle); printer_close($handle); ?> PHP throw me this: PHP Warning: printer_create_dc(): Deleting old DeviceContext in C:\WinBinder\phpcode\examples\print_dc.php on line 6 PHP Warning: printer_end_page(): couldn't end the page in C:\WinBinder\phpcode\examples\print_dc.php on line 20 PHP Warning: printer_end_doc(): couldn't terminate print job in C:\WinBinder\phpcode\examples\print_dc.php on line 21 I figure out already that printer_open() create a new DC till it's deleted or another is created. But that means it only can exist one document in each dc because it cannot be printed if the dc is deleted... I want to use PRINTER_TEXT_ALIGN but it seems it doesn't work... I download the php_printer.dll from http://pecl4win.php.net/ext.php/php_printer.dll and found the source code printer.c at http://viewcvs.php.net/viewvc.cgi/pecl/printer/printer.c?revision=1.34&view=markup

« previous php.pecl.dev (#4473) next »