I ignore QR Codes in marketing, but I think they could be a great way to link to resources, such as videos, from printed technical documents. Readers can simply zap the codes with their phones to pull up the content.
As Kevin points out, leveraging the Google Chart API to generate QR Codes is pretty simple. You can try it in your browser by simply pasting the following URL: https://chart.googleapis.com/chart?cht=qr&chs=200×200&chl=http://ditanauts.org
For the mypdf plugin, an author simply has to insert an xref and set the @outputclass to qrcode. For example:
<xref href="http://ditanauts.org" outputclass="qrcode"/>
Then the plugin uses the following template to generate and insert the image:
<!-- Insert QR code --> <xsl:template match="*[contains(@class,' topic/xref ')] [contains(@outputclass, 'qrcode')]"> <fo:external-graphic> <xsl:attribute name="src"><xsl:value-of select="concat('https://chart. googleapis.com/chart?cht=qr&chs=100x100&chl=', .)"/> </xsl:attribute> </fo:external-graphic> </xsl:template>
The image is inserted at the location of the xref, so you may want to tweak the stylesheet to place the image how and where you want. By the way, from my simple tests, I’ve found that 100×100 was as small as I could make the image, and still pick it up reliably from the QR code reader on my phone.