All Projects → diegoveloper → quickprinter

diegoveloper / quickprinter

Licence: other
[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.

Projects that are alternatives of or similar to quickprinter

StarPRNT-SDK-iOS-Swift
StarPRNT SDK for iOS including libraries for supporting application development for Star printers.
Stars: ✭ 24 (-75.76%)
Mutual labels:  printer, receipt-printer, pos-printers
escpos-coffee
Java library for ESC/POS printer
Stars: ✭ 172 (+73.74%)
Mutual labels:  escpos, receipt-printer, escpos-printer
ESCPOS
A ESC/POS Printer Commands Helper
Stars: ✭ 26 (-73.74%)
Mutual labels:  printer, escpos, esc-pos
Escpos Php
PHP library for printing to ESC/POS-compatible thermal and impact printers
Stars: ✭ 1,851 (+1769.7%)
Mutual labels:  printer, escpos, receipt-printer
Vip.Printer
Biblioteca para realizar impressões (impressora não fiscal) utilizando comandos Esc/Bema, Esc/Daruma e Esc/Pos 🚀
Stars: ✭ 48 (-51.52%)
Mutual labels:  printer, escpos, escpos-printer
posprinterdriver
Android ESC/POS Printer Driver (https://play.google.com/store/apps/details?id=com.fidelier.posprinterdriver) usage notes
Stars: ✭ 61 (-38.38%)
Mutual labels:  escpos, pos-printers
python-escpos
Fork of https://code.google.com/p/python-escpos/
Stars: ✭ 27 (-72.73%)
Mutual labels:  printer, escpos
escpos-xml
JavaScript library that implements the thermal printer ESC / POS protocol and provides an XML interface for preparing templates for printing.
Stars: ✭ 37 (-62.63%)
Mutual labels:  printer, escpos
escper
Ruby gem for printing of images and text on one or many thermal printers
Stars: ✭ 67 (-32.32%)
Mutual labels:  ticket, escpos
electron-pos-printer
Electron-pos-printer is a plugin that works to ease paper formatting and printing to thermal printers. it currently supports 80mm, 78mm, 76mm, 58mm, 57mm and 44mm printers thermal printers. it is built with Electron.js and Node.js
Stars: ✭ 198 (+100%)
Mutual labels:  printer, pos-printers
escpos-coffee-samples
anastaciocintra.github.io/escpos-coffee
Stars: ✭ 29 (-70.71%)
Mutual labels:  escpos, escpos-printer
photon
Light as transmission medium between smartphones
Stars: ✭ 19 (-80.81%)
Mutual labels:  android-application
TextSelectionWebSearch
Add web search to text selection toolbar on Android
Stars: ✭ 34 (-65.66%)
Mutual labels:  android-application
motionEye app HomeSurveillanceSystem
git repo for motionEye app - Home Surveillance System, available on Google Play Store
Stars: ✭ 22 (-77.78%)
Mutual labels:  android-application
dawebmail
Application for Zimbra Email Service
Stars: ✭ 24 (-75.76%)
Mutual labels:  android-application
awesome-android
A curated list of awesome open source Android applications, tutorials and resources.
Stars: ✭ 524 (+429.29%)
Mutual labels:  android-application
AndroidTVMovieParadise
Movie Paradise is an Android TV 📺 app. ExoPlayer, Dagger 2, RxJava libraries are used.
Stars: ✭ 68 (-31.31%)
Mutual labels:  android-application
Qr-Code-Scanner-
This is simple QR code scanner with Room Database. 100% written in Kotlin.
Stars: ✭ 19 (-80.81%)
Mutual labels:  android-application
ansible-cups
Ansible role to install and configure CUPS, assist with installing PPDs and install printers/classes
Stars: ✭ 20 (-79.8%)
Mutual labels:  printer
tiket
TIKET is a ticketing/helpdesk system to support and help you deal with issues/incidents in your organization or from customers.
Stars: ✭ 59 (-40.4%)
Mutual labels:  ticket

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 playstore here

Configure your printers using the Tutorial inside de app.

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

  • 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

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
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: 0x1B,0x40
(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

       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);  
       
          @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
               }
           }
       }
   }
  • 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>"; 
       Intent intent = new Intent("pe.diegoveloper.printing");
       intent.setType("text/plain");
       intent.putExtra(android.content.Intent.EXTRA_TEXT,data);
       startActivityForResult(intent,YOUR_REQUEST_CODE);  
  • Another useful commands

