Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

Unable to generate QR Code using POS Print Utility

Posted on by
sender.PrintBarcode(getQR(), 0, 0, 'QRCODE', 2);

FieldValue[1] := 'Scan this QR code to give us feedback';
sender.PrintLine(Tray, sender.FormatLine(sender.FormatStr(FieldValue, DSTR1), false, false, false, false));
NodeName[1] := 'Feedback Message';
sender.AddPrintLine(250, 1, NodeName, FieldValue, DSTR1, false, false, false, false, Tray);
The getQR method is:

local procedure getQR(): Text
    var
        Base64Convert: Codeunit "Base64 Convert";
        TempBlob: Codeunit "Temp Blob";
        Client: HttpClient;
        Response: HttpResponseMessage;
        Instr: InStream;

        URL: Text;
        TypeHelper: Codeunit "Type Helper";
    begin
        URL := 'https://....';

        Client.Get('barcode.tec-it.com/barcode.ashx' + TypeHelper.UrlEncode(URL) + '&code=QRCode', Response);
        TempBlob.CreateInStream(Instr);
        Response.Content().ReadAs(Instr);

        EncodeStr := Base64Convert.ToBase64(Instr);
        exit(URL);
    end;


I'm not able to generate QR Code. By using the print Barcode method from POS PRINT Utility codeunit. I've called the method from event OnBeforePrintKotLine. And I want to print the QR Code in Kot.

I tried saving QR image by downloading it from online websites and use PrintBitmap instead of PrintBarcode. But that didn't work. Can anyone help me with this. I also don't have ID Automation License.

PS: The sender refer to "LSC Print POS Utility" Codeunit.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans