JsBarcode icon indicating copy to clipboard operation
JsBarcode copied to clipboard

Can we show barcode text position both top and bottom?

Open asoneji opened this issue 7 years ago • 8 comments

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>

asoneji avatar Mar 25 '17 01:03 asoneji

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 avatar Apr 03 '17 16:04 lindell

@lindell sure I will try to create a PR. Any pointer on where to get started for this change would be appreciated.

asoneji avatar Apr 03 '17 22:04 asoneji

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,

lindell avatar Apr 04 '17 04:04 lindell

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.

lindell avatar Jul 21 '17 13:07 lindell

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 avatar Jul 21 '17 14:07 SanichKotikov

@SanichKotikov i'm also very interested in showing texts top and above. How big is the chance to get this feature ? Thank you !

reda134 avatar Aug 15 '18 03:08 reda134

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.

caesar avatar Jul 10 '19 17:07 caesar

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

no64 avatar Oct 04 '22 05:10 no64