0
I have the following problem, I have an application ruby-on-Rails and I need to print labels on a printer that is installed on the client’s computer, as I do to print these labels directly through the browser, send directly to the port?
0
I have the following problem, I have an application ruby-on-Rails and I need to print labels on a printer that is installed on the client’s computer, as I do to print these labels directly through the browser, send directly to the port?
2
You can use this plugin to make the impression on client. Put the folder jre6 in your public and change the code:
function deployQZ() {
var attributes = {id: "qz", code:'qz.PrintApplet.class',
archive:'jre6/qz-print.jar', width:1, height:1};
var parameters = {jnlp_href: 'jre6/qz-print_jnlp.jnlp',
cache_option:'plugin', disable_logging:'false',
initial_focus:'false'};
if (deployJava.versionCheck("1.7+") == true) {}
else if (deployJava.versionCheck("1.6+") == true) {
attributes['archive'] = 'jre6/qz-print.jar';
parameters['jnlp_href'] = 'jre6/qz-print_jnlp.jnlp';
}
deployJava.runApplet(attributes, parameters, '1.5');
}
With this it will be able to list all the printers of the client’s computer and so be able to print whatever you want on them.
However, one requirement is that the client has installed jre 7, and it is necessary to give permission in the java control panel for its java code to be executed.
See the plugin examples to better understand.
I hope it helps
1
The browser does not have direct access to printer, I would solve as follows:
Create a desktop application, which would be installed on the client’s computer.
This app would darlings in a print queue ( database, Rest api, etc. ) and print labels.
Browser other questions tagged javascript ruby-on-rails ruby impression
You are not signed in. Login or sign up in order to post.
You can use the print dialog from the browser?
– Felipe Avelar
No, it is necessary to send directly to the port, because the printer only accepts file . EPL and dispenses with user view.
– Anderson Pierok
You can’t access the printer directly by Javascript.
– bfavaretto
Is there any solution to send directly from the browser the label the server generates?
– Anderson Pierok
Only if you create a plugin pro browser, and the plugin take care of it.
– bfavaretto
Which printer is that? I print to a Zebra GC420 directly from the browser using a page print.I create a page in Bco with only a dynamically generated image of the label, call the print() method and the user already has the printer as default. But we also have an app that queries a print queue and prints as @Alextakitani replies
– Marciano.Andrade
It’s a TLP 2844 printer, but in its own way, it would open the browser print dialog and I wouldn’t like that, I’ll do as @Alextakitani said, thank you.
– Anderson Pierok