Page 1 of 1
:!: URGENT - help with php printing!
Posted: Wed Sep 27, 2006 4:55 pm
by jaime281
I'm working on a project that requires to print automatically every time a page loads. The thing is, I need to print to the server printer from the clients browser without any print dialog. Eventually the web based aplication will be used from PDAs.
I've already tried the printer functions but I found them very limited, the reason, the are only printing text and some graphics but the whole document 'javascript:window.print()' style I want.
Is there any component/class/dll/etc out there I should know about?
thanks people.
Re: :!: URGENT - help with php printing!
Posted: Wed Sep 27, 2006 5:06 pm
by volka
php does not have a render engine like browsers do but you may use something like
http://de2.php.net/manual/en/ref.cpdf.php
Posted: Thu Sep 28, 2006 11:20 am
by jaime281
that solution would help me creating pdf documents of what I wanna print, but it wouldn't help me printing directly to the server's printer. I still need a solution. thanks.
I found a PHP Print class in phpclasses.org but I'm not sure if it prints PDF documents. Does anybody know before moving to PHP5?.
Posted: Thu Sep 28, 2006 4:09 pm
by onion2k
I need to print to the server printer from the clients browser without any print dialog
Not sure I understand that. The client's browser isn't connected to any printer connected to the server. That can't be done.
If you want to print to a printer connected to the client's PC then you have two choices. Either use a nasty ActiveX hack to skip the print dialogue box, or use a PDF. The ActiveX hack works, but only on IE. The PDF is more difficult to code, but if you use the FPDF library there's an example of an auto-printing PDF in the samples on the FPDF website (you'll have to google for it, I can't remember the url).
Posted: Thu Sep 28, 2006 4:43 pm
by jaime281
not sure if I made myself clear.....here's the scenario:
1. User logs into the web based system from a PDA (client) within the LAN.
2. User selects print whatever report.
3. The system prints this report automatically in the server's printer...no print dialogs in the PDA browser whatsoever.
I know this can be done using ASP with the ASPPrinter COM
http://www.vbgold.com/index.shtml#ASPPrinterCOM , but I wanna do it using PHP.
I'll check the auto-printing PDF solution...sounds like a good alternative.
Posted: Thu Sep 28, 2006 4:48 pm
by onion2k
As that's a COM object you might be able to use it with PHP. PHP can do COM.
Posted: Thu Sep 28, 2006 5:00 pm
by jaime281
Oh yeah! and it works with simple HTML too...but I'm looking for a multiplatform solution basically...sorry I didn't specify

.