Hi Fernando,
the printer_write() function writes directly to the printer and you do not
need to call printer_start_doc(), priner_start_page() etc. These functions
must be used if you are printing useing the printer_drap_text().
Here is two examples from the documentation:
<?php
$handle = printer_open();
printer_write($handle, "Text to print");
printer_close($handle);
?>
<?php
$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);
?>
- Frank
>
> Greetings from Mexico.
>
> I wrote an script to pull some data from a database and created a report
to
> be printed directly by php. All went fine until i noticed that after the
> actual printing there is an extra blank page. I've tried on a Epson
FX980
> and several HP LaserJet Printers with the same result. Checking the
spooler
> i see 2 jobs for every report i send to the printer.
>
> Even if a send a single line using the script below i got 2 pages.
>
> $text = 'Hello printer... How do you do?';
>
> $handle = printer_open( ); // Blank means default windows printer
> printer_start_doc($handle, "My Document");
> printer_start_page($handle);
> printer_write( $text );
> printer_end_page($handle);
> printer_end_doc($handle);
> printer_close($handle);
>
> what i'm doing wrong?
>
> Fernando Ocampo
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php