├── README.md ├── privacy-policy.md └── receipt_ticket.jpg /README.md: -------------------------------------------------------------------------------- 1 | # Quick Printer 2 | ## Android POS Printer (ESC/POS) 3 | > Created for the purpose of serving as a channel among other applications that require printing data on receipt printers using ESC/POS commands. 4 | > 5 | > 6 | ## Installation 7 | If you can't download/install the app from Google Play https://play.google.com/store/apps/details?id=pe.diegoveloper.printerserverapp , try using this link: https://drive.google.com/file/d/1EV-zXiyY6yKmbPfTBCYU4MCDjwKQth8Y/view?usp=sharing 8 | 9 | ## __Introduction__ 10 | Quick printer is an Android application that allows you to add and configure receipt printers (POS printers) through different connection types: 11 | - Wifi local network 12 | - Bluetooth 13 | - USB (OTG) 14 | 15 | 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. 16 | 17 | And if you're a developer, you can integrate your application in a super simple way so you can print tickets, receipts, etc. 18 | 19 | > The application supports many types of thermal and matrix printers such as EPSON, BIXOLON, STAR MICRONICS, CITIZEN, etc. 20 | 21 | 22 | ## __Usage__ 23 | The steps for using the application will be detailed below: 24 | 25 | ### __1. Download Quick Printer from the playstore [here](https://play.google.com/store/apps/details?id=pe.diegoveloper.printerserverapp "Quick Printer")__ 26 | 27 |
28 | Configure your printers using the Tutorial inside de app. 29 | 30 | ### __2. Share Text from any application installed__ 31 | When the application selection dialog appears, select 'Quick Printer'. 32 | The selected text will be printed on your previously configured printer. 33 | 34 | 35 | ## __NON Developers__ 36 | 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. 37 | 38 | - Select the Text 39 | 40 |
41 | 42 | - Press SHARE 43 | - Select Quick Printer 44 | 45 | You can use any command from these list: https://github.com/diegoveloper/quickprinter#commands-supported 46 | 47 | 48 | ## __Developers__ 49 | If you are a developer and want to integrate your Android application with 'Quick Printer', read the following instructions: 50 | 51 | * ### Using Sharing Intents 52 | You can share plain text using shared Intents with the appropriate commands, below the simplest example. 53 | ```java 54 | String textToPrint = "Your text here"; 55 | Intent intent = new Intent("pe.diegoveloper.printing"); 56 | //intent.setAction(android.content.Intent.ACTION_SEND); 57 | intent.setType("text/plain"); 58 | intent.putExtra(android.content.Intent.EXTRA_TEXT,textToPrint); 59 | startActivity(intent); 60 | ``` 61 | When the selection dialog appears, select 'Quick Printer'. 62 | 63 | * ### Using Sharing Intents with commands 64 | 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. 65 | ```java 66 | 67 | String textToPrint = "Text Title
Testing BIG
" + 68 | "string text
Left aligned
" + 69 | "Center aligned
underline text
12345678
" + 70 | "
QR: 12345678
Line

Double Line

