我正在尝试使用 DocFlavor 打印瑞典语字符,但我无法做到。
我的打印机只支持以下口味。
Win32 Printer : V2PRINTER supports :
image/gif; class="[B"
image/gif; class="java.io.InputStream"
image/gif; class="java.net.URL"
image/jpeg; class="[B"
image/jpeg; class="java.io.InputStream"
image/jpeg; class="java.net.URL"
image/png; class="[B"
image/png; class="java.io.InputStream"
image/png; class="java.net.URL"
application/x-java-jvm-local-objectref; class="java.awt.print.Pageable"
application/x-java-jvm-local-objectref; class="java.awt.print.Printable"
application/octet-stream; class="[B"
application/octet-stream; class="java.net.URL"
application/octet-stream; class="java.io.InputStream"
下面是代码片段
psStream = new FileInputStream("C:\temp.txt");
DocFlavor psInFormat = DocFlavor.INPUT_STREAM.AUTOSENSE;
Doc myDoc = new SimpleDoc(psStream, psInFormat, null);
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
try
{
DocPrintJob job = printer.createPrintJob();
job.print(myDoc, aset);
psStream.close();
}
如果有人遇到同样的问题并有解决方案,请告诉我,由于打印机性能问题,我不想使用 Graphics2d 类。
提前致谢。拉维