从 Firefox 自定义打印(仅限 Windows)
我创建了一个 .NET Windows Forms 组件,该组件通过
这一切都有效,但我的客户现在要求 Firefox 提供类似的功能!
我需要做的是能够传递我想要使用的打印机的名称(这是在 Web 应用程序中配置的),然后传递一个直接发送到打印机而不被驱动程序拦截的字符串翻译。我可以通过访问以下 Win32 API 来实现所有这些(正如我目前从 .NET 组件所做的那样)...
- OpenPrinter
- StartDocPrinter
- StartPagePrinter
- WritePrinter
- EndPagePrinter
- EndDocPrinter
- ClosePrinter
我已经查看了这些选项,据我所知唯一可用的路径是 XPCOM。任何人都可以告诉我在开始这条道路之前我是否已经得出了正确的结论,因为创建 XPCOM 扩展似乎涉及大量工作,而且我不想在上面花费大量时间只是为了发现要么...
- 有一个更简单的方法
- XPCOM 不会做我想做的事!
提前致谢。
顺便说一句:我不希望现有的 .NET 组件能够在 Firefox 中工作,我相信我必须从头开始并创建一个可以使用的 Firefox 扩展。
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 it 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论