"; 71 | Intent intent = new Intent("pe.diegoveloper.printing"); 72 | //intent.setAction(android.content.Intent.ACTION_SEND); 73 | intent.setType("text/plain"); 74 | intent.putExtra(android.content.Intent.EXTRA_TEXT,textToPrint); 75 | startActivity(intent); 76 | ``` 77 | These commands generate this ticket 78 | 79 | ### __Commands supported__ 80 | 81 | | Command | Description| 82 | | ------------ |------------------------------------| 83 | |`
` | breakline| 84 | |`` | small text size| 85 | |`` | medium text size| 86 | |`` | medium text size| 87 | |`` | medium text size| 88 | |`` | big text size 89 | |`` | bold text 90 | |``| text aligned to the left 91 | |``| text aligned to the right 92 | |`
`| text aligned to center 93 | |`` | text with underline 94 | |`` | turn off bold and underline 95 | |``| A single line of text 96 | |``| Double line of text 97 | |``| A single line of text without breakline 98 | |``| Double line of text without breakline 99 | |`Table Mode`| Send your text separated by ;; e.g: Header1;;Header2;;Header3
Item1;;Item2;;Item3 100 | |``| Cut the paper 101 | |``| Ping to the printer (Doesn't print anything, just awake the printer) 102 | |``| Print the logo configured on your printer 103 | |``| (OPTIONAL for some printers) Print the logo configured on your printer 104 | |``| Turn on white/black reverse mode 105 | |`` | Open the cash drawer connected to the printer 106 | |`` | Use ESC/POS commands to print. Eg: 0x1B,0x40
(premium feature) 107 | |`your text
` | Print a QR code of your text(premium feature) 108 | |`your text
` | Print a QR (small size) code of your text(premium feature) 109 | |`your text
` | Print a QR (medium size)code of your text(premium feature) 110 | |`your text
` | Print a QR (large size)code of your text(premium feature) 111 | |`your numbers
` | Print a Barcode128 of your numbers(premium feature) 112 | |`http://url_of_image
` | Print an Image from your URL (Default 200x200) 113 | |`file:///storage/emulated/0/Download/YourImage.png
` | Print an Image from your Local File URL (Default 200x200) 114 | |`http://url_of_image
` | Print an Image with custom size(w= width,h= height, e.g: ``) from your URL (premium feature) 115 | 116 | Some examples for Barcode and QR: 117 | ```java 118 | //barcode128 119 | String commands = "
hello barcode
Testing barcode5331698000418
"; 120 | 121 | //qr 122 | String commands2 = "
hello qr
Testing qrMyName10
"; 123 | 124 | 125 | ``` 126 | 127 | 128 | * ### Getting the print result 129 | If you want to get the printing result you should use startActivityForResult instead of startActivity, below is the sample code 130 | 131 | ## Old versions of Android 132 | 133 | Call the printer 134 | 135 | ```java 136 | Intent intent = new Intent("pe.diegoveloper.printing"); 137 | //intent.setAction(android.content.Intent.ACTION_SEND); 138 | intent.setType("text/plain"); 139 | intent.putExtra(android.content.Intent.EXTRA_TEXT,"your text to print here"); 140 | startActivityForResult(intent,YOUR_REQUEST_CODE); 141 | ``` 142 | 143 | Receive the data 144 | 145 | ```java 146 | @Override 147 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 148 | // super.onActivityResult(requestCode, resultCode, data); 149 | if (requestCode == YOUR_REQUEST_CODE){ 150 | if (resultCode == RESULT_OK){ 151 | //Printing is ok 152 | } else { 153 | if (data != null) { 154 | String errorMessage = data.getStringExtra("errorMessage"); 155 | //Printing with error 156 | } 157 | } 158 | } 159 | } 160 | ``` 161 | 162 | ## New versions of Android 163 | 164 | Call the printer 165 | 166 | ```java 167 | Intent intent = new Intent("pe.diegoveloper.printing"); 168 | intent.setType("text/plain"); 169 | intent.putExtra(android.content.Intent.EXTRA_TEXT,"your text to print here"); 170 | myActivityResultLauncher.launch(intent); 171 | 172 | ``` 173 | 174 | Receive the data 175 | 176 | ```java 177 | 178 | ActivityResultLauncher myActivityResultLauncher = registerForActivityResult( 179 | new ActivityResultContracts.StartActivityForResult(), 180 | result -> { 181 | if (result.getResultCode() == Activity.RESULT_OK) { 182 | //Printing is ok 183 | 184 | } else { 185 | Intent data = result.getData(); 186 | if (data != null) { 187 | String errorMessage = data.getStringExtra("errorMessage"); 188 | //Printing with error 189 | } 190 | } 191 | }); 192 | ``` 193 | 194 | * ### Printing on a specific printer by alias 195 | If you want to send the data to a specific printer (replacing printer selection), You can do following the snippet code 196 | ```java 197 | String data = " YOUR CUSTOM DATA
"; 198 | Intent intent = new Intent("pe.diegoveloper.printing"); 199 | // intent.setAction(android.content.Intent.ACTION_SEND); 200 | intent.setType("text/plain"); 201 | intent.putExtra(android.content.Intent.EXTRA_TEXT,data); 202 | startActivityForResult(intent,YOUR_REQUEST_CODE); 203 | ``` 204 | 205 | If you want to print the same commands on multiple printers, you can use multiple alias separated by `,`. 206 | ```java 207 | String data = " YOUR CUSTOM DATA
"; 208 | ``` 209 | 210 | * ### Printing on a specific printer by group 211 | 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 212 | ```java 213 | String data = "YOUR CUSTOM DATA
"; 214 | Intent intent = new Intent("pe.diegoveloper.printing"); 215 | // intent.setAction(android.content.Intent.ACTION_SEND); 216 | intent.setType("text/plain"); 217 | intent.putExtra(android.content.Intent.EXTRA_TEXT,data); 218 | startActivityForResult(intent,YOUR_REQUEST_CODE); 219 | ``` 220 | 221 | * ### Printing your receipt 'n' times 222 | 223 | If you want to print your receipt 'n' times, You can do following the snippet code 224 | ```java 225 | String data = " YOUR CUSTOM DATA
"; 226 | Intent intent = new Intent("pe.diegoveloper.printing"); 227 | intent.setType("text/plain"); 228 | intent.putExtra(android.content.Intent.EXTRA_TEXT,data); 229 | startActivityForResult(intent,YOUR_REQUEST_CODE); 230 | ``` 231 | 232 | * ### Other useful commands 233 | 234 | If you want to receive some data from Quick Printer without prints anything, you can use these commands. 235 | 236 | * #### Get the alias List 237 | 238 | ```java 239 | String data = ""; 240 | Intent intent = new Intent("pe.diegoveloper.printing"); 241 | intent.setType("text/plain"); 242 | intent.putExtra(android.content.Intent.EXTRA_TEXT,data); 243 | startActivityForResult(intent,YOUR_REQUEST_CODE); 244 | ``` 245 | 246 | * #### Get the group List 247 | 248 | ```java 249 | String data = ""; 250 | Intent intent = new Intent("pe.diegoveloper.printing"); 251 | intent.setType("text/plain"); 252 | intent.putExtra(android.content.Intent.EXTRA_TEXT,data); 253 | startActivityForResult(intent,YOUR_REQUEST_CODE); 254 | ``` 255 | 256 | * #### Avoid printing Dialog 257 | 258 | ```java 259 | String data = ""; 260 | Intent intent = new Intent("pe.diegoveloper.printing"); 261 | intent.setType("text/plain"); 262 | intent.putExtra(android.content.Intent.EXTRA_TEXT,data); 263 | startActivityForResult(intent,YOUR_REQUEST_CODE); 264 | ``` 265 | 266 | * #### Avoid error dialog when the printer fails 267 | 268 | ```java 269 | String data = ""; 270 | Intent intent = new Intent("pe.diegoveloper.printing"); 271 | intent.setType("text/plain"); 272 | intent.putExtra(android.content.Intent.EXTRA_TEXT,data); 273 | startActivityForResult(intent,YOUR_REQUEST_CODE); 274 | ``` 275 | 276 | Learn how to receive the data: https://github.com/diegoveloper/quickprinter#getting-the-print-result 277 | 278 | 279 | 280 | 281 | * ### Print from web 282 | You can print directly from your website using schemas, for example if you want to print the following commands: 283 | ```java 284 | String commands = "test printer
Big title
"; 285 | ``` 286 | You have to write this on your web page: 287 | ```html 288 | 303 | 304 | Print Button 305 | ``` 306 | 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. 307 | If you are using Apache Cordova and want to print from web, You must add this line on your config.xml file : 308 | ```html 309 | 310 | ``` 311 | Testing printer from your chrome browser (Open this link from your android phone) https://quickprinter-d2410.firebaseapp.com/ 312 | 313 | 314 | * ### AppInventor Integration 315 | If you want to communicate AppInventor with QuickPrinter , you have to use these configuration: 316 | ```java 317 | Action: pe.diegoveloper.printing 318 | DataType: text/plain 319 | ExtraKey: android.intent.extra.TEXT 320 | ExtraValue: your text to print 321 | ``` 322 | 323 | * ### Flutter Integration 324 | If you want to communicate Flutter with QuickPrinter , you can use this plugin https://pub.dev/packages/android_intent_plus and these configuration: 325 | 326 | ```dart 327 | AndroidIntent intent = const AndroidIntent( 328 | action: 'pe.diegoveloper.printing', 329 | type: 'text/plain', 330 | arguments: { 331 | "android.intent.extra.TEXT": "test printer
Big title
", 332 | }); 333 | await intent.launch(); 334 | ``` 335 | 336 | 337 | * ### Advance options (Premium features) 338 | If you are suscribed to the 'Quick Printer' application, you can use this advanced options 339 | ```java 340 | Intent intent = new Intent("pe.diegoveloper.printing"); 341 | //intent.setAction(android.content.Intent.ACTION_SEND); 342 | intent.setType("text/plain"); 343 | intent.putExtra(android.content.Intent.EXTRA_TEXT,etPrinterText.getText().toString()); 344 | //premium features 345 | intent.putExtra("config_error_dialog",false); 346 | intent.putExtra("config_color_background_dialog","#0000ff"); 347 | intent.putExtra("config_color_text_dialog","#00ff00"); 348 | intent.putExtra("config_text_dialog","Loading..."); 349 | startActivityForResult(intent,YOUR_REQUEST_CODE); 350 | ``` 351 | | Option | Value|Description| 352 | | ------------ |------------------------------------|------------------------------------| 353 | |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| 354 | |config_color_background_dialog | Color in hexadecimal| Background color of the Printing dialog| 355 | |config_color_text_dialog | Color in hexadecimal| Text color of the Printing dialog| 356 | |config_text_dialog | Text | Text of the Printing dialog| 357 | 358 | __NOTE__: 'QR' command and these options are only availables for Premium Version. Free version print a message at the end of the ticket. 359 | 360 | * ### Buy a big number of licenses or unlimited licenses 361 | 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). 362 | 363 | * ### Integrate Printer Driver directly in your code 364 | '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). 365 | 366 | ## __Demo Integration (Android Sample Project)__ 367 | Link: https://github.com/diegoveloper/quickprinter-integration 368 | 369 | ## __Download the latest version of Quick Printer [here](https://drive.google.com/file/d/1ioJur8CV9V0dkLQjFVRi9jkbE0nDsv3R/view?usp=sharing "Quick Printer Latest Version")__ 370 | 371 | ## __Contact me__ 372 | __Diego Velásquez López__ 373 | 374 | Mobile Developer expert from Peru, author of the 'Quick Printer' and the library used by the app. 375 | [diegoveloper@gmail.com](mailto:diegoveloper@gmail.com) 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | -------------------------------------------------------------------------------- /privacy-policy.md: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Privacy Policy

