[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Using barcode markup in Saxon/Oxygen

Subject: Re: Using barcode markup in Saxon/Oxygen
From: "Kevin Brown" <kevin@xxxxxxxxxxx>
Date: Sun, 23 Sep 2012 10:42:23 -0700
Re:  Using barcode markup in Saxon/Oxygen
> 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:

https://developers.google.com/chart/infographics/docs/qr_codes

Let's say your XML is like this:

    <qrcode size="200x200">
        <line>This is an example of encoding http://www.renderx.com</line>
    </qrcode>

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"/>
            </xsl:call-template>
        </xsl:variable>
        <fo:block space-before="12pt">
            <fo:external-graphic src="url({$url})" />
        </fo:block>
    </xsl:template>

    <xsl:template name="build.qrcode">
        <xsl:param name="size" select="'300x300'"/>
        <xsl:param name="text" select="'http://www.renderx.com'"/>
        <!-- Add Chart Server URL -->
        <xsl:value-of select="$chartserver"/>
        <!-- Add Chart Type -->
        <xsl:text>?cht=qr</xsl:text>
        <!-- Start the parameters -->
        <xsl:text>&amp;chs=</xsl:text>
        <!-- Add the size -->
        <xsl:value-of select="$size"/>
        <xsl:text>&amp;chl=</xsl:text>
        <!-- Add the text -->
        <xsl:value-of select="url:encode($text)"/>
    </xsl:template>

Kevin Brown
RenderX
kevin@xxxxxxxxxxx

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.