Example #1
0
        private void printPDF417Button_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.PrintString("PDF417 Column=8, Cell Width=2\n");
            LKPrint.PrintPDF417("0123456789", 0, 8, 2, 1);
            LKPrint.PrintString("PDF417 Column=8, Cell Width=3\n");
            LKPrint.PrintPDF417("0123456789", 0, 8, 3, 1);
            LKPrint.PrintString("PDF417 Column=4, Cell Width=2\n");
            LKPrint.PrintPDF417("0123456789", 0, 4, 2, 2);
            LKPrint.PrintString("PDF417 Column=4, Cell Width=3\n");
            LKPrint.PrintPDF417("0123456789", 0, 4, 3, 2);

            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);
                }
            }
        }