Custom printing from Firefox (Windows Only)
I have created a .NET Windows Forms component that runs within IE via an <object />
tag and allows me to print to a thermal label printer directly from a web page using the Windows API's to bypass the driver and send raw commands.
This all works, but my customer is now asking for similar functionality from Firefox!
What I need to do is to be able to pass the name of the printer that I want to use (this is configured within the web application) and then pass a string that is to be sent directly to the printer without being intercepted by the driver translation. I can acheive all of this by gaining access to the following Win32 API's (as I currently do from my .NET component)...
- OpenPrinter
- StartDocPrinter
- StartPagePrinter
- WritePrinter
- EndPagePrinter
- EndDocPrinter
- ClosePrinter
I have looked at the options, and as far as I can see the only path available is XPCOM. Can anybody advise me as to whether I have reached the right conclusion before I start down this path as it appears that there is a great deal of work involved in creating an XPCOM extension and I would hate to spend a lot of time on i开发者_运维问答t only to find out that either ...
- There is an easier way
- XPCOM will not do what I want!
Thanks in advance.
BTW: I am not looking to enable the existing .NET component to work in Firefox, I believe that I will have to start from scratch and create a Firefox extension that can be used instead.
精彩评论