when system know user are setting the -w: 16, system will automatically set -f: to 29,33, 34. this means for some machine, 29,33,34 will also set the font to a super large one.
--
Sam 12:36 28/09/2017
|
Epson printer command set, how to make font bigger?
for 针孔打印机,we an use 28,33,110,to make the Chinese character also double width double height. (110 can also be 0xd6,0xd0,not tested yet) for ronta 针孔打印机,目前最佳的宽度是-w:20, 而不是默认的24.
--
Sam 09:14 29/09/2017
|
昨天给chrome的快捷方式加了参数,好像是" --koisk -printing“,具体记不得了。最后好像是成功了,之前有犯两个错误,一个是--写成了一个-; 另一个错误是在window.print()之后立即调用了一个页面跳转方法,wondlow.location=../dashboard。导致没有效果。 我的想法:
--
Sam 06:31 01/06/2017
|
打印机抵档的只有4k内存,用C语言对端口编程。高档一点的用c语言对端口进行tcp/ip编程,使支持网络通讯。 高档打印机可能会带系统,从而可以跑应用程序服务器,并提供共多功能。 目前大概只有Epson等大厂支持了websocket,国内小厂尚无人支持。
--
Sam 01:53 31/05/2017
|
This is the code I wrote 10 years ago for a pos machine, it shows how to use the command to drive the pos printer. private void printInvoice(String pDate){ CommPortIdentifier tPortIdty; try{ Enumeration tPorts = CommPortIdentifier.getPortIdentifiers(); if(tPorts == null){ JOptionPane.showMessageDialog(this, "no comm ports found!"); return; } while (tPorts.hasMoreElements()){ tPortIdty = (CommPortIdentifier) tPorts.nextElement(); if(!tPortIdty.getName().equals("LPT1")) continue; if (!tPortIdty.isCurrentlyOwned()){ ParallelPort tParallelPort = (ParallelPort) tPortIdty.open("ParallelBlackBox",2000); DataOutputStream tOutStream = new DataOutputStream(tParallelPort.getOutputStream()); tOutStream.write(27); //打印机初始化: tOutStream.write(64); char[] tTime = pDate.toCharArray(); //输出日期时间 输出操作员工号 for(int i = 0; i < tTime.length; i++) tOutStream.write(tTime[i]); tOutStream.write(13); //回车 tOutStream.write(10); //换行 tOutStream.write(10); //进纸一行 tOutStream.write(28); //设置为中文模式: tOutStream.write(38); String tContent = ((String)CustOpts.custOps.getValue(PosDlgConst.PrintTitle)).concat("\n"); for(int i = 0, len = getUsedRowCount(); i < len; i++){ //遍历有效行。 tContent = tContent.concat((String)tblContent.getValueAt(i, 1)).concat("\n"); //再取出品名 tContent = tContent.concat((String)tblContent.getValueAt(i, 3)).concat(" "); //再取出单价 tContent = tContent.concat((String)tblContent.getValueAt(i, 2)).concat(" "); //再取出数量 tContent = tContent.concat((String)tblContent.getValueAt(i, 4)).concat("\n"); //再取出小计 } for(int i = 0; i < 4; i++)//换行 tContent = tContent.concat("\n"); tContent = tContent.concat(PosDlgConst.SumTotal); tContent = tContent.concat(tfdShoudReceive.getText()); tContent = tContent.concat(PosDlgConst.Unit).concat(" ");//总计 tContent = tContent.concat(PosDlgConst.Receive); tContent = tContent.concat(tfdActuallyReceive.getText()); tContent = tContent.concat(PosDlgConst.Unit).concat("\n");//收银 tContent = tContent.concat(PosDlgConst.Change); tContent = tContent.concat(tfdChange.getText()); tContent = tContent.concat(PosDlgConst.Unit);//找零 tContent = tContent.concat("\n\n ").concat((String)CustOpts.custOps.getValue(PosDlgConst.Thankword)); tContent = tContent.concat("\n\n"); Object tEncodType = CustOpts.custOps.getValue(PosDlgConst.EncodeStyle); if(tEncodType == null) tEncodType = "GBK"; if(!Charset.isSupported(tEncodType.toString())) return; BufferedWriter tWriter = new BufferedWriter(new OutputStreamWriter(tOutStream, tEncodType.toString())); tWriter.write(tContent); tWriter.close(); tOutStream.close(); tParallelPort.close(); } } }catch(PortInUseException e){ e.printStackTrace(); }catch(IOException e){ e.printStackTrace(); } }
--
Sam 06:22 19/05/2017
|