///
/// ESC/P 指令
///
/// 0:退纸命令 1:进纸命令 2:换行命令
public void PrintESC(int iSelect)
{
string send;
iHandle = CreateFile(prnPort, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
if (iHandle.ToInt32() == -1)
{
MessageBox.Show("没有连接打印机或者打印机端口不是LPT1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
fs = new FileStream(iHandle, FileAccess.ReadWrite);
}
byte[] buf = new byte[80];
switch (iSelect)
{
case 0:
send = "" + (char)(27) + (char)(64) + (char)(27) + 'j' + (char)(255); //退纸1 255 为半张纸长
send = send + (char)(27) + 'j' + (char)(125); //退纸2
break;
case 1:
send = "" + (char)(27) + (char)(64) + (char)(27) + 'J' + (char)(255); //进纸
break;
default:
send = "" + (char)(27) + (char)(64) + (char)(12); //换行
break;
}
http://blog.csdn.net/pfworld/article/details/2084666
你说得好有道理,我竟无言以对o(╯□╰)o
什么叫退一下纸?