I'm working on interfacing a Star TSP100IIIBI printer for a customer which is a raster-only bluetooth printer. Star has an App called "Star PassPRNT" which is supposed to create a URI that you can send HTML to and have it print. The examples they have show it being done with javascript and simply linking it to an anchor link in the document:
When I attempt to submit to "starpassprnt://v1/print/nopreview?size=2..." via job.download2 I get an "Invalid-url" response with no address associated with host name. And yet, on Star's test page they have javascript that is setting the location.uri value to the same value that I am using and the printer prints their test page.
Is there something I need to set to navigate to a non-"http://" address using OkHttp or am I supposed to be using an intent somehow?
JavaScript:
var passprnt_uri;
function createURI() {
passprnt_uri = "starpassprnt://v1/print/nopreview?";
passprnt_uri = passprnt_uri + "back=" + encodeURIComponent(window.location.href);
passprnt_uri = passprnt_uri + "&html=" + encodeURIComponent("<html><head>...</body></html>");
var target = document.getElementById("print");
target.href = passprnt_uri;
}
<html>
<head></head>
<body>
<a href="#" id="print">PRINT</a>
</body>
</html>
When I attempt to submit to "starpassprnt://v1/print/nopreview?size=2..." via job.download2 I get an "Invalid-url" response with no address associated with host name. And yet, on Star's test page they have javascript that is setting the location.uri value to the same value that I am using and the printer prints their test page.
Is there something I need to set to navigate to a non-"http://" address using OkHttp or am I supposed to be using an intent somehow?