New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

com.github.danielfelgar:draw-receipt

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.danielfelgar:draw-receipt

Android lib to draw receipt as bitmap for thermal prints

  • 0.1.3
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

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

FAQs

Package last updated on 10 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc