Capacitor print plugin

Hi,
I’m looking for a printer plugin for capacitor.

Am I correct in saying that there is no print plugin for Capacitor?
I’ve searched the forum but only ever found something about cordova printer plugins, never something about capacitor printer plugins.

If I’m wrong, I would be very happy about a few hints.

Thanks

2 Likes

Were you ever able to find a solution? I have been searching for forever it feels like.

Ionic docs keeps pointing to this repo here: awesome-cordova-plugins/printer

However, I haven’t had great success with this plugin. In my case I am trying to print a pdf that was converted to base64.

The awesome-cordova-plugins/printer is based on this cordova-plugin-printer. This plugin has not been updated for quite some time and uses outdated Android libraries. I found a fork of this library, (forked cordova-plugin-printer) that resolved the outdated Android libaries.

I am really hoping capacitor team will make an official plugin to finally replace the cordova printer. Or at least provide some documentation of a workaround of some kind.

:tada: I’ve just published a Capacitor Printer plugin: Capacitor Printer Plugin - Capawesome

Let me know if any feature is missing.

4 Likes

The plugin is nice, is it possible to print directly with complex option

What options do you need? I would like to add them. Best create a feature request on GitHub.

Hi, how to install this plugins?

Here you can find the installation steps: Getting started with Insiders - Capawesome

Please note that this plugin is currently only available as sponsorware.

ok, im not a sponsorware.
But i like prove it is work on sunmi v2 hardware to print in a local printer.
however, i try import the package an when run npm i have error.
use ionic 8 y angular 17.
thankyou!!

Feel free to reach out to the support via support@capawesome.io

Hi I had the same issue, I got awesome cordova plugins printer to work after some issues. For what it is worth I was created a PDF base64 from pdfmake but when I went to print it with the cordova plugin it was just printing a string of text even though it was a base64. Root cause it needs to have appended a like this “base64://”.

After fixing that works a like charm. I am using on Capacitor 6 and Ionic Angular 8 without issues.

Working code below

    pdfMake.createPdf(pdfCreate).getBase64((base64Str) => { 
      this.printer.print("base64://"+base64Str.split('base64,'));
 // or if using straight js => cordova.plugins.printer.print("base64://"+base64Str.split('base64,'))
     });