Thursday, July 2, 2009

XSL-FO checkbox using unicode

When using xsl-fo to generate PDF, according to FO documentations, the best way is to use unicode fonts instead of using fo:external-graphics. After searching the web, I didn't find the best solution, but found a lot of useful information. The existing solution is, there is a way to draw a unchecked box using font "ZapfDingbats", but there is no checked box. For the unchecked box, here's code:

<fo:inline font-family="ZapfDingbats" font-size="10pt">&#x274F;</fo:inline>

For the cheked box, here's my solution:

<fo:inline font-family="ZapfDingbats" font-size="6pt" border="1pt black solid">&#x2715;</fo:inline>
Try to use "X" plus the border to create the checked box.

No comments: