DrawReceipt

Android lib to draw receipt as bitmap for thermal prints

Лицензия

Лицензия

Группа

Группа

com.github.danielfelgar
Идентификатор

Идентификатор

draw-receipt
Последняя версия

Последняя версия

0.1.3
Дата

Дата

Тип

Тип

aar
Описание

Описание

DrawReceipt
Android lib to draw receipt as bitmap for thermal prints
Ссылка на сайт

Ссылка на сайт

https://github.com/danielfelgar/DrawReceipt
Система контроля версий

Система контроля версий

https://github.com/danielfelgar/DrawReceipt

Скачать draw-receipt

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.danielfelgar/draw-receipt/ -->
<dependency>
    <groupId>com.github.danielfelgar</groupId>
    <artifactId>draw-receipt</artifactId>
    <version>0.1.3</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.danielfelgar/draw-receipt/
implementation 'com.github.danielfelgar:draw-receipt:0.1.3'
// https://jarcasting.com/artifacts/com.github.danielfelgar/draw-receipt/
implementation ("com.github.danielfelgar:draw-receipt:0.1.3")
'com.github.danielfelgar:draw-receipt:aar:0.1.3'
<dependency org="com.github.danielfelgar" name="draw-receipt" rev="0.1.3">
  <artifact name="draw-receipt" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.danielfelgar', module='draw-receipt', version='0.1.3')
)
libraryDependencies += "com.github.danielfelgar" % "draw-receipt" % "0.1.3"
[com.github.danielfelgar/draw-receipt "0.1.3"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

DrawReceipt

Android lib to draw receipt as bitmap for thermal prints

Screenshot

Version

0.1.3

Download

To use this library in your android project, just simply add the following dependency into your build.gradle

dependencies {
    compile 'com.github.danielfelgar:draw-receipt:0.1.3'
}

Usage

    ReceiptBuilder receipt = new ReceiptBuilder(1200);
    receipt.setMargin(30, 20).
            setAlign(Paint.Align.CENTER).
            setColor(Color.BLACK).
            setTextSize(60).
            setTypeface(this, "fonts/RobotoMono-Regular.ttf").
            addText("LakeFront Cafe").
            addText("1234 Main St.").
            addText("Palo Alto, CA 94568").
            addText("999-999-9999").
            addBlankSpace(30).
            setAlign(Paint.Align.LEFT).
            addText("Terminal ID: 123456", false).
            setAlign(Paint.Align.RIGHT).
            addText("1234").
            setAlign(Paint.Align.LEFT).
            addLine().
            addText("08/15/16", false).
            setAlign(Paint.Align.RIGHT).
            addText("SERVER #4").
            setAlign(Paint.Align.LEFT).
            addParagraph().
            addText("CHASE VISA - INSERT").
            addText("AID: A000000000011111").
            addText("ACCT #: *********1111").
            addParagraph().
            setTypeface(this, "fonts/RobotoMono-Bold.ttf").
            addText("CREDIT SALE").
            addText("UID: 12345678", false).
            setAlign(Paint.Align.RIGHT).
            addText("REF #: 1234").
            setTypeface(this, "fonts/RobotoMono-Regular.ttf").
            setAlign(Paint.Align.LEFT).
            addText("BATCH #: 091", false).
            setAlign(Paint.Align.RIGHT).
            addText("AUTH #: 0701C").
            setAlign(Paint.Align.LEFT).
            addParagraph().
            setTypeface(this, "fonts/RobotoMono-Bold.ttf").
            addText("AMOUNT", false).
            setAlign(Paint.Align.RIGHT).
            addText("$ 15.00").
            setAlign(Paint.Align.LEFT).
            addParagraph().
            addText("TIP", false).
            setAlign(Paint.Align.RIGHT).
            addText("$        ").
            addLine(180).
            setAlign(Paint.Align.LEFT).
            addParagraph().
            addText("TOTAL", false).
            setAlign(Paint.Align.RIGHT).
            addText("$        ").
            addLine(180).
            addParagraph().
            setAlign(Paint.Align.CENTER).
            setTypeface(this, "fonts/RobotoMono-Regular.ttf").
            addText("APPROVED").
            addParagraph().
            addImage(barcode);
    ivReceipt.setImageBitmap(receipt.build());

Change Logs

v0.1.3

[UPDATE] Update gradle [UPDATE] Update Build tools

v0.1.1

[UPDATE] Update gradle [UPDATE] Update Build tools [BUG] Color Black as default, Align LEFT as default

v0.1.0

Initial version

License

Apache 2.0

Версии библиотеки

Версия
0.1.3
0.1.2
0.1.1
0.1.0