SkillAgentSearch skills...

Quickprinter

[Quick Printer] Created for the purpose of serving as a channel among other applications that require printing data on receipt printers using ESC / POS commands.

Install / Use

/learn @diegoveloper/Quickprinter

README

Quick Printer

Android POS Printer (ESC/POS)

Created for the purpose of serving as a channel among other applications that require printing data on receipt printers using ESC/POS commands.

Introduction

Quick printer is an Android application that allows you to add and configure receipt printers (POS printers) through different connection types:

  • Wifi local network
  • Bluetooth
  • USB (OTG)

The most important thing is that it allows you to print the text you share from any application, so you can print your favorite texts.

And if you're a developer, you can integrate your application in a super simple way so you can print tickets, receipts, etc.

The application supports many types of thermal and matrix printers such as EPSON, BIXOLON, STAR MICRONICS, CITIZEN, etc.

Usage

The steps for using the application will be detailed below:

1. Download Quick Printer from the Play Store

Download the app from the Play Store:

👉 Quick Printer on Google Play

<p align="center"> <img src="quickprinter_qr.png" width="200" alt="Quick Printer QR Code"> </p>

Once installed, open the app and configure your printers using the tutorial available inside the app.


Alternative Download

You can also download the latest APK directly from this repository:

👉 Download the latest APK

2. Share Text from any application installed

When the application selection dialog appears, select 'Quick Printer'.  
The selected text will be printed on your previously configured printer.

NON Developers

If you are a user without knowledge of programming, you can use the app just sharing text, try sharing text from any app, like SMS, Whatsapp, Browser(copy the Text you need, NOT the URL), etc.

  • Select the Text
<center><img src="https://www.techadvisor.com/cmsdata/features/3789992/how-to-copy-and-paste-on-android-main2_thumb800.png" width="600"></center>
  • Press SHARE
  • Select Quick Printer

You can use any command from these list: https://github.com/diegoveloper/quickprinter#commands-supported

Developers

If you are a developer and want to integrate your Android application with 'Quick Printer', read the following instructions:

  • Using Sharing Intents

You can share plain text using shared Intents with the appropriate commands, below the simplest example.

       String textToPrint = "Your text here"; 
       Intent intent = new Intent("pe.diegoveloper.printing"); 
        //intent.setAction(android.content.Intent.ACTION_SEND);  
       intent.setType("text/plain"); 
       intent.putExtra(android.content.Intent.EXTRA_TEXT,textToPrint); 
       startActivity(intent); 

When the selection dialog appears, select 'Quick Printer'.

  • Using Sharing Intents with commands

You can specify different printer commands in your sharing text to take advantage of your printer. This is an example of how to use the commands.


       String textToPrint = "<BIG>Text Title<BR>Testing <BIG>BIG<BR><BIG><BOLD>" +
               "string <SMALL> text<BR><LEFT>Left aligned<BR><CENTER>" +
               "Center aligned<BR><UNDERLINE>underline text<BR><QR>12345678<BR>" +
               "<CENTER>QR: 12345678<BR>Line<BR><LINE><BR>Double Line<BR><DLINE><BR><CUT>";  
       Intent intent = new Intent("pe.diegoveloper.printing"); 
       //intent.setAction(android.content.Intent.ACTION_SEND);  
       intent.setType("text/plain");  
       intent.putExtra(android.content.Intent.EXTRA_TEXT,textToPrint);  
       startActivity(intent);  

These commands generate this ticket
<img src="https://raw.githubusercontent.com/diegoveloper/quickprinter/master/receipt_ticket.jpg" width="300"/>

Commands supported

| Command | Description| | ------------ |------------------------------------| |<BR> | breakline| |<SMALL> | small text size| |<MEDIUM1> | medium text size| |<MEDIUM2> | medium text size| |<MEDIUM3> | medium text size| |<BIG> | big text size |<BOLD> | bold text |<LEFT>| text aligned to the left |<RIGHT>| text aligned to the right |<CENTER>| text aligned to center |<UNDERLINE> | text with underline |<NORMAL> | turn off bold and underline |<LINE>| A single line of text |<DLINE>| Double line of text |<LINE0>| A single line of text without breakline |<DLINE0>| Double line of text without breakline |Table Mode| Send your text separated by ;; e.g: Header1;;Header2;;Header3<BR>Item1;;Item2;;Item3 |<CUT>| Cut the paper |<AWAKE>| Ping to the printer (Doesn't print anything, just awake the printer) |<LOGO>| Print the logo configured on your printer |<LOGO2>| (OPTIONAL for some printers) Print the logo configured on your printer |<INVERSE>| Turn on white/black reverse mode |<DRAWER> | Open the cash drawer connected to the printer |<COMMAND> | Use ESC/POS commands to print. Eg: <COMMAND>0x1B,0x40<BR> (premium feature) |<QR>your text<BR> | Print a QR code of your text(premium feature) |<QR-S>your text<BR> | Print a QR (small size) code of your text(premium feature) |<QR-M>your text<BR> | Print a QR (medium size)code of your text(premium feature) |<QR-L>your text<BR> | Print a QR (large size)code of your text(premium feature) |<BARCODE128>your numbers<BR> | Print a Barcode128 of your numbers(premium feature) |<IMAGE>http://url_of_image<BR> | Print an Image from your URL (Default 200x200) |<IMAGE>file:///storage/emulated/0/Download/YourImage.png<BR> | Print an Image from your Local File URL (Default 200x200) |<IMAGEwXh>http://url_of_image<BR> | Print an Image with custom size(w= width,h= height, e.g: <IMAGE300x200>) from your URL (premium feature)

Some examples for Barcode and QR:

      //barcode128
    String commands = "<center><BIG>hello barcode<br>Testing barcode<barcode128>5331698000418<br><cut>";
    
    //qr
    String commands2 = "<center><BIG>hello qr<br>Testing qr<QR>MyName10<br><cut>";
      
    
  • Getting the print result

If you want to get the printing result you should use startActivityForResult instead of startActivity, below is the sample code

Old versions of Android

Call the printer

        Intent intent = new Intent("pe.diegoveloper.printing"); 
        //intent.setAction(android.content.Intent.ACTION_SEND);
        intent.setType("text/plain");
        intent.putExtra(android.content.Intent.EXTRA_TEXT,"your text to print here");
        startActivityForResult(intent,YOUR_REQUEST_CODE);  

Receive the data

        @Override
       protected void onActivityResult(int requestCode, int resultCode, Intent data) {
       // super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == YOUR_REQUEST_CODE){
            if (resultCode == RESULT_OK){
                //Printing is ok
            } else {
                if (data != null) {
                    String errorMessage = data.getStringExtra("errorMessage");  
                    //Printing with error
                }
            }
          }
        }

New versions of Android

Call the printer

        Intent intent = new Intent("pe.diegoveloper.printing"); 
        intent.setType("text/plain");
        intent.putExtra(android.content.Intent.EXTRA_TEXT,"your text to print here");
        myActivityResultLauncher.launch(intent);
       

Receive the data

              
           ActivityResultLauncher<Intent> myActivityResultLauncher = registerForActivityResult(
           new ActivityResultContracts.StartActivityForResult(),
           result -> {
               if (result.getResultCode() == Activity.RESULT_OK) {
                   //Printing is ok

               } else {
                   Intent data = result.getData();
                   if (data != null) {
                       String errorMessage = data.getStringExtra("errorMessage");
                       //Printing with error
                   }
               }
           });
  • Printing on a specific printer by alias

If you want to send the data to a specific printer (replacing printer selection), You can do following the snippet code

       String data = "<PRINTER alias='your_printer_alias'> YOUR CUSTOM DATA <BR><CUT>"; 
       Intent intent = new Intent("pe.diegoveloper.printing"); 
      // intent.setAction(android.content.Intent.ACTION_SEND);
       intent.setType("text/plain");
       intent.putExtra(android.content.Intent.EXTRA_TEXT,data);
       startActivityForResult(intent,YOUR_REQUEST_CODE);  

If you want to print the same commands on multiple printers, you can use multiple alias separated by ,.

       String data = "<PRINTER alias='alias1, alias2, alias3'> YOUR CUSTOM DATA <BR><CUT>";   
  • Printing on a specific printer by group

We introduced groups, now you can add groups and assign it to any printer, so multiple printers can be part of a group (replacing printer selection), You can do following the snippet code

       String data = "<PRINTER group='your_printer_group'>YOUR CUSTOM DATA <BR><CUT>"; 
       Intent intent = new Intent("pe.diegoveloper.printing"); 
      // intent.setAction(android.content.Intent.ACTION_SEND);
       intent.setType("text/plain");
       intent.putExtra(android.content.Intent.EXTRA_TEXT,data);
       startActivityForResult(intent,YOUR_REQUEST_CODE);  
  • Printing your receipt 'n' times

If you want to print your receipt 'n' times, You can do following the snippet code

       String data = "<PRINTER repeat='4'> YOUR CUSTOM DATA <BR><CUT>"; 
       In
View on GitHub
GitHub Stars124
CategoryDevelopment
Updated21d ago
Forks25

Security Score

85/100

Audited on Mar 10, 2026

No findings