4 |

diegoveloper built the QuickPrinter app as a freemium app. This SERVICE is provided by diegoveloper and is intended 5 | for use as is.

6 |

This page is used to inform website visitors regarding my policies with the collection, use, and 7 | disclosure of Personal Information if anyone decided to use my Service.

8 |

If you choose to use my Service, then you agree to the collection and use of information in 9 | relation with this policy. The Personal Information that we collect are used for providing and 10 | improving the Service. We will not use or share your information with anyone except as described 11 | in this Privacy Policy.

12 |

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, 13 | which is accessible at QuickPrinter, unless otherwise defined in this Privacy Policy.

14 | 15 |

Information Collection and Use

16 |

For a better experience while using our Service, We may require you to provide us with certain 17 | personally identifiable information]. 18 | The information that We request is retained on your device and is not 19 | collected by us in any way

20 |

The app does use third party services that may collect information used to identify you. 21 | 22 |

Log Data

23 |

We want to inform you that whenever you use our Service, in case of an error in the app We collect 24 | data and information (through third party products) on your phone called Log Data. This Log Data 25 | may include information such as your devices’s Internet Protocol (“IP”) address, device name, 26 | operating system version, configuration of the app when utilising our Service, the time and date 27 | of your use of the Service, and other statistics.

28 | 29 |

