Skip to main content

Notifications

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans