B4J Question JavaScript Printer Help

walterf25

Expert
Licensed User
Longtime User
Hi all, I am still trying to get my cheap printer to work, I have obtained the attached files from the manufacturer, unfortunately my javascript knowledge is very little, How would I go around using this libraries with Abmaterial.

I have the following code so far:
B4X:
        Dim jsval As String = $"var dtPrinter = new LPAPI();
        console.log('Walter Flores');
        var printerNames = dtPrinter.getSupportedPrinters();
        console.log(printerNames);"$
       
        page.ws.Eval(jsval, Null)
        page.ws.Flush

The printer is connected via USB to the PC.

Is that the correct way to call a javascript code?

Attached is also a demo html file where the js scripts are being used, i've renamed it with a .txt extension as I can't load a html file directly, just rename the file to demo.html to see or run the file.

Any help will be greatly appreciated.

Walter
 

Attachments

  • labelprinter.zip
    7 KB · Views: 83
  • demo.html.txt
    12.9 KB · Views: 75
Top