From 67152abed1bc19c5b801fbf78ef0ef6543b5da3a Mon Sep 17 00:00:00 2001 From: Daniele Pantaleo Date: Sun, 22 Oct 2023 23:26:12 +0200 Subject: [PATCH] Added Code39 --- .../escposprinter/barcode/Barcode39.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 escposprinter/src/main/java/com/dantsu/escposprinter/barcode/Barcode39.java diff --git a/escposprinter/src/main/java/com/dantsu/escposprinter/barcode/Barcode39.java b/escposprinter/src/main/java/com/dantsu/escposprinter/barcode/Barcode39.java new file mode 100644 index 0000000..628f601 --- /dev/null +++ b/escposprinter/src/main/java/com/dantsu/escposprinter/barcode/Barcode39.java @@ -0,0 +1,21 @@ +package com.dantsu.escposprinter.barcode; + +import com.dantsu.escposprinter.EscPosPrinterSize; +import com.dantsu.escposprinter.EscPosPrinterCommands; +import com.dantsu.escposprinter.exceptions.EscPosBarcodeException; + +public class Barcode39 extends Barcode { + public Barcode39(EscPosPrinterSize printerSize, String code, float widthMM, float heightMM, int textPosition) throws EscPosBarcodeException { + super(printerSize, EscPosPrinterCommands.BARCODE_TYPE_39, code, widthMM, heightMM, textPosition); + } + + @Override + public int getCodeLength() { + return this.code.length(); + } + + @Override + public int getColsCount() { + return (this.getCodeLength() + 4) * 16; + } +}