Hi Erich,
I have done this in my Alma letters; below is the XSLT I use. The asterisks are the start/stop characters the barcode reader needs for 3-of-9 barcodes.
<span style="font-family:'Free 3 of 9'; font-size:36pt">
*<xsl:value-of select="notification_data/phys_item_display/optional_barcodes/string"/>*
</span>
We use Namtuk/Automatic Email Manager for printing Alma letters, so on the Namtuk PC I installed a free 3-of-9 barcode font from https://fonts2u.com/free-3-of-9-regular.fonton
Lori Stethers
Systems Librarian
(she/her)
Wesleyan University, Middletown, CT
----------------------------------------------------------------------
Date: Mon, 7 Aug 2023 16:34:15 +1000
From: Conal Tuohy <[log in to unmask]>
Subject: Re: Barcodes in XSLT (Alma letters)
I think that you would also need to encode that numeric string before you could display it with that font. That would convert the original string of text or digits into another string which includes a checksum, etc, suitable for displaying with a bar-code font, and which a barcode reader will recognize as a barcode instead of just seeing a series of vertical lines.
See the https://en.wikipedia.org/wiki/Code_128 page for details of what I mean. I don't personally know of any XSLT code for doing that conversion, but it could certainly be done in your XSLT.
Conal
On Fri, 4 Aug 2023 at 00:28, Adam Constabaris < [log in to unmask]> wrote:
> Assuming you have a suitable font installed on the computers that are
> looking at the barcodes (e.g.
> https://fonts.google.com/specimen/Libre+Barcode+128 <- not an
> endorsement, YMMV, etc.), the HTML
>
> <span style="font-family: 'Libre Barcode 128';">12309809SA</span>
>
> Should display the value inside the span as a barcode, falling back to
> Winding as an obvious indicator that something has gone wrong. If
> you're OK hard-coding the font-family value, that should be fairly
> straightforward to put in an XSLT. I'm not familiar with the
> particular context of Alma, but if your custom barcodes arere in a
> "custom-barcode" element in the source
> XML:
>
> <xsl:template match="custom-barcode">
> <span class="barcode" style="font-family: 'Libre Barcode 128';">
> <xsl:value-of select="."/>
> </span>
> </xsl:template>
>
> might do the trick, although working out how to ensure that template
> is matched in the right place might require more thought.
>
> HTH,
>
> AC
>
>
>
> On Thu, Aug 3, 2023 at 9:49 AM Hammer, Erich F <[log in to unmask]> wrote:
>
> > Hi,
> >
> > We have barcodes embedded in a number of the "letters" (i.e.
> > receipts) that Alma sends to patrons or ILL offices, but those
> > barcodes are for material IDs that are normally input via barcode
> > scanner and are
> referenced
> > in the XSLT of the letter as a .PNG. IOW, Alma holds/constructs an
> > image of a barcode for the ID of the materials and makes it
> > available to the email/receipt. We have recently added/changed a
> > letter to include
> another,
> > long-number-string, ID and would like to have a barcode displayed
> > for it
> as
> > well. Otherwise, someone has to read and manually enter the string
> > which greatly increases the chance of error.
> >
> > I assume we can't convince Alma to construct a barcode image for any
> > old number string, so we will need to modify the XSLT code of the
> > letter to display that string in a barcode font. This letter will
> > be printed from specific machines, so it will be possible to ensure
> > the font is
> installed,
> > but I don't know how to embed the HTML/CSS code necessary into XSLT.
> >
> > Does anyone know how to do that?
> >
> > Thanks,
> > Erich
> >
> >
> > --
> > Erich Hammer Head of Library Systems
> > [log in to unmask] University Libraries
> > 518-442-3891 University @ Albany
> >
> > "Beliefs are what divide people. Doubt unites them."
> > -- Peter Ustinov
> >
>
--
Conal Tuohy
http://conaltuohy.com/
@conal_tuohy
+61-466-324297
|