locked
Draw QR-Code in the receipt RRS feed

  • Question

  • Dear all,

    I have below code for printing barcode in the receipt. How to do if we are using QR-Code??

    public void Draw(PrintEngine engine, float yPos, Graphics graphics, Rectangle elementBounds)
      {
       Font m_BarcodeFont = new Font(Print_Param.barCodeFont_Name, Print_Param.barCodeFont_Height);
       Brush br = new SolidBrush(Color.Black);

       // the Asterisk (*) used to delimit barcode
       graphics.DrawString("*" + Barcode + "*", m_BarcodeFont, br,
                    elementBounds.Left, yPos, new StringFormat()); 
      }

    • Moved by Jason Dot Wang Friday, September 28, 2012 7:56 AM This thread is not about C# General (From:Visual C# General)
    Tuesday, September 18, 2012 1:39 AM

Answers

All replies

  • Hi Raymond,

    QR Code is quite different than barcode. While in barcode, each character has its own bar pattern and the entire barcode is constructed with these fixed patterns, the QR Code is an encrypted binary matrix of data, there is no certain pattern for a certain character. So while it is possible to represent bar patterns with a barcode font (the code you provided utilized this feature), it is not possible for QR Code. Instead, you need to generate the QR Code yourself, by utilizing GDI+ or something else; or use a QR Code generator library, e.g. the QrCode.Net

    Tuesday, September 18, 2012 2:36 AM
  • Hi Raymond,

      Welcome to MSDN Forum Support.

      I suggest you redirect to  http://qrcodenet.codeplex.com/ for getting more efficient responses to  its issues .

      Sincerely,

      Jason Wang

      

    Jason Wang [MSFT]
    MSDN Community Support | Feedback to us


    Wednesday, September 19, 2012 9:10 AM
  • Here is QR Code generation in C# with sample code. I have no idea if it helps you or not.
    • Marked as answer by Jason Dot Wang Tuesday, September 25, 2012 8:16 AM
    Monday, September 24, 2012 9:00 AM