views:

1065

answers:

4

Hi!

I have a PHP+MySQL web application to sell ticket in my officess.

I have dotmatrix printer (Panasonic KX-P1050) to print Tickets and bills.

My Ticket size is: 15cm X 25cm.

I want to send some text directly to Dot Matrix printer like Panasonic KXP-1050 without using true type fonts and windows' print dialog. As I know, this means: RAW Printing

Actualy, I can print to dot matrix "graphically", which is built-in in Windows, albeit slower. But I only want to print pure text with simple formattings which is faster than graphical printing.

I want to use this for printing bills or ticket on continuous-form paper.

I can use JavaScript or adobe flash(?) to send text to printer.

Once upon times, There was ActiveX sample for InternetExplorer on this link: http://www.xuebrothers.net/ax/activeprinter/interfaces.htm (now, this link doen't work)

Until now, I use Internet Explorer with that ActiveX & javascript to solve my request. But, now I want my web application can work with Mozilla Firefox. Because Firefox is better than Internet Explorer.

There is a link http://support.microsoft.com/?kbid=322091 that explains "How to send raw data to a printer by using Visual C# .NET"

How can I send raw data to a a printer in Mozilla Firefox?

I only know HTML, Javascript, PHP and MySQL. If solution is hard to understand for me, I can offer some fee for ready-made solution.

Regards, Nuri Akman

+2  A: 

I did this in the past with a Java Applet.

++ Runs on major platforms and browsers

-- Client MUST install Java Runtime

More references:

how to send raw data to printer

PeterMmm
A: 

Just make a page with the content you want using either client or server side proccesing and then use

<body onload="window.print();">...</body>
the_drow
this is not raw. and browsers usually append headers and footers. They can of course be disabled though... still not raw printing. It's still printing graphics.
Robert Koritnik
That's what I would do.
the_drow
A: 

Two suggestions to try

  1. Flash/ActionScript could be superior possibility since it's better (in my opinion) and more widely distributed than Java VM.
  2. Java applets
Robert Koritnik
+1  A: 

You won't be able to do this with Javascript since the browser security model wont let you access hardware devices directly for RAW printing. I'm pretty sure that you can't do this with Flash either since I don't think you can elevate to full trust (and the APIs are OS neutral). If you hosting locally then perhaps you can do this with PHP or your own C++ module server side.

mattcodes
I'm remotely hosting my site, not locally.
Nuri Akman