Code Monkey home page Code Monkey logo

cordova-plugin-datecs-printer's People

Contributors

bedis-elacheche avatar giorgiofellipe avatar igortrinidad avatar oallanweb avatar rhiroshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-datecs-printer's Issues

Tutorial ou Exemplo

Olá. Tem alguma página com tutorial ou exemplos de como usar o plugin para impressão no cordova com impressora datecs?

It Works

This plugin work on TM P80 Epson already tested!!!

Thanks

Error building with Phonegap-build

The build fails after the recent update:

on config.xml:
<gap:plugin source="npm" name="cordova-plugin-datecs-printer" />

Phonegap Build (Android) shows:
"Error - Some official plugins have to be updated if using PhoneGap >= 4.0.0. Please upgrade the version of any plugins that may include the following file: DatecsPrinter.java"

what are your printers?

This plugin works fine. Thank george. I'm using: 58mm thermal printer. I'm interested to know the other compatible models. what are your printers?

Error for ionic build android

Hi, I'm getting this problem when I'm trying build my app. I have all extras installed in sdk manager.

Error: cmd: Command failed with exit code 1 Error output:
C:\Users\alan.araujo.NT\Desktop\fxd-mobile\platforms\android\src\com\giorgiofellipe\datecsprinter\DatecsSDKWrapper.java:36: error: package android.support.v4.content does not exist
import android.support.v4.content.LocalBroadcastManager;
^
C:\Users\alan.araujo.NT\Desktop\fxd-mobile\platforms\android\src\com\giorgiofellipe\datecsprinter\DatecsSDKWrapper.java:646: error: cannot find symbol
LocalBroadcastManager.getInstance(mWebView.getContext()).sendBroadcastSync(intent);
^
symbol: variable LocalBroadcastManager
location: class DatecsSDKWrapper
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

print image URL lost data

I have image url
var imageBase2 = canvas.toDataURL('image/png');
var image1 = new Image();
image1.src =imageBase2;
How to print image URL by this plugin?, I already print but the result missing some data

Align left and align right on same line

I'm trying to display a text aligned to the left and aligned to right on the same line.
The "|" character is the paper limit.
Something like this:
| XXXX YYYY |

Everytime I try to print, the text is aligned everything to right or left, like:
| XXXXYYYY |

Is it possible to print on same line with 2 alignments? Can you send an example?

Plugin not working on Ionic 2

Hey Giorgio, I installed your awesome plugin on an Ionic 2 project, I am pretty sure it is well installed, but I don't know why it is not working, it is happening either the methods are not being called or are being called but doing nothing, I am calling the methods this way:

( < window > ).DatecsPrinter.listBluetoothDevices(.....)

Connect callback error

estou com problema no connect, mesmo a impressora não estando ligada na hora do connect, o callback error nunca é chamado, poderia me ajudar?

Error while printing text

Hi,

I'm getting the following error when I invoke print function for text

{"errorCode":5,"message":"Error printing","exception":"Broken pipe"}

This my print code

function printSomeTestText() {
window.DatecsPrinter.printText("Print Test!", 'ISO-8859-1',
function() {
alert('print success')
},
function(error) {
console.log(JSON.stringify(error));
}
);
}

Bixolon SPP-R210

Thank you Giorgio Fellipe!! Your plugin worked like a charm for Bixolon SPP-R210 thermal printer and your ionic service saved me a hell lot of time. I owe you a beer mate! :)

The result is not the same origine imaes after printing

There are the problem when i print For example, Ả ả Ã ã Ạ ạ Ắ ắ Ằ ằ Ẻ ẻ Ẽ ẽ Ẹ ẹ Ế ế Ề ề Ể ể Ễ ễ Ệ ệ, etc.
but the result when i print is A a A a A a A a E e E e E.
So I want the result like Ả ả Ã ã Ạ ạ Ắ ắ Ằ ằ Ẻ ẻ Ẽ ẽ Ẹ ẹ Ế ế Ề ề Ể ể Ễ . How t solve it. I use print image method.
when use myImage.arc='img/test.png' it is working but I don't want to save image before print. i want to convert to basse64 and print it,
My code bellow:

