Skip to content Skip to sidebar Skip to footer

Server Side Printing In Php 5

How can i print my html file via php script? I just want to run it in background without any prompt. I have read other posts regarding this but still didnt find anything working. I

Solution 1:

here is what i got working :

$html = "testing print";
$handle = printer_open();
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_write($handle, $html);
printer_close($handle);

We require php_printer.dll php extension to make this work in php5. :)

Solution 2:

You can't print html pages with php. Php is a server-side language, it runs on the server.

The printer is on the client's machine. Meaning you'll need a client-side language to accomplish this.

Solution 3:

If you want to print the source code then it should be be doable by writing a program that prints the passed string and then calling it via a system call. On windows it appears to have an extension for that.

If you want to print a rendered version, then you have to know that for that you need some kind of a rendering engine. While not impossible its probably more work than what you want to get into.

Post a Comment for "Server Side Printing In Php 5"