Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print QR Code using Simphony Extensibility C#

Status
Not open for further replies.

Milos MNE

Programmer
Oct 14, 2021
10
ME
Hi,

I would like to print QR code on Simphony check. String for QR code is dynamic, not fixed.
I was thiking about using CustomTrailer field in OpsCustomReceiptEvent for that but I couldn't manage to do it.
Does anyone have an idea what should I do?

Thanks!
 
i can do it.

You can put QR code printing commad data into CustomTrailer Data

 
Thank you goodbody.

Can you please share a code?
I've tried with sending the QR in string format that works in PrintLine command in ESC/POS but it didn't work.
 
I'll get the code sorted out, but I've been busy lately and it's going to take some time.
 
Thank you so much! Whenever you find time.

Are you also going to try with a string or something else? Maybe I can figure something out in the meantime.

Btw, the method I've been using is:
Code:
private string PrintQR(string link)
    {
        Encoding m_encoding = Encoding.GetEncoding("iso-8859-1");
        string buffer = "";
        int store_len = (link).Length + 3;
        byte store_pL = (byte)(store_len % 256);
        byte store_pH = (byte)(store_len / 256);
        buffer += m_encoding.GetString(new byte[] { 29, 40, 107, 4, 0, 49, 65, 50, 0 });
        buffer += m_encoding.GetString(new byte[] { 29, 40, 107, 3, 0, 49, 67, 8 });
        buffer += m_encoding.GetString(new byte[] { 29, 40, 107, 3, 0, 49, 69, 48 });
        buffer += m_encoding.GetString(new byte[] { 29, 40, 107, store_pL, store_pH, 49, 80, 48 });
        buffer += link;
        buffer += m_encoding.GetString(new byte[] { 29, 40, 107, 3, 0, 49, 81, 48 });
        return buffer;
    }
 
I can give you some ideas first:
1.You print the QR code must be able to print out in the printer
2.OpsCustomReceiptEvent can print the QR code in the designated place of the receipt, for example, I want to print the QR code at the bottom of the bill

Code:
 private EventProcessingInstruction QRCodeApplication_OpsCustomReceiptEvent(object sender, OpsCustomReceiptEventArgs args)
        {
            byte[] youESCCommand = new byte[] { };
            args.TrailerAction = CustomPrintType.Append;
            var code = Encoding.UTF8.GetString(youESCCommand);
            args.CustomTrailer = (object)new ArrayList(1) { (object)code };
            return EventProcessingInstruction.Continue;
        }
The code to print the qrcode is a bit messy, I'll sort it out when I have time, I think you can google for the answer you're looking for, the more important thing is to give you an idea.
 
There is also a problem, printing QR code in Simphony must use the Ops driver, and I don't know why.
 
Hi goodbody, do I have to enable qr printing on simphony or something like that?
The printer I'm using is EPSON and it prints QR codes but when I try to send a command through extensibility it prints everything up until that command and it stops, it doesn't even cut the paper.

Regards,
Miloš
 
Has Anyone been able to get this to work in Simphony 2? for me the printer stops printing any time an ESC code is sent to it.
Prints a string no issues.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top