示例#1
0
        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);
                }
            }
        }
示例#2
0
        private void printNormalButton_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.PrintBitmap(".\\Logo.bmp", 1, 0, 5, 0); // Print Bitmap

            LKPrint.PrintNormal("\x1b|rATEL (123)-456-7890\n\n\n");
            LKPrint.PrintNormal("\x1b|cAThank you for coming to our shop!\n");
            LKPrint.PrintNormal("\x1b|cADate\n\n");
            LKPrint.PrintNormal("Chicken                             $10.00\n");
            LKPrint.PrintNormal("Hamburger                           $20.00\n");
            LKPrint.PrintNormal("Pizza                               $30.00\n");
            LKPrint.PrintNormal("Lemons                              $40.00\n");
            LKPrint.PrintNormal("Drink                               $50.00\n");
            LKPrint.PrintNormal("Excluded tax                       $150.00\n");
            LKPrint.PrintNormal("\x1b|uCTax(5%)                              $7.50\n");
            LKPrint.PrintNormal("\x1b|bC\x1b|2CTotal         $157.50\n\n");
            LKPrint.PrintNormal("Payment                            $200.00\n");
            LKPrint.PrintNormal("Change                              $42.50\n\n");
            LKPrint.PrintBarCode("1234567890", 109, 40, 512, 1, 2); // Print Barcode

            LKPrint.PrintBitmap(".\\LUKHAN-logo.bmp", 1, 0, 5, 1);  // Print Bitmap

            LKPrint.PrintNormal("\x1b|fP");                         // Partial Cut.

            LKPrint.PrintStop();

            if (useprinterdriver)
            {
                lResult = LKPrint.ClosePort();
                if (lResult != 0)
                {
                    MessageBox.Show("ClosePrinter Failed!!!", "Error", MessageBoxButtons.OK);
                }
            }
        }
示例#3
0
        private void printSampleButton_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.PrintNormal("\x1b|cA\x1b|bC\x1b|2CLUKHAN\n");
            LKPrint.PrintNormal("Homepage : http://www.miniprinter.com\n");
            LKPrint.PrintNormal("==========================================\n");
            LKPrint.PrintNormal("Chicken                             $10.00\n");
            LKPrint.PrintNormal("Hamburger                           $20.00\n");
            LKPrint.PrintNormal("Pizza                               $30.00\n");
            LKPrint.PrintNormal("Lemons                              $40.00\n");
            LKPrint.PrintNormal("Drink                               $50.00\n");
            LKPrint.PrintNormal("Excluded tax                       $150.00\n");
            LKPrint.PrintNormal("\x1b|uCTax(5%)                              $7.50\n");
            LKPrint.PrintNormal("\x1b|bC\x1b|2CTotal         $157.50\n\n");
            LKPrint.PrintNormal("Payment                            $200.00\n");
            LKPrint.PrintNormal("Change                              $42.50\n\n");
            LKPrint.PrintNormal("------------------------------------------\n");
            LKPrint.PrintBarCode("1234567890", 109, 40, 512, 1, 2); // POSPrinter
            LKPrint.PrintBitmap(".\\LUKHAN-logo.bmp", 1, 0, 5, 1);

            LKPrint.PrintNormal("\x1b|fP");

            LKPrint.PrintStop();

            if (useprinterdriver)
            {
                lResult = LKPrint.ClosePort();
                if (lResult != 0)
                {
                    MessageBox.Show("ClosePrinter Failed!!!", "Error", MessageBoxButtons.OK);
                }
            }
        }
示例#4
0
        private void printQRCodeGenButton_Click(object sender, EventArgs e)
        {
            // TODO: Add your control notification handler code here
            long   lResult;
            string strQRCodeLeft   = "QRCode Test Left Alignment";
            string strQRCodeCenter = "QRCode Test Center Alignment";

//            string strQRCodeRight = "QRCode Test Right Alignment";


            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.PrintQRCodeGenerator(strQRCodeLeft, 0, 3, 0, 0, -1, LKPrint.LK_ALIGNMENT_LEFT);
            LKPrint.PrintQRCodeGenerator(strQRCodeCenter, 0, 3, 0, 0, -1, LKPrint.LK_ALIGNMENT_CENTER);
            LKPrint.PrintQRCodeGenerator("QRCode Test Right Alignment", 0, 3, 0, 0, -1, LKPrint.LK_ALIGNMENT_RIGHT);
            LKPrint.PrintQRCodeGenerator("SEWOO TECH CO.,LTD%0D%0AR & D Department / Senior Engineer%0D%0AJimmy Oh", 0, 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);
                }
            }
        }
示例#5
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);
                }
            }
        }
示例#6
0
        private void saveQRCodeButton_Click(object sender, EventArgs e)
        {
            // TODO: Add your control notification handler code here
            long   lResult;
            string strQRCodeLeft   = "QRCode Test Left Alignment";
            string strQRCodeCenter = "QRCode Test Center Alignment";
            string strQRCodeRight  = "QRCode Test Right Alignment";


            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.MakeQRCodeBitmap(strQRCodeLeft, 0, 3, 0, 0, -1, ".\\Left.bmp");
            LKPrint.MakeQRCodeBitmap(strQRCodeCenter, 0, 3, 0, 0, -1, ".\\Center.bmp");
            LKPrint.MakeQRCodeBitmap(strQRCodeRight, 0, 3, 0, 0, -1, ".\\Right.bmp");

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