private void printQRCodeFileButton_Click(object sender, EventArgs e) { // TODO: Add your control notification handler code here long lResult; if (useprinterdriver) { m_strPrinter = pDriverNameTextBox.Text.ToString(); lResult = LKPrint.OpenPort(m_strPrinter, 1); if (lResult != 0) { MessageBox.Show("OpenPrinter Failed", "Error", MessageBoxButtons.OK); return; } } LKPrint.PrintStart(); LKPrint.PrintQRCodeFromFile(".\\Email.txt", 3, 0, 0, -1, LKPrint.LK_ALIGNMENT_CENTER); LKPrint.PrintBarCode("1234567890", 109, 40, 512, 1, 2); // POSPrinter LKPrint.PrintNormal("\x1b|fP"); LKPrint.PrintStop(); if (useprinterdriver) { lResult = LKPrint.ClosePort(); if (lResult != 0) { MessageBox.Show("ClosePrinter Failed!!!", "Error", MessageBoxButtons.OK); } } }