BarCode Image Generator in Java

后端 未结 5 1533
离开以前
离开以前 2020-11-28 21:29

How can I create a barcode image in Java? I need something that will allow me to enter a number and produce the corresponding barcode image. Is there a free library availa

5条回答
  •  生来不讨喜
    2020-11-28 22:19

    I use barbeque , it's great, and supports a very wide range of different barcode formats.
    See if you like its API .

    Sample API:

    public static Barcode createCode128(java.lang.String data)
                                 throws BarcodeException

    Creates a Code 128 barcode that dynamically switches between character sets to give the smallest possible encoding. This will encode all numeric characters, upper and lower case alpha characters and control characters from the standard ASCII character set. The size of the barcode created will be the smallest possible for the given data, and use of this "optimal" encoding will generally give smaller barcodes than any of the other 3 "vanilla" encodings.

提交回复
热议问题