On 9/2/2026 11:09 PM, Wolfgang Schuster wrote:
Am 02.09.2026 um 21:41 schrieb Henning Hraban Ramm:
Hi Hans (et al.),

at the ConTeXt meeting I learned that ConTeXt has not only built-in QR codes but also the common barcode types EAN 13 and Code128.

The ean13 version can also handle ean13+5 (ISBN + price) and ean13+2.


"""
\input meta-imp-barcodes.mkxl

\definefont[EANfont][OCRAStd at 10bp]

\starttext

\barcode[] % default example code128

\barcode[code=ean13,text={978396543604}] % ok

\barcode[code=ean13,text={9783965436046-03995}] % ISBN not ok

\qrcode[text={https://fiee.net},color=orange,width=2cm]

\stoptext
"""

Is the "input" line the right way? \usemodule[barcodes] doesn’t work.

\useMPlibrary[barcodes]

The ean13 version can’t cope with complete numbers but insists on calculating the checksum itself. That’s a bit cumbersome since I usually have my complete ISBN in a variable.

There’s a spurious ">" after the EAN.
https://en.wikipedia.org/wiki/International_Article_Number

Wolfgang

line 321:

   local function ean(str,quietsign)

line 440:

   insert(list_one,quietsign and ">" or "~")

line 457:

    generators["ean13"]  = function(str) return ean(str,false) end
    generators["gtin13"] = function(str) return ean(str,true ) end

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to