JsBarcode
JsBarcode copied to clipboard
Can we show barcode text position both top and bottom?
Can we show barcode text position both top and bottom?
I have tried following:
<svg id="barcode2" jsbarcode-format="EAN13" jsbarcode-value="012345678901" jsbarcode-textPosition="bottom top"></svg>
or
<svg id="barcode2" jsbarcode-format="EAN13" jsbarcode-value="012345678901" jsbarcode-textPosition="bottom" textPosition="top"></svg>
This is not something that JsBarcode supports and not something I will implement. But if you want to do a propper implementation I'm open to a PR
@lindell sure I will try to create a PR. Any pointer on where to get started for this change would be appreciated.
The text is drawn in src/renderers/canvas.js#L83 and src/renderers/svg.js#L84 but you should not parse the options there, probably in src/help/fixOptions.js. But the biggest thing is that you need to calculate the positions of all other element in the rendering when this is changed,
Is there a chance that this will become a PR? Since I've not heard this request either before and after this issue I will close it otherwise.
As I know some types (for example EAN13) doesn't support above text
, but others can do it (CodeBar, Code128). There is a small chance I'll implement it in the distant future :)
@SanichKotikov i'm also very interested in showing texts top and above. How big is the chance to get this feature ? Thank you !
It would be super useful to be able to have text both above and below for ISBN barcodes (a subset of EAN13), where it is customary to include the formatted ISBN above as well as the usual EAN13 below.
It would be super useful to be able to have text both above and below for ISBN barcodes (a subset of EAN13), where it is customary to include the formatted ISBN above as well as the usual EAN13 below.
.. this is exactly what I am waiting for - any further development for full support of ISBN-13 ? Here an example: https://www.activebarcode.de/codes/isbn13 Some Guidelines: https://bisg.org/page/BarcodingGuidelines