Re: Printing in windows
| From: | Madeleine D. | Date: | Wed, 04 Oct 2006 19:47:30 +0000 |
| Subject: | Re: Printing in windows | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7322@lists.php.net to get a copy of this message | ||
Veronica -
Your need sounds pretty similar to ours, except we go to LJ's, also for pre-printed forms. Yours might even be easier, since LJ's tend to slip and slid on pre-printed's - making for some nasty alignment nightmares.
Uncomment the printer.dll in your php.ini, and you should be fine. Instead of using the printer default setting in the ini, we use a constant, based on the form being printed. A typical switch setting for our app looks like this:
case "STATEMENT" : $handle = printer_open(PMSTMPRINTER);
printer_start_doc($handle);
printer_start_page($handle); $stdFont = printer_create_font(PMSTMFONT,PMSTMFONTHEIGHTSTD,PMSTMFONTWIDTHSTD,PMSTMFONTWEIGHTSTD,FALSE,FALSE,FALSE,0);
printer_select_font($handle, $stdFont); break;
The PM* items are all constants set based on the customer requirements, and in this case, unique to the device (STM = statement printer).
The switch is followed by a read of the input text file and printer_draw_text to the $handle. Works like a charm.
HTH,
Madeleine D.
Veronica A. Bendersky wrote:
Hi Madeline, I need to print invoices from a php gtk app. In pre-printed forms, using dot matrix printers. I was planning to use the php printer commands, and the printer dll. Did you find any special issues trying to print text? From what you say I think I should be fine. Regards, Veronica ______________________________________________________________________________________ ----- Original Message ----- From: "Madeleine D." <mmdrake@bctonline.com> To: "Danni Moiseyev" <isotop@gmail.com> Cc: "PHP-Gtk General List" <php-gtk-general@lists.php.net> Sent: Wednesday, October 04, 2006 2:52 PM Subject: Re: [PHP-GTK] Printing in windowsDanni - I actually do have a couple of reports in rendered html, but I use the COM into IE for those. The direct printing is for a series of governmental forms we have to produce. I need exact positioning, and we had trouble trying to use PDF - the file format wasn't acceptable on the other end. So, I generate text files, with the first line reserved for the report type, and then use the PHP Printing commands to output them to an associated printer. It works amazingly well, and isn't a printer or memory hog. The only glitch we ever hit was a problem with one of the commands (printer_set_option) and an older LJ 4. Windows went GPF on us. But we replaced the printer with a slightly newer one and all was well. HTH, Madeleine D. Danni Moiseyev wrote::) I guess that means there's no support for printing directly from PHP-GTK on Windows yet. As a hack, you could execute a .bat file with the file path as an argument or something like that from within your PHP code. Cheers, - Anantcan you print out rendered html? i think its the easiest way to "build" up a page . On 10/4/06, Madeleine D. <mmdrake@bctonline.com> wrote:I'm so buried I haven't been able to follow this thread all the way, and I know my email is messed up as well, so I'm probably getting this late- but... I print directly from php-gtk in Windows just fine. Notfancy, but definitely doable. So if someone still needs help, let me know. Otherwise, I'm back to buried. Madeleine D. Anant Narayanan wrote:http://marc.theaimsgroup.com/?l=php-gtk-general&m=107779403115301&w=2Read these threads:http://marc.theaimsgroup.com/?l=php-gtk-general&m=107640839323667&w=2http://marc.theaimsgroup.com/?l=php-gtk-general&m=104345129118381&w=2http://marc.theaimsgroup.com/?l=php-gtk-general&m=104310354207018&w=2-- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php