用Java创建虚拟打印机 [英] Create a virtual printer in Java

查看:179
本文介绍了用Java创建虚拟打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Java创建一个虚拟打印机,这样当你打印文件(使用Word或其他东西)时,Java打印机就会被列为有效的打印机。我的目标是获得程序(Word等)直接发送到打印机的打印机格式化对象。我不知道这是否可行。对于这个问题,这似乎是一个更合乎逻辑的解决方案:

I would like to create a virtual printer using Java, so that when you go to print a file( using Word or something) the Java printer is listed as a valid printer. My goal is to get the printer formatted object that the programs (Word, etc..) send directly to the printer. I don't know if this is possible. It seemed like a more logical solution to this question:

使用java打印多种文件类型

有什么想法吗?我听说这只能使用C或C ++,但我不确定。

Any ideas? I heard this is only possible using C or C++, but I don't know for sure.

推荐答案

有一个LPD实现以Java提供。然后,您可以在Windows中手动创建一台使用LPR协议打印到所述Java LPD的打印机。这会将结果捕获为字节流,然后您可以进一步操作。

There is a LPD implementation available in Java. You can then create manually a printer in Windows which use the LPR protocol to print to said Java LPD. This captures the result as a byte stream which you can then manipulate further.

这篇关于用Java创建虚拟打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