Re: [xsl] Using barcode markup in Saxon/Oxygen

Subject: Re: [xsl] Using barcode markup in Saxon/Oxygen
From: "Kevin Brown" <kevin@xxxxxxxxxxx>
Date: Sun, 23 Sep 2012 10:42:23 -0700
> What about support for QR codes and other matrix barcodes?

If when processing your data you are internet connected then I would just
use the Google Chart API for QR Codes. Easy enough to build out the URL
which dynamically generates them. Note: this is from the series of CoolTools
for FO I posted to RenderX web site long ago, I have not examined whether
the links to the Google API has changed. The full template I posted includes
many more of the Google Chart API components (pie chart, pin with letter,
sticky note, outline text). I would be happy to send it along to whomever
would like it.

Refer to:

Let's say your XML is like this:

    <qrcode size="200x200">
        <line>This is an example of encoding</line>

With something like this:

    <xsl:template match="qrcode">
        <xsl:variable name="url">
            <xsl:call-template name="build.qrcode">
                <xsl:with-param name="size" select="@size"/>
                <xsl:with-param name="text" select="line"/>
        <fo:block space-before="12pt">
            <fo:external-graphic src="url({$url})" />

    <xsl:template name="build.qrcode">
        <xsl:param name="size" select="'300x300'"/>
        <xsl:param name="text" select="''"/>
        <!-- Add Chart Server URL -->
        <xsl:value-of select="$chartserver"/>
        <!-- Add Chart Type -->
        <!-- Start the parameters -->
        <!-- Add the size -->
        <xsl:value-of select="$size"/>
        <!-- Add the text -->
        <xsl:value-of select="url:encode($text)"/>

Kevin Brown

Current Thread