Re: [xsl] QR codes

Subject: Re: [xsl] QR codes
From: "Kevin Brown" <kevin@xxxxxxxxxxx>
Date: Thu, 17 Feb 2011 22:45:41 -0800
I may be confused but I would think of a QR Code (or any barcode for that
matter) as a visual representation ... meaning the question of "implementing
them" means you would wish to do so in connection with some form of visual
rendering.

Certainly SVG could be used, we at RenderX have not done them in SVG ... we
have implemented many barcodes in SVG but not QR Codes. We have found no
reason, as the Google Chart API is great ... this one is easy ...

http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=http://www.renderx
.com
 
... just ...

<xsl:variable name="src">
 
<xsl:text>http://chart.apis.google.com/chart?cht=qr&amp;chs=300x300&amp;chl=
http://www.renderx.com</xsl:text>
</xsl:variable>
<!-- Of course, you can use any method to get what you want in the src
attribute -->


<fo:external-graphic src="url('{$src}')"/>

In FO:

<?xml version="1.0" encoding="UTF-8"?>
	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
		<fo:layout-master-set>
			<fo:simple-page-master margin-top="1in"
margin-left="1in"
				margin-bottom="18pt" margin-right="18pt"
				page-width="8.5in" page-height="11in"
master-name="first">
				<fo:region-body margin-top="0pt"/>
				<fo:region-before extent="0pt"/>
				<fo:region-after extent="0pt"/>
			</fo:simple-page-master>
		</fo:layout-master-set>
		<fo:page-sequence master-reference="first">
			<fo:flow flow-name="xsl-region-body">
				<fo:block>
					
					
					<fo:external-graphic
src="url('http://chart.apis.google.com/chart?cht=qr&amp;chs=300x300&amp;chl=
http://www.renderx.com')"/>
					
				</fo:block>
			</fo:flow>
		</fo:page-sequence>
	</fo:root>

Kevin Brown
RenderX

Current Thread