<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ThinkRobot &#187; FPDF</title>
	<atom:link href="http://think-robot.com/tag/fpdf/feed/" rel="self" type="application/rss+xml" />
	<link>http://think-robot.com</link>
	<description>Design &#38; Development Blog</description>
	<lastBuildDate>Sun, 22 Apr 2012 23:58:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to use special characters in FPDF</title>
		<link>http://think-robot.com/2008/09/how-to-use-special-characters-in-fpdf/</link>
		<comments>http://think-robot.com/2008/09/how-to-use-special-characters-in-fpdf/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 12:45:49 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[FPDF]]></category>
		<category><![CDATA[iconv]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[UTF8]]></category>

		<guid isPermaLink="false">http://www.think-robot.com/?p=12</guid>
		<description><![CDATA[FPDF is a nice little library for php that allows you to create PDFs on the fly. It&#8217;s great for all sorts of document, amongs them invoices. Until you try to use say a pound (£) or euro (€) sign. Basically the library itself does not support utf-8, so the moment you need to insert [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fpdf.org" target="_blank">FPDF</a> is a nice little library for php that allows you to create PDFs on the fly. It&#8217;s great for all sorts of document, amongs them invoices. Until you try to use say a pound (£) or euro (€) sign. Basically the library itself does not support utf-8, so the moment you need to insert anything extra into your document a conversion needs to be done.</p>
<p>To save you some searching and a masive panic attack here is the easy way to do it:</p>
<pre>iconv("UTF-8", "ISO-8859-1", "£");</pre>
<p>You could also use the same command to do the whole text rather than just the pound sign itself.  Example below:<br />
<span id="more-12"></span><br />
You can use the iconv function at any point, however probably the easiest solution is to put it inside functions of the class you use to extend FPDF:</p>
<pre>class myPdf extends FPDF {
    [...]
    public function showMoney($money){
        $this-&gt;cell(10,10,<strong>iconv("UTF-8", "ISO-8859-1", "£").</strong> $money,0);
    }
}</pre>
<div id="crp_related"><h2>Related Articles:</h2><ul><li><a href="http://think-robot.com/2011/01/enable-delayed-messages-in-zend_queue/" rel="bookmark">Enable delayed messages in Zend_Queue</a></li><li><a href="http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/" rel="bookmark">Doctrine Many To Many With Extra Fields</a></li><li><a href="http://think-robot.com/2008/11/nested-sortable-using-jtree-clickable-links/" rel="bookmark">Nested sortable using jTree - clickable links</a></li><li><a href="http://think-robot.com/2009/04/zend_db_select-multiple-table-joins-explained/" rel="bookmark">Zend_Db_Select multiple table joins explained</a></li><li><a href="http://think-robot.com/2010/09/using-textmate-for-easier-css3/" rel="bookmark">Using TextMate for easier CSS3</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2008/09/how-to-use-special-characters-in-fpdf/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

