GithubHelp home page GithubHelp logo

escpos4k's People

Contributors

knoxvillekm avatar okarmazin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

knoxvillekm

escpos4k's Issues

Investigate Android CompanionDeviceManager for BT connectivity

  1. Our Bluetooth connectivity implementation on Android is buggy.
  2. We don't implement BT scanning, therefore we can only connect to devices that are already paired with the operating system.

Bluetooth on Android is notoriously unreliable and a hassle to work with. Android 8 introduced the CompanionDeviceManager to help applications pair with and connect to Bluetooth devices in a more sane manner.

Investigate whether we could use this technology for connecting to Bluetooth printers.

Implement barcode commands

2D:

  • PDF417
  • QR Code
  • MaxiCode
  • Aztec
  • DataMatrix
  • GS1 DataBar Omnidirectional Stacked
  • GS1 DataBar Expanded Stacked

1D:

  • UPC-A
  • UPC-E
  • EAN13
  • EAN8
  • ITF
  • Codabar
  • Code39
  • Code93
  • Code128
  • GS1-128
  • GS1 DataBar Omnidirectional
  • GS1 DataBar Expanded

Introduce a test print method

Add a configurable test print method for diagnostic purposes.

Ideas:

  • A 100-character line sized 1x1 with repeated 0-9 pattern
    • Helps the user determine the line length of their printer
  • Barcodes
    • Helps the user determine which barcode commands are supported by their printer. Not all printers support all barcodes natively

Charset issue

Every printer has own list supported charsets with difference Id.
For example: one printer has Windows1252 with id - 16 and other has Windows1252 with - 87.

Idea:
enum of charsetNames

enum class Charset(
    CP437("IBM437")
    CP850("IBM850")
    CP860("IBM860")
    ...
)

and charset data class

data class CharsetEncoding(
    val charsetId: Byte,
    val charsetName/charset: String/Charset,
)

And ktor has charset class
import io.ktor.utils.io.charsets.Charset

PTP-II does not print the HRI characters around the 1D barcodes

The printer correctly reserves the blank space at the specified HRI position - if instructed to do so - but does not actually print the digits in there.

Observed behavior so far:

  • EAN-13 and UPC-A: the reserved space is empty
  • EAN-8: "noise-like" structured dots printed instead of digits

We have to get back the Epson TM-P20 printer and investigate where the problem lies. If our implementation is correct, the Epson printer is guaranteed to print the HRI.

It is strongly suspected that the PTP-II printer firmware is just broken.

Temporary style builders: Do nothing if content lambda does not emit commands

There is no reason to apply and immediately revert a style if there was no content to be affected by the style.

The following pattern currently blindly emits the surrounding Command.TextSize(2,2), Command.TextSize(1,1).

// current text size: 1x1
withTextSize(2, 2) {
  // This does nothing, so why not avoid 
  // setting the temporary 2x2 text size as well?
}

While emitting the commands is benign, it would be nice if we didn't send unnecessary commands to the printer.

Task: If the content lambda of temporary style builders didn't do anything, do not apply the surrounding style either.

Bluetooth access should return errors, not throw exceptions

On API 31+ listing paired Bluetooth devices requires the BLUETOOTH_CONNECT runtime permission.

On lower API levels this was not the case and paired devices were available with the BLUETOOTH permission (normal level, automatically granted).

Currently we are accessing Bluetooth without checking for BLUETOOTH_CONNECT which leads to an exception if the permission is not granted.

Also there are several lurking NullPointerExceptions due to unchecked access to platform types returned by Android APIs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.