Access local printer

Asked

Viewed 1,190 times

0

I have the following problem, I have an application 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?

  • 1

    You can use the print dialog from the browser?

  • No, it is necessary to send directly to the port, because the printer only accepts file . EPL and dispenses with user view.

  • 1

    You can’t access the printer directly by Javascript.

  • Is there any solution to send directly from the browser the label the server generates?

  • Only if you create a plugin pro browser, and the plugin take care of it.

  • 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

  • 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.

Show 2 more comments

2 answers

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

You are not signed in. Login or sign up in order to post.