function printMyImage() {
var imagedata;
html2canvas([document.getElementById('mainDiv')], {
background:'#fff',
onrendered: function (canvas) {
imagedata = canvas.toDataURL('image/png');
// imagedata = canvas.toDataURL();

          var myImage = new Image();

          myImage.src = imagedata;
          myImage.onload = function () {
            var canvas = document.createElement("canvas");
            canvas.height = 300;
            canvas.width = 200;
            var context = canvas.getContext('2d');
            context.drawImage(myImage, 0, 0);

          //  var imageBase = canvas.toDataURL('image/png').replace(/^data:image\/(png|jpg|jpeg);base64,/, "");
            var imageBase = canvas.toDataURL('image/jpeg').replace(/^data:image\/(png|jpg|jpeg);base64,/, "");
            //var imageBase=canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
            window.DatecsPrinter.printImage(
              imageBase, //base64
              canvas.width,
              canvas.height,
              1,
              function () {
                //printMyBarcode();
              },
              function (error) {
                alert(JSON.stringify(error));
              }
            )
          }
        }
      })
    }

Broadcast Connection Status

Broadcast to JavaScript how the device's connection with the printer is going, if it was lost, if it was connected, reconnected, etc.

Problemas com impressão

Boa tarde, Giorgio. Tudo bem? Estou com problemas aleatórios na impressão. Trabalho com impressão de fichas. Imprimo várias fichas por vez, de diferentes itens. Cada ficha é composta por apenas um conjunto de textos, esses com fontes menores e fontes maiores. Imprimo as fichas sem problemas e perfeitamente. Em algumas combinações de fichas, a impressora começa a imprimir e, de repente, no meio da impressão, a impressora para de imprimir e perde o pareamento com o aplicativo, mantendo apenas o pareamento com o tablet. Ou seja, ela para de imprimir no meio da impressão e a luz azul da impressora Datecs para de imprimir. Isso só acontece em algumas ocasiões e não existe um padrão para acontecer. Já viu algo parecido? Sabe como resolver isso ou debugar o problema com código de erros? Já testei com várias impressoras diferentes e vários tablets/celulares android e o erro continua. Acontece raramente mas acontece. Será que existe um bug relacionado a isso? Obrigado.

Error Code List

Create a list of code errors and messages, to organize them

Problems with accents

Good work Giorgio,

I am Spanish and we have the problem of accents when sending a text to the printer, I already tried UTF-8 and ISO-8859-1, but it prints badly. Is there any way to send encoded and to print the accents correctly?

Thanks!

Bixolon SPP-R200II

We are having trouble trying to establish it using a Bixolon printer. Could you assist us on this? Thank you!

Print QR Codes

Giorgio eu vi que o driver possui impressão de QR Codes mas você não implementou o método, tentei implementar mas não funcionou na impressora que tenho, você chegou a tentar usar?

Estou imprimindo como imagem mas fica bem lenta a impressão, mesmo num tamanho pequeno 1,5cm x 1,5cm.

barcode print MPR-III, not print MLP-2

Hi,
I can print to bluetooth printer with cordova,ionic mobile application,
barcode or text is no problem,
I can print HPRT MPR-III,
but I can not print barcode with HPRT MLP-2 (I can print text MLP-2 but can not barcode),
I received "ok" message but dont print,
What do you think about that problem?

(my test phone is samsung note 5)

Inicializando um projeto Ionic com o cordova-plugin-datects-printer

@giorgiofellipe estou com dúvidas e problemas em relação a escuta dos aparelhos com o broadcaster.

Segundo suas instruções para cordova:

window.broadcaster.addEventListener( "DatecsPrinter.connectionStatus", function(e) {
if (e.isConnected) {
//do something
}
});

Porém para o ionic, eu coloquei:

$window.broadcaster.addEventListener( "DatecsPrinter.connectionStatus", function(e) {
if (e.isConnected) {
//do something
}
});

Porém, quando coloco essa parte no ionic, depois de ter instalado o seu plugin e o plugin do cordova broadcaster, da o seguinte erro:

TypeError: Cannot read property 'addEventListener' of undefined

Poderia me dar um help?

Grato!!!!!

$window.DatecsPrinter is undefined

-I have download cordova-plugin-datecsprinter-example-master and run it, but I got the error $window.DatecsPrinter is undefined.
I already installed plugin cordova-plugin-datecs-printer.
-How to solved it?.
-when I add the code on this website to my ionic project, it has the same problem 'window.DatecsPrinter is undefined'.
Help me please.

Erro ao Usar intelXDK

