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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simphony 19.x+ ISL / SIM equivalent for `FormatRaw`? Or: how do you print QR code data in a trailer?

Status
Not open for further replies.

JimFromCanada

Programmer
Aug 11, 2021
17
0
1
CA
A similar question was asked in thread693-1803978

The older SIM manuals (for RES) have examples for printing QR codes.

The code includes the `FormatRaw` command which "allows a SIM script to send up to 2 Kilobytes of raw (un-altered) data to only IDN, Serial, IP, and Bluetooth printers."

I can't seem to find an equivalent for Simphony. It appears as though it may be possible to write raw byte data via C# / .NET if I created a library, but this approach is lacking in documentation details. I can appreciate having to figure out how to write raw data to a printer in C#, but given the simplicity of the older SIM methods it seems like doing this in .NET is a massively-overkill approach for something seemingly so simple.

TL;DR: is there an equivalent for `FormatRaw` and/or are there examples for how to print a QR code manually for Simphony 19.x+?

For posterity, this is a slightly updated version of the print method from the older docs:

Code:
    // -- 
    // This is used to test the QR-code printing abilities of any given printer
    event INQ : 1
        var qrCodeData: A255
        var qrCodeDataLen : N3
        var rawDataLen: N3

        startprint @CHK
            FORMAT qrCodeData AS "[URL unfurl="true"]https://qrcode.example.com"[/URL]
            qrCodeDataLen = len(qrCodeData) + 3
            rawDataLen = len(qrCodeData) + 48
            FORMATRAW "ABC", 200, chr(127), rawDataLen, ";", \                chr(13), chr(10), \                chr(27), chr(97), chr(1), \                chr(29), chr(40), chr(107), chr(4),             chr(0), chr(49), chr(65), chr(50), chr(0), \                chr(29), chr(40), chr(107), chr(3),             chr(0), chr(49), chr(67), chr(9), \                chr(29), chr(40), chr(107), chr(3),             chr(0), chr(49), chr(69), chr(48), \                chr(29), chr(40), chr(107), chr(qrCodeDataLen), chr(0), chr(49), chr(80), chr(48), qrCodeData, \                chr(29), chr(40), chr(107), chr(3),             chr(0), chr(49), chr(81), chr(48), \                chr(27), chr(64)
            printline "Test QR code START"
            printline "@@ABC@@"
            printline "Test QR code END"
        endprint
    endevent

(Give or take the backslashes and newlines which don't seem to format nicely in the code block.)
 
if you need an extension app that print QR codes contact me cherif@workmanpaymentsystems.com
 
Thank you both for the reply.

I was hoping for a SIM script because it is the most lightweight option and includes the least amount of setup and maintenance overhead.

I'm not overly familiar with OPOS--my understanding is that it's a low-level standard and several printer manufacturers have made their printers compatible with said standard. There are also OPOS drivers that can be installed that theoretically make printers easier to manage at scale when dealing with multiple brands/types/versions of printers. Is that correct?

How would one use OPOS to print a QR code from a SIM script? Or is that not a phrase that even makes sense given the technology? Assume I know nothing about how one uses OPOS from a SIM script (a very safe assumption).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top