Cookies

30 |

Cookies are files with small amount of data that is commonly used an anonymous unique identifier. 31 | These are sent to your browser from the website that you visit and are stored on your devices’s 32 | internal memory.

33 | 34 |

Service Providers

35 |

We may employ third-party companies and individuals due to the following reasons:

36 |
    37 |
  • To facilitate our Service;
  • 38 |
  • To provide the Service on our behalf;
  • 39 |
  • To perform Service-related services; or
  • 40 |
  • To assist us in analyzing how our Service is used.
  • 41 |
42 |

We want to inform users of this Service that these third parties have access to your Personal 43 | Information. The reason is to perform the tasks assigned to them on our behalf. However, they 44 | are obligated not to disclose or use the information for any other purpose.

45 | 46 |

Security

47 |

We value your trust in providing us your Personal Information, thus we are striving to use 48 | commercially acceptable means of protecting it. But remember that no method of transmission over 49 | the internet, or method of electronic storage is 100% secure and reliable, and We cannot 50 | guarantee its absolute security.

51 | 52 |

Links to Other Sites

53 |

This Service may contain links to other sites. If you click on a third-party link, you will be 54 | directed to that site. Note that these external sites are not operated by us. Therefore, I 55 | strongly advise you to review the Privacy Policy of these websites. I have no control over, and 56 | assume no responsibility for the content, privacy policies, or practices of any third-party 57 | sites or services.

58 | 59 |

Children’s Privacy

60 |

This Services do not address anyone under the age of 13. We do not knowingly collect personal 61 | identifiable information from children under 13. In the case We discover that a child under 13 62 | has provided us with personal information, We immediately delete this from our servers. If you 63 | are a parent or guardian and you are aware that your child has provided us with personal 64 | information, please contact us so that We will be able to do necessary actions.

65 | 66 |

Changes to This Privacy Policy

67 |

We may update our Privacy Policy from time to time. Thus, you are advised to review this page 68 | periodically for any changes. We will notify you of any changes by posting the new Privacy Policy 69 | on this page. These changes are effective immediately, after they are posted on this page.

70 | 71 |

Contact Us

72 |

If you have any questions or suggestions about or Privacy Policy, do not hesitate to contact 73 | us.

74 |

This Privacy Policy page was created at diegoveloper@gmail.com.

76 | 77 | 78 | -------------------------------------------------------------------------------- /receipt_ticket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diegoveloper/quickprinter/f7f0df783061335e31605079c5b7c572e719721c/receipt_ticket.jpg --------------------------------------------------------------------------------