简体   繁体   English

我可以在打印机上使用 FIleOutputStream 进行打印吗

[英]Can i print using FIleOutputStream on a printer

Can i print using FIleOutputStream on a printer?我可以在打印机上使用 FIleOutputStream 进行打印吗?

(I am targeting windows platform particularly win32) For example: (我的目标是 windows 平台,尤其是 win32)例如:

FileOutputStream fos = new FileOutputStream("lpt1");
fos.print("testing testing testing testing...");

Will these two lines be able to print on a printer?这两行可以在打印机上打印吗?

If no, please suggest a method.如果没有,请提出一种方法。

I think the Printing lesson of Java tutorial trail should help you out.我认为Java 教程路径的打印课应该可以帮助你。 Please post specific questions if it doesn't work.如果它不起作用,请发布具体问题。Another link I came across which actually shows you how to "print" a text file, worth a try.我遇到的另一个链接实际上向您展示了如何“打印”文本文件,值得一试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM