C# C OPOS在旋转收据上的位图旁边打印
此问题与热敏收据打印机有关。我下载了爱普生OPOS收据打印示例,试图在我当前的项目中实现这样一个打印机,一切都很好,但当我打印位图徽标时,它下面会打印连续的文本,我需要在它的右侧打印一些文本。下面是它现在所做工作的近似值: 这就是我需要它做的: 我当前的代码与爱普生的示例非常相似:C# C OPOS在旋转收据上的位图旁边打印,c#,printing,receipt,opos,pos,C#,Printing,Receipt,Opos,Pos,此问题与热敏收据打印机有关。我下载了爱普生OPOS收据打印示例,试图在我当前的项目中实现这样一个打印机,一切都很好,但当我打印位图徽标时,它下面会打印连续的文本,我需要在它的右侧打印一些文本。下面是它现在所做工作的近似值: 这就是我需要它做的: 我当前的代码与爱普生的示例非常相似: private void btnReceipt_Click(object sender, System.EventArgs e) { //<<<step8>>>--Star
private void btnReceipt_Click(object sender, System.EventArgs e)
{
//<<<step8>>>--Start
//Initialization
DateTime nowDate = DateTime.Now; //System date
DateTimeFormatInfo dateFormat = new DateTimeFormatInfo(); //Date Format
dateFormat.MonthDayPattern = "MMMM";
string strDate = nowDate.ToString("MMMM,dd,yyyy HH:mm",dateFormat);
int iRecLineSpacing;
int iRecLineHeight;
bool bBuffering = true;
bool bBitmapPrint = false;
int iPrintRotation = 0;
string strCurDir = Directory.GetCurrentDirectory();
string strFilePath = strCurDir.Substring(0,
strCurDir.LastIndexOf("Step8") + "Step8\\".Length);
strFilePath += "bitmap_logo.bmp";
Cursor.Current = Cursors.WaitCursor;
Rotation[] arBitmapRotationList = m_Printer.RecBitmapRotationList;
Rotation[] arBarcodeRotationList = m_Printer.RecBarCodeRotationList;
//Check rotate bitmap
for (int i = 0; i < arBitmapRotationList.Length; i++)
{
if (arBitmapRotationList[i].Equals(Rotation.Left90))
{
bBitmapPrint = true;
iPrintRotation = (iPrintRotation | (int)PrintRotation.Left90)
| ((int)PrintRotation.Bitmap);
}
}
iRecLineSpacing = m_Printer.RecLineSpacing;
iRecLineHeight = m_Printer.RecLineHeight;
if (m_Printer.CapRecPresent == true)
{
try
{
m_Printer.TransactionPrint(PrinterStation.Receipt, PrinterTransactionControl.Transaction);
m_Printer.RotatePrint(PrinterStation.Receipt, (PrintRotation)iPrintRotation);
if (bBitmapPrint == true)
{
m_Printer.PrintBitmap(PrinterStation.Receipt, strFilePath, m_Printer.RecLineWidth, PosPrinter.PrinterBitmapCenter);
}
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|4C" + "\u001b|bC" + " Receipt ");
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|3C" + "\u001b|2uC" + " Mr. Brawn\n");
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|2uC" + " \n\n");
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|2uC" + "\u001b|3C" + " Total payment $" +"\u001b|4C" + "21.00 \n");
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|1C\n" );
m_Printer.PrintNormal(PrinterStation.Receipt,strDate + " Received\n\n");
m_Printer.RecLineHeight = 24;
m_Printer.RecLineSpacing = m_Printer.RecLineHeight;
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|uC" + " Details \n");
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|1C" + " " + "\u001b|2C" + "OPOS Store\n");
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|uC" + " Tax excluded $20.00\n");
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|1C" + " " + "\u001b|bC" + "Zip code 999-9999\n");
m_Printer.PrintNormal(PrinterStation.Receipt,"\u001b|uC" + " Tax(5%) $1.00" + "\u001b|N" + " Phone#(9999)99-9998\n");
}
catch(PosControlException ex)
{
if(ex.ErrorCode == ErrorCode.Illegal && ex.ErrorCodeExtended == 1004)
{
MessageBox.Show("Unable to print receipt.\n", "Printer_SampleStep8", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// Clear the buffered data since the buffer retains print data when an error occurs during printing.
m_Printer.ClearOutput();
bBuffering = false;
}
}
try
{
m_Printer.RotatePrint(PrinterStation.Receipt, PrintRotation.Normal);
if(bBuffering == true)
{
m_Printer.PrintNormal(PrinterStation.Receipt, "\u001b|fP");
}
m_Printer.TransactionPrint(PrinterStation.Receipt, PrinterTransactionControl.Normal);
}
catch(PosControlException)
{
// Clear the buffered data since the buffer retains print data when an error occurs during printing.
m_Printer.ClearOutput();
}
}
m_Printer.RecLineSpacing = iRecLineSpacing;
m_Printer.RecLineHeight = iRecLineHeight;
Cursor.Current = Cursors.Default;
//<<<step8>>>--End
}
如果有一种方法可以进行绝对文本定位,或者能够写入位图所在的同一行,那么就可以解决我的问题。任何指示,谢谢 请询问爱普生是否可以使用一套RotatePrint打印您想要的版式
作为替代,考虑把它分成两组旋转打印。< /P> 如果第一组RotatePrint带有位图和其他一些文本,第二组RotatePrint带有示例文本1到示例文本3,则它将接近所需的布局
此外: 爱普生OPOS似乎支持页面模式,所以你能打印它吗至于,请通过谷歌翻译等查看。我认为这种方式将无法达到旋转打印的目的,因为其他一些文本部分将在第二个旋转打印部分被切掉,我希望它非常长。你知道有没有一种可以联系他们的方法?正如你所指出的,其他一些文本部分是分开的。因为这是不可避免的,你需要设计一个布局,这样它就不会难看。当我在manufacturernot EPSON工作时,我收到了一个类似的问题,我的回答如上所述。请从爱普生的支持页面向联系人地址发送电子邮件,或注册为用户并获得支持。每个型号的触点都是分开的,例如,TM-T88V是。用户注册将是其中之一。