Sunday, April 08, 2012

QR Codes in your documents

QR codes are one method to ease the information exchange between classical medias and mobile devices (common usage direct link to the corresponding web page in paper based catalogs, manuals, ....).

But how to create those QR codes without too much complexity?

Google Chart API provides:
  • chart wizard to create QR codes and corresponding styling
  • infographics API to create static images based on posted chart definition (URLs)
viola. You now have a easy to use backend for creation of QR codes using e.g XSL-T.

The following code is taken from "QR Codes in DTIA Output" which shows how to create QR codes for PDF output of the DITA-OT using XSL-FO:

<!-- Insert QR code -->
<xsl:template match="*[contains(@class,' topic/xref ')]
                      [contains(@outputclass, 'qrcode')]">
<xsl:attribute name="src"><xsl:value-of select="concat('https://chart.;chs=100x100&amp;chl=', .)"/>

Sample (code: <img src="" width="200" height="100" alt="" />):

QR Code Sample

No comments: