select printer and print html page, without prompt.

Hello all,

I have a big dificulty with printing issue. I allready search the net but the answers i saw can't seem to get it right..
This is for an intranet made in php and works with MsSql. Its not for outside www.
I need to print directly to a network printer an html page without the prompt window, and i need to select the printer.
This can be done from the server side, doesn´t have to be on the client side.

Can anyone give me a good example? I code php but i never worked with php printer functions, and i don't know if works right and if the html code is processed or it just sends text and tags to printer(prints the code instead of the html layout page)

thx in advanced
 
LVL 1
justaphaseAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
JB04Connect With a Mentor Commented:
you can print just about any file in linux including HTML, whether it be from a web bowser or through a desktop environment they will all use a linux application that can also be run from a console, however, if your machine is setup to act as a web server it probably will not have printing capabilities.


I dont know what linux version you use but GNOME usually comes with cups installed by default


http://www.linuxprinting.org/cups-doc.html
0
 
JB04Commented:
what difficulties are you having?



Have you actually looked at the php.net manual

http://php.net/printer
0
 
justaphaseAuthor Commented:
<?php
$handle = printer_open("HP Deskjet 930c");

echo $handle;
?>

Fatal error: Call to undefined function: printer_open() in /home1/acidados/conta/www.altoinfor.pt/site/print/testeprinter.php on line 2

i guess i have to install something on my linux webserver right?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
JB04Commented:
yes right, Call to undefined function means that function is not available, typically this means the extension has not been enabled.


However, the manual says the printr functions are only available under windows:- http://php.net/printer


Please read the user comments at the bottom of that page for possible solutions to this problem
0
 
justaphaseAuthor Commented:
in that user comment says the printing is done by line of command with the command lpr... meaning that it will print plain text only right? :( The html wil be printed as code, with the tags and everything :(
0
 
JB04Commented:
their are a few user comments and Ive not read them all, if your wanting to print HTML documents as they appear I would look into how you print via the command line on your linux machine, you can then use that through PHP somehow using one of either exec() or system() or something like that
0
 
justaphaseAuthor Commented:
via command linux line? i dont find any command in linux to do that? to render a html file to a printer? don't think so...
0
 
justaphaseAuthor Commented:
sorry... its "via linux command line?"... bad sentence..
0
All Courses

From novice to tech pro — start learning today.