.PRN file generation

萝らか妹 提交于 2020-01-14 06:35:06

问题


I want to generate a .prn file using Java.

  1. Is there any java api already available ?
  2. Is there any value in generating a .PRN file now-a-days (Mine is a web based application trying to mimic the existing client/ server application functionality. The current fat client application is pretty old).
  3. If there is no API available whats the strategy to generate the .PRN file ?

回答1:


A PRN is the byte stream which would be sent to the printer to generate the output, and is generated by the printer driver. Postscript printers get PostScript and HP printers usually get PCL etc.

In order to replicate the behaviour you need a compatible driver in the Java Printing Service

http://java.sun.com/javase/technologies/desktop/printing/

See http://www.exampledepot.com/egs/javax.print/pkg.html for some short sample programs, and investigate what printers you have available on the system.




回答2:


A prn file is printer specific; it's just Windows' way of intercepting the output sent to a print for printing later. Regular Java printing can be directed to a file.



来源:https://stackoverflow.com/questions/757004/prn-file-generation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!