From 5ef12cd82093037f42fa56207d06801d05e29d01 Mon Sep 17 00:00:00 2001 From: Victman13 <132633708+Victman13@users.noreply.github.com> Date: Thu, 4 May 2023 22:04:51 -0600 Subject: [PATCH] Delete README.md --- README.md | 380 ------------------------------------------------------ 1 file changed, 380 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 79debbc..0000000 --- a/README.md +++ /dev/null @@ -1,380 +0,0 @@ -# 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](https://play.google.com/store/apps/details?id=pe.diegoveloper.printerserverapp "Quick Printer")__ - -
- 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. - ```java - 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. - ```java - - String textToPrint = "Text Title
Testing BIG
" + - "string text
Left aligned
" + - "Center aligned
underline text
12345678
" + - "
QR: 12345678
Line

Double Line

"; - 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| - | ------------ |------------------------------------| - |`
` | breakline| - |`` | small text size| - |`` | medium text size| - |`` | medium text size| - |`` | medium text size| - |`` | big text size - |`` | bold text - |``| text aligned to the left - |``| text aligned to the right - |`
`| text aligned to center - |`` | text with underline - |`` | turn off bold and underline - |``| A single line of text - |``| Double line of text - |``| A single line of text without breakline - |``| Double line of text without breakline - |`Table Mode`| Send your text separated by ;; e.g: Header1;;Header2;;Header3
Item1;;Item2;;Item3 - |``| Cut the paper - |``| Ping to the printer (Doesn't print anything, just awake the printer) - |``| Print the logo configured on your printer - |``| (OPTIONAL for some printers) Print the logo configured on your printer - |``| Turn on white/black reverse mode - |`` | Open the cash drawer connected to the printer - |`` | Use ESC/POS commands to print. Eg: 0x1B,0x40
(premium feature) - |`your text
` | Print a QR code of your text(premium feature) - |`your text
` | Print a QR (small size) code of your text(premium feature) - |`your text
` | Print a QR (medium size)code of your text(premium feature) - |`your text
` | Print a QR (large size)code of your text(premium feature) - |`your numbers
` | Print a Barcode128 of your numbers(premium feature) - |`http://url_of_image
` | Print an Image from your URL (Default 200x200) - |`file:///storage/emulated/0/Download/YourImage.png
` | Print an Image from your Local File URL (Default 200x200) - |`http://url_of_image
` | Print an Image with custom size(w= width,h= height, e.g: ``) from your URL (premium feature) - - Some examples for Barcode and QR: - ```java - //barcode128 - String commands = "
hello barcode
Testing barcode5331698000418
"; - - //qr - String commands2 = "
hello qr
Testing qrMyName10
"; - - - ``` - - -* ### 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 - -```java - 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 - -```java - @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 - -```java - 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 - - ```java - - ActivityResultLauncher 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 - ```java - String data = " YOUR CUSTOM DATA
"; - 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 `,`. - ```java - String data = " YOUR CUSTOM DATA
"; - ``` - -* ### 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 - ```java - String data = "YOUR CUSTOM DATA
"; - 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 - ```java - String data = " YOUR CUSTOM DATA
"; - Intent intent = new Intent("pe.diegoveloper.printing"); - intent.setType("text/plain"); - intent.putExtra(android.content.Intent.EXTRA_TEXT,data); - startActivityForResult(intent,YOUR_REQUEST_CODE); - ``` - -* ### Other useful commands - -If you want to receive some data from Quick Printer without prints anything, you can use these commands. - -* #### Get the alias List - - ```java - String data = ""; - 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 - - ```java - String data = ""; - 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 - - ```java - String data = ""; - 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 - - ```java - String data = ""; - 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: - ```java - String commands = "test printer
Big title
"; - ``` - You have to write this on your web page: - ```html - - -Print Button - ``` - 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 : - ```html - - ``` - 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: - ```java -Action: pe.diegoveloper.printing -DataType: text/plain -ExtraKey: android.intent.extra.TEXT -ExtraValue: your text to print -``` - -* ### Flutter Integration -If you want to communicate Flutter with QuickPrinter , you can use this plugin https://pub.dev/packages/android_intent_plus and these configuration: - -```dart - AndroidIntent intent = const AndroidIntent( - action: 'pe.diegoveloper.printing', - type: 'text/plain', - arguments: { - "android.intent.extra.TEXT": "test printer
Big title
", - }); - await intent.launch(); - ``` - - -* ### Advance options (Premium features) -If you are suscribed to the 'Quick Printer' application, you can use this advanced options - ```java - 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](mailto:diegoveloper@gmail.com). - -* ### 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](mailto:diegoveloper@gmail.com). - -## __Demo Integration (Android Sample Project)__ -Link: https://github.com/diegoveloper/quickprinter-integration - -## __Download the latest version of Quick Printer [here](https://drive.google.com/file/d/1ioJur8CV9V0dkLQjFVRi9jkbE0nDsv3R/view?usp=sharing "Quick Printer Latest Version")__ - -## __Contact me__ - __Diego Velásquez López__ - - Mobile Developer expert from Peru, author of the 'Quick Printer' and the library used by the app. - [diegoveloper@gmail.com](mailto:diegoveloper@gmail.com) - - - - - - - - -