views:

147

answers:

2

how to print a document using codeigniter PHP printer option without printer dialog box?

+5  A: 

You can't - or at least, you can't in any browser I know of. The best you can do is use some JavaScript to throw up a print dialog, and allow the users to click OK.

This is for good reason - if you could print directly, imagine how many malicious sites would send unsolicited junk to your printer.

Dominic Rodger
A: 

@saranya, I'm using cups to print from a webpage to a thermal printer, our PHP app is running on apache/linux and cups is installed on the server configured to a default thermal printer.

Have a look at http://cups.org

Mark Guadalupe