Re: Printing again
| From: | Ivan Rodriguez | Date: | Wed, 26 Nov 2003 07:42:08 +0000 |
| Subject: | Re: Printing again | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4233@lists.php.net to get a copy of this message | ||
Hi Madeline, i use php print to print something, and i dont have any
problem, Christian did something to print (an interface to select printers
... papers ...) here i put you some code to view:
function _printCard() {
$node = $this->widget['clients']->selection;
if(gettype($node[0]) == "NULL") {
new DikodePopUp("Advertencia", "Selecciona un cliente");
} else {
list ($cliente, $spacing, $pixmap, $mask) = $this->widget['clients'] ->
node_get_pixtext($node[0], 0);
$SQL = "SELECT * FROM clientes WHERE nombre = '$cliente'";
$datos = $this->dikode -> getDatos($SQL);
$printer = printer_open();
printer_start_doc($printer, "My Document");
printer_set_option($handle, PRINTER_SCALE, 100);
$font = printer_create_font("verdana", 100, 43, PRINTER_FW_MEDIUM,
false, false, false, 0);
$font2 = printer_create_font("verdana", 197, 84, PRINTER_FW_MEDIUM,
false, false, false, 0);
printer_select_font($printer, $font2);
printer_draw_text($printer, $datos[0][18], 100, 0);
$pen = printer_create_pen(PRINTER_PEN_SOLID, 1, "000000");
printer_select_pen($printer, $pen);
printer_draw_line($printer, 10, 215, 9000, 215);
printer_select_font($printer, $font);
printer_draw_text($printer, "Nombre de proyecto:", 100, 300);
printer_draw_text($printer, "Empresa:", 100, 400);
printer_draw_text($printer, "Teléfono:", 100, 500);
printer_draw_text($printer, "E-mail:", 100, 600);
printer_draw_text($printer, "Persona de contacto:", 100, 700);
printer_draw_text($printer, "Dirección:", 100, 800);
printer_draw_text($printer, "Ciudad:", 100, 900);
printer_draw_text($printer, "Provincia:", 100, 1000);
printer_draw_text($printer, "País:", 100, 1100);
printer_draw_text($printer, "Código postal:", 100, 1200);
printer_draw_text($printer, "Usuario:", 100, 1300);
printer_draw_text($printer, "Contraseña:", 100, 1400);
printer_draw_text($printer, "Usuario de MySQL:", 100, 1500);
printer_draw_text($printer, "Contraseña de MySQL:", 100, 1600);
printer_draw_text($printer, "Usuario de FTP:", 100, 1700);
printer_draw_text($printer, "Contraseña de FTP:", 100, 1800);
printer_draw_text($printer, "Servicio:", 100, 1900);
printer_draw_text($printer, "Fecha:", 100, 2000);
printer_draw_text($printer, $datos[0][18], 1300, 300);
printer_draw_text($printer, $datos[0][1], 1300, 400);
printer_draw_text($printer, $datos[0][2], 1300, 500);
printer_draw_text($printer, $datos[0][3], 1300, 600);
printer_draw_text($printer, $datos[0][4], 1300, 700);
printer_draw_text($printer, $datos[0][5], 1300, 800);
printer_draw_text($printer, $datos[0][6], 1300, 900);
printer_draw_text($printer, $datos[0][7], 1300, 1000);
printer_draw_text($printer, $datos[0][8], 1300, 1100);
printer_draw_text($printer, $datos[0][9], 1300, 1200);
printer_draw_text($printer, $datos[0][10], 1300, 1300);
printer_draw_text($printer, $datos[0][11], 1300, 1400);
printer_draw_text($printer, $datos[0][12], 1300, 1500);
printer_draw_text($printer, $datos[0][13], 1300, 1600);
printer_draw_text($printer, $datos[0][14], 1300, 1700);
printer_draw_text($printer, $datos[0][15], 1300, 1800);
printer_draw_text($printer, $datos[0][16], 1300, 1900);
printer_draw_text($printer, date("d/m/Y h:i:s", $datos[0][17]), 1300,
2000);
printer_delete_font($font);
printer_end_page($printer);
printer_end_doc($printer);
printer_close($printer);
return $this->_showClients();
}
}
This code works fine :-)
----- Original Message -----
From: "Madeleine D." <mmdrake@bctonline.com>
To: <php-gtk-general@lists.php.net>
Sent: Wednesday, November 26, 2003 7:12 AM
Subject: [PHP-GTK] Printing again
> Sorry to bring this up again... but after avoiding the whole issue of
> printing out of our gtk app, I now have to face it and find some kind of
> resolution pretty quick.
>
> I tried using the PHP printer commands; they created reports, etc just
> fine, but when we tried to print them on networked LJ's, they dropped data
> randomly throughout the reports.
>
> I've looked at fwrite and then COM into Word, Excel, IE, but the first two
> are horribly slow and the last one doesn't appear to be very robust in
> terms of commands.
>
> I also looked at Ben's suggestion for PHPLib, but I'm confused there; all
> the docs say they are sticking with PHP3, and we are developing on PHP4.
> Is that going to cause us issues?? Performance is a big concern for our
> clients. Also, I really don't want to have to install two different
PHP's.
>
> Bottom line, what is everybody using to print out of PHP-Gtk???
>
> thanks
> Madeleine D.
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>