Giorgio, o plugin parou de funcionar no intelXDK, até 2 dias atrás estava funcionado perfeitamente, estou testando o plugin e hoje não estou mais conseguindo fazer o build, voce fez algumas alterações nos ultimos dias ?

barcode not print

I use below code to print barcode but nothing print. Not show any error. I already test with text it is work.
What am i wrong . Thnaks!
DatecsPrinter.listBluetoothDevices()
.then(function (addresses) {
return DatecsPrinter.connect(addresses[0]);
})
.then(function (success) {
return DatecsPrinter.printBarcode(75, '13132498746313210584982011487');
})
.then(function (success) {
return DatecsPrinter.disconnect();
})
.catch(function (error) {
alert(JSON.stringify(error));
});

Image printing

Hi, i'm trying to print an image, but i don't know how it works properly, can you help me with some example? I'm doing this with simple javascript

Hola, estoy tratando de imprimir una imagen pero no se como hacerlo funcionar, puedes ayudarme con algún ejemplo de como implementarlo? Estoy usando solamente Javascript

Pd: si no hablas ingles, puedes contestarme en español o portugués que yo puedo entender algo.

Encoding types

Hi brother! it's me again haha, sorry.

I'm trying to print some characters in spanish as " ñ " and vowels like " á é í ó ú" with accent. Which econding type accepts your plugin for this? ISO-8859-1 doesn't print that characters...
Thanks and sorry one more time.

Central image

I never had a problem centering the image in the center, with code 1, through the function:
.....
window.DatecsPrinter.printImage(
imageData, //base64
canvas.width,
canvas.height,
1,
......
Now the image is aligned to the left.

Congratulations on the plugin.
Hello

Reduce font size or change font family

I have tried your plugin, printer allow 28 character / each line. But i need to reduce the font size and print the more character in single line. I have tried {h},{s},{w} tag but there is no change. Kindly guide me how to reduce it . {center}tag also not working , {br} only allowed. My bluetooth printer model is "ANALOGICS" and model number is "AET36015". My code is
window.DatecsPrinter.printText("{b}{center}TEST HEADING{/b}{br}");

Setbarcode error

gostaria de ter exemplo de como mandar os seguintes dados (align, small, scale, hri, height) eu não sei como mandar o hri monta um exemplo

Comandos POS / ESC

Teria como colocar comandos POS / ESC para ir direto para a impressora?

Ex: 1B 61 01 para centralizar, 1D 68 50 para altura do código de barras, etc...

Digo isso pois gostaria de personalizar os textos logo após a logo e não consigo aqui.

Dúvida Status Impressora

Olá, primeiramente, parabéns pela contribuição. Estou trabalhando com impressoras datecs também e queria saber se esse plugin que desenvolveu para o cordova consegue recuperar em tempo real e de forma imediata o status "real" da impressora. Estou usando recentemente um plugin cordova para conexões bluetooth onde utilizo o método isConnected() para checar se a impressora está conectada ao dispositivo. Ele funciona bem, mas se eu desligar a impressora e imeditamente chamar esse método isConnected() ele continua retornando que a impressora está conectada. Somente após aproximadamente 5 segundos que este método começa a retornar que a impressora está desconectada. Ou seja, o plugin que uso tem aproximadamente um delay de 5 segundos para atualizar o status da impressora. Gostaria de saber se o plugin que você desenvolveu também tem este problema. Desde já, muito obrigado!

Printed image is always resized

The documentation says printImage function does not resize image but when i use it, image is always resized, even if i specify the exact width and height in the parameters

Plugin not working

Hi, I've created a phonegap app and I'm trying to run it with the phonegap desktop but when I run it in my device it does nothing. Do I have to create the apk and install it for the plugin to work?

Thanks!

Is there a way to handle unspected errors?

Hello, is there a way for the developer to handle unexpected errors such as:
-When the printer turns off during the printing process.
-When printer runs out of paper

Problem after print

  • This one I print from myImage.src ='img/123.png';
    17327987_1249813495072220_1566957633_n
  • this bellow I print from image URL
    var imageconvert=canvas.toDataURL('image/png');
    myImage.src =imageconvert;

17360979_1249813505072219_1293408955_n1

  • Please help me please, how to resolve it I want to print from Image URL, the result should like the first one.
    var imageconvert=canvas.toDataURL('image/png');
    myImage.src =imageconvert;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.