Adding supplement to an EAN13 barcode using barcode4j

983 views Asked by At

I am trying to create a barcode with the format shown in this article: http://www.thebookdesigner.com/2009/10/self-publishing-basics-deciphering-the-bookland-ean-bar-code/

Using barcode4j's EAN13Bean I can create the first part of that (the barcode for the ISBN) but I cannot figure out how I supply the supplement to the library (the 51495 in the example).

I'm pretty sure barcode4j can do this as there are examples on its sourceforge site showing an EAN13 with supplement but I cannot find anything in the API to allow me to specify it.

1

There are 1 answers

0
Steve Claridge On BEST ANSWER

TO create an EAN13 barcode without a supplement:

new EAN13Bean().generateBarcode( canvas, isbn );

to create one with a supplement you need to append "+supplement" to the end of the isbn:

new EAN13Bean().generateBarcode( canvas, isbn + "+90000" );