Reputation: 10224
Is it possible to send an IPP Print request from the browser using ajax?
I assume it would look something like this:
// Data to be sent
var data = "Testing\nTesting\n1\n2\n3";
// Jquery AJAX call
$.ajax("ipp://<printerip>:631", {
'type': 'POST',
'data': data,
'complete': function(jqXHR, textStatus){
alert('Result:'+textStatus)
}
});
The only problem is I get:
XMLHttpRequest cannot load ipp://<printerip>:631.
Cross origin requests are only supported for HTTP.
Is there anyway to get around this? Or is this simply impossible?
Upvotes: 3
Views: 4079
Reputation: 1124
There's a pure JavaScript IPP implementation available at https://www.npmjs.com/package/ipp (not sure if it runs in browsers)
Answer: It's not possible to send an IPP request using ajax.
Upvotes: 3
Reputation: 156
There are chrome extensions which can trigger IPP Print. As chrome doesn't provide any API specific for this, I assume it is possible to trigger IPP printer by Frontend technology alone.
Upvotes: 0