If you want to receive some data from Quick Printer without prints anything, you can use these commands.

  • Get the alias List

       String data = "<PRINTER alias_list>"; 
       Intent intent = new Intent("pe.diegoveloper.printing");
       intent.setType("text/plain");
       intent.putExtra(android.content.Intent.EXTRA_TEXT,data);
       startActivityForResult(intent,YOUR_REQUEST_CODE);  
  • Get the group List

       String data = "<PRINTER group_list>"; 
       Intent intent = new Intent("pe.diegoveloper.printing");
       intent.setType("text/plain");
       intent.putExtra(android.content.Intent.EXTRA_TEXT,data);
       startActivityForResult(intent,YOUR_REQUEST_CODE);  
  • Avoid printing Dialog

       String data = "<PRINTER avoid_dialog>"; 
       Intent intent = new Intent("pe.diegoveloper.printing");
       intent.setType("text/plain");
       intent.putExtra(android.content.Intent.EXTRA_TEXT,data);
       startActivityForResult(intent,YOUR_REQUEST_CODE);  
  • Avoid error dialog when the printer fails

       String data = "<PRINTER avoid_error_button>"; 
       Intent intent = new Intent("pe.diegoveloper.printing");
       intent.setType("text/plain");
       intent.putExtra(android.content.Intent.EXTRA_TEXT,data);
       startActivityForResult(intent,YOUR_REQUEST_CODE);  

Learn how to receive the data: https://github.com/diegoveloper/quickprinter#getting-the-print-result

  • Print from web

You can print directly from your website using schemas, for example if you want to print the following commands:

        String commands = "test printer<br><big>Big title<br><cut>";

You have to write this on your web page:

   <script>
function sendToQuickPrinter(){
    var text = "test printer<br><big>Big title<br><cut>";
    var textEncoded = encodeURI(text);
    window.location.href="quickprinter://"+textEncoded;
}

//if you are using latest version of chrome browser I recommend to use:
function sendToQuickPrinterChrome(){
    var text = "test printer<br><big>Big title<br><cut>";
    var textEncoded = encodeURI(text);
    window.location.href="intent://"+textEncoded+"#Intent;scheme=quickprinter;package=pe.diegoveloper.printerserverapp;end;";
    
}
</script>

<a onclick="sendToQuickPrinter();">Print Button</a>

All you need to do is specify the quickprinter schema:// followed by the encoded data (you could use encodeURI method from javascript) you want to print. If you are using Apache Cordova and want to print from web, You must add this line on your config.xml file :

 <allow-intent href="quickprinter://*" />

Testing printer from your chrome browser (Open this link from your android phone) https://quickprinter-d2410.firebaseapp.com/

  • AppInventor Integration

If you want to communicate AppInventor with QuickPrinter , you have to use these configuration:

Action: pe.diegoveloper.printing
DataType: text/plain
ExtraKey: android.intent.extra.TEXT
ExtraValue: your text to print
  • Advance options (Premium features)

If you are suscribed to the 'Quick Printer' application, you can use this advanced options

       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,etPrinterText.getText().toString());
       //premium features
       intent.putExtra("config_error_dialog",false); 
       intent.putExtra("config_color_background_dialog","#0000ff");
       intent.putExtra("config_color_text_dialog","#00ff00");
       intent.putExtra("config_text_dialog","Loading...");
       startActivityForResult(intent,YOUR_REQUEST_CODE);
Option Value Description
config_error_dialog (true/false) Default value is 'true', you can send 'false' if you don't want the 'Quick Printer' app handle the error if exists
config_color_background_dialog Color in hexadecimal Background color of the Printing dialog
config_color_text_dialog Color in hexadecimal Text color of the Printing dialog
config_text_dialog Text Text of the Printing dialog

NOTE: 'QR' command and these options are only availables for Premium Version. Free version print a message at the end of the ticket.

  • Buy a big number of licenses or unlimited licenses

    If you want to buy a big number of licenses and you don't want to your customers pay for them, please contact me.

  • Integrate Printer Driver directly in your code

'Quick Printer' is an app that is using a library developed by me. If you want integrate the library directly in your project, please contact me.

Demo Integration (Android Sample Project)

Link: https://github.com/diegoveloper/quickprinter-integration

Download the latest version of Quick Printer here

Contact me

Diego Velásquez López

Mobile Developer expert from Peru, author of the 'Quick Printer' and the library used by the app.
[email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].