I’m currently developing an app where you generate a label in format PDF (I store it in base64 on the database), and then I want to print directly that document in a thermal printer (Zebra D420).
I made a really hard research and I tried a lot, but nothing worked for me. I tried integrate with the API of Zebra but they don’t print PDFs throught the API, also tried a couple of cordova plugins but also never achieve to work… Currently I’m trying to print through bluetooth but I’m struggilng to print the PDF instead of plain text.
I just wanted to know if is that hard to print a PDF in a thermal print because when I do it on Chrome is so easy and also Zebra has an applicattion where you can print what ever you want. Why I can’t send a ByteArray or something to the printer through the IP and Port and print? Will be so easy and awesome.
Any ideas to print PDFs in the app to the thermal printer? The easiest way… also if you have any reference project or something.
Well I have the PDF Labels in Base64 so maybe there’s a way to parse them to CPCL or ZPL, I would like to see any examples of what you did to get ideas to resolve my issue or find a way to do it.
Also tell me the plugins you used it. Thanks in advance
Hola Gonzalo,
Al igual que tu, llevo luchando casi 2 semanas con una impresora portable bluetooth ( GOOJPRT )
Y con el cordova-plugin-bluetooth-serial pude conectar y con no poco esfuerzo imprimir un ticket y su código de barras.
Pero el problema es que solo he logrado conectarme con Android de celulares Samsung (… muy raro…)
Intenté subir imagenes, o un PDF pero eso fue imposible, la documentación es pobre y además la gente de IONIC pareciera no estar en la “onda de imprimir”.
Si necesitas ayuda, en lo que pueda ayudar, solo me avisas.
Saludos
Hi Gonzalo,
Like you, I have been struggling for almost 2 weeks with a portable bluetooth printer (GOOJPRT)
And with the cordova-plugin-bluetooth-serial I was able to connect and with no little effort print a ticket and its barcode.
But the problem is that I have only managed to connect with Android from Samsung cell phones (… very strange…)
I tried to upload images, or a PDF but that was impossible, the documentation is poor and also the people at IONIC seem not to be in the “printing wave”.
If you need help, in what I can help, just let me know.
Greetings
Gracias por tu respuesta, al igual que tu llevo peleandome con las impresoras bluetooth un tiempo, intente utilizar el cordova-plugin-bluetooth-serial, pero no me llegó a servir ya que yo necesitaba obligatoriamente imprimir una etiqueta en PDF, mi solución ha sido utilizar este plugin https://github.com/CesarBalzer/Cordova-Plugin-BTPrinter , he conseguido imprimir una imagen pasandola a base64 y llamando al método que tiene de printBase64, te recomiendo probarlo, si tienes algún problema me dices.
I finally achieve it. I found a cordova plugin made by a guy that was so easy to connect to the Bluetooth Printer, then I saw someone forked it and created the functionality of print Base64 format so I decide to try it and I printed my first image in the thermal printer.
Hola jgv66
Ahora mismo estoy en el mismo problema, buscando como imprimir en una Impresora Zebra, pero también no entiendo el porque la gente de IONIC están lejos del estos procesos, si pudieras apoyarme seria de gran ayuda, justo ayer empecé a probar con el plugin cordova-plugin-bluetooth-serial pero estoy un poco perdido ya que no logro imprimir, de antemano muchas gracias.
Gonzalo,
Gracias por tu respuesta. Yo estoy trabajando en Ionic 5 con Capacitor.
¿Cómo lo usas para incorporarlo en tu proyecto ? ¿Algún comando especial ? ¿Tienes algún ejemplo aunque sea básico ?
Saludos y gracias de antenamo
Resulta que las pruebas que yo estaba realizando las hacía en una impresora con BlueTooth normal y funcionaban pero luego cuando fui a probar en la impresora Zebra no me funcionaba y encontré que es porque la impresora que tengo (Zebra ZD420) funciona con Bluetooth LE y al parecer no puedo realizar la conexión por el Socket de Bluetooth normal… Sigo trabajando en ello, puedes echarle un ojo al plugin que está puesto como respuesta si tu impresora contiene Bluetooth normal.
Después de una semana logre imprimir en una ZEBRA ZQ320 con el plugin nativo de IONIC (Bluetooth Serial) ahora solo estoy peleando con el lenguaje ZPL para acomodar el ticket y las imágenes y ver como llevar las variables al ticket, no he confirmado si se puede enviar directo un PDF, que es creo lo que tu requieres pero si por alguna razón lo veo te aviso para que pruebes.
Hola jgv66 estoy intentando implementar la impresion ionic 4 y ya logre imprimir solo texto sin estilo! queria que me ayudaras diciendome como le agregaste el estilo a tus tickets
Hola Albert, me han regalado una impresora Bluetooth LE “GOOJPRT” de 58mm.
He desarrollado una App en Ionic 4 y he conseguido conectar con ella, pero no sé como enviarle información para que la imprima. ¿Podrías ayudarme diciéndome cómo lo hiciste?
Ya estoy un poco desesperado, quisiera saber como lo hiciste, porque yo puedo imprimir texto, codigos de barra, (con el bluetooth-serial) pero necesito imprimir qrCode, una imagen tipo logo. Nada que lo logro, la llibrería que indicas es la que más se parece a lo que necesito, pero no logro utilizar la variable BTPrinter .