oscb / bixolon-printers-plugin

A Phonegap Plugin for Bixolon Printers
MIT License
6 stars 2 forks source link

Image printing #5

Open arieldeil opened 9 years ago

arieldeil commented 9 years ago

Hi,

Can I use this library for printing images (branding logo) ?

BTW, it looks great.

oscb commented 8 years ago

Hi Ariel,

Sadly it doesn't support image printing yet. But since Bixolon's SDK supports it it shouldn't be any hard to add it! I don't have too much time or the devices to test this, but feel free to ping me if you need any help.

PD: Sorry for the super late response

On Mon, Oct 19, 2015 at 6:28 AM, Ariel Deil notifications@github.com wrote:

Hi,

Can I use this library for printing images (branding logo) ?

BTW, it looks great.

— Reply to this email directly or view it on GitHub https://github.com/oscb/bixolon-printers-plugin/issues/5.

Oscar Bazaldúa

Cel. +52 (442) 157919

I write stories! http://oscarbazaldua.com/

i write apps! http://saturn5.com.mx/

ivangutierrezr commented 8 years ago

Hi, anybody know how to print with Bixolon's SDK? i tried with phonegap sample and bxl_service.js but i couldn't make it works. If you can help me I'd be so glad. ty

ykurniawan commented 8 years ago

Hi @ivangutierrezr, you can use this plugin or by using the plugin included in the latest Bixolon SDK (there is a sample project).

ivangutierrezr commented 8 years ago

Hi @ykurniawan ty for your answer. I downloaded latest Bixolon SDK but when I tried to use it, nothing happened. I put the plugin link in my index.html, I called events from Bixolon's plugin as they did in their example and It doesn't worked.

oscb commented 8 years ago

Hi @ivangutierrezr How are you loading the plugin? Can I see your code? Let me look for the code where I used this to help you, can't remember perfectly at the moment if there was something else you need to do in order to make it work.

ivangutierrezr commented 8 years ago

hi @oscb im loading the plugin from index.html like this:

    <script type="text/javascript" src="phonegap.js"></script>
    <script src="plugins/com.bxl.service.phonegap/www/bxl_service.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript">
        app.initialize();
    </script>

It is just how bixolon's phonegap example do this.

I tried with this 2 ways to print:

printBitmap : function() {
        bxl_service.printBitmap(function() {
            alert("printBitmap success");
        }, function(error) {
            alert("printBitmap: " + error);
        }, 2, "img/logo.png", -11, -2);
    },

printBitmap : function() {
        BXLService.printBitmap(function() {
            alert("printBitmap success");
        }, function(error) {
            alert("printBitmap: " + error);
        }, 2, "img/logo.png", -11, -2);
    },

DOesn't matter where I put the plugin, doesn't work,

ykurniawan commented 8 years ago

hi @ivangutierrezr,

Have you bootstrap the plugin in your MainActivity class? example . You need also to put jpos.xml inside ./plugins/com.bxl.service.phonegap/src/android/res/raw which will be copied into platforms/android/res/raw folder. Before you execute one of the print method, your app need to open connection to the printer by using the connection type and hardware address, claim that device, enable it and execute of of the print action.

ivangutierrezr commented 8 years ago

hi @ykurniawan I understand what you mean, but i'm working with javascript, no Java, how can I integrate this?