<?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>WEB-NES-BAY &#187; Pdf Header</title>
	<atom:link href="http://webnesbay.com/tag/pdf-header/feed/" rel="self" type="application/rss+xml" />
	<link>http://webnesbay.com</link>
	<description>Learn Tips and tricks on Linux, Hacking, linux, PHP, Perl, Web, Hardware</description>
	<lastBuildDate>Sun, 11 Apr 2010 05:12:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add text and images to PDF using PHP</title>
		<link>http://webnesbay.com/add-text-and-images-to-pdf-using-php/</link>
		<comments>http://webnesbay.com/add-text-and-images-to-pdf-using-php/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 12:04:44 +0000</pubDate>
		<dc:creator>WEBNESBAY</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[add text]]></category>
		<category><![CDATA[Fpdf]]></category>
		<category><![CDATA[Fpdi]]></category>
		<category><![CDATA[Header Logo]]></category>
		<category><![CDATA[Image Logo]]></category>
		<category><![CDATA[Pdf Files]]></category>
		<category><![CDATA[Pdf Header]]></category>
		<category><![CDATA[Php Class]]></category>
		<category><![CDATA[Php Pdf]]></category>
		<category><![CDATA[Png]]></category>
		<category><![CDATA[Setfont]]></category>
		<category><![CDATA[Text Images]]></category>
		<category><![CDATA[Zlib]]></category>

		<guid isPermaLink="false">http://webnesbay.com/?p=409</guid>
		<description><![CDATA[FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library.
FPDF requires no extension (except zlib to activate compression and GD for GIF support). It works with PHP 4 and PHP 5 (the latest version requires at least PHP 4.3.10).
Using FPDF I will demonstrate hpw to add images and text. Firstly we need to download the library from the below mentioned URL&#8217;s
http://www.fpdf.org/
http://fpdi.setasign.de/index.php?p=home
Extract both packages in same folder and [...]


Related posts:<ol><li><a href='http://webnesbay.com/generating-pdf-files-with-php-and-fpdf/' rel='bookmark' title='Permanent Link: Generating PDF files with PHP and FPDF'>Generating PDF files with PHP and FPDF</a></li>
<li><a href='http://webnesbay.com/php-text-animation-tutorial/' rel='bookmark' title='Permanent Link: PHP Text Animation Tutorial And Example'>PHP Text Animation Tutorial And Example</a></li>
<li><a href='http://webnesbay.com/solve-cannot-modify-header-information-headers-already-sent/' rel='bookmark' title='Permanent Link: Solve: Cannot modify header information &#8211; headers already sent'>Solve: Cannot modify header information &#8211; headers already sent</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library.</p>
<p>FPDF requires no extension (except zlib to activate compression and GD for GIF support). It works with PHP 4 and PHP 5 (the latest version requires at least PHP 4.3.10).</p>
<p>Using FPDF I will demonstrate hpw to add images and text. Firstly we need to download the library from the below mentioned URL&#8217;s</p>
<p><a href="http://www.fpdf.org/">http://www.fpdf.org/</a></p>
<p><a href="http://fpdi.setasign.de/index.php?p=home">http://fpdi.setasign.de/index.php?p=home</a></p>
<p>Extract both packages in same folder and put the pdf in the same folder and name it as mypdf.pdf</p>
<p>Now we will create a script that will add text to pdf.</p>
<p>&lt;?php</p>
<p>define(&#8216;FPDF_FONTPATH&#8217;,'font/&#8217;);<br />
require(&#8216;fpdi.php&#8217;);</p>
<p>class PDF extends fpdi<br />
{<br />
//PDF Header<br />
function Header()<br />
{<br />
//Logo<br />
//$this-&amp;gt;Image(&#8216;logo.png&#8217;,10,8,33);<br />
//Verdana bold 15<br />
//$this-&amp;gt;SetFont(&#8216;Verdana&#8217;,'B&#8217;,15);<br />
//Move to the right<br />
//$this-&amp;gt;Cell(80);<br />
//Adding Title<br />
//$this-&amp;gt;Cell(30,10,&#8217;This is the title&#8217;,1,0,&#8217;C');<br />
//Line break<br />
//$this-&amp;gt;Ln(20);<br />
}</p>
<p>//PDF footer<br />
function Footer()<br />
{<br />
//Positioning 1.5 cm from bottom<br />
$this-&amp;gt;SetY(-15);<br />
//Verdana italic 8<br />
$this-&amp;gt;SetFont(&#8216;Verdana&#8217;,'I&#8217;,8);<br />
//Page number<br />
$this-&amp;gt;Cell(0,10,&#8217;This document was downloaded at &#8216;.date(&#8220;G:i T&#8221;, time()).&#8217; on &#8216;.date(&#8220;l F jS Y&#8221;, time()).&#8217;. This document is only valid for 24 hours from this date.&#8217;,0,0,&#8217;C');<br />
}<br />
}</p>
<p>$pdf= new PDF();</p>
<p>$pagecount = $pdf-&amp;gt;setSourceFile(&#8220;mypdf.pdf&#8221;);</p>
<p>for ($i=1; $i &amp;lt;= $pagecount; $i++) {</p>
<p>$tplidx = $pdf-&amp;gt;ImportPage(1);</p>
<p>$pdf-&amp;gt;addPage();<br />
$pdf-&amp;gt;useTemplate($tplidx,0,0,0);<br />
}</p>
<p>$pdf-&amp;gt;Output(&#8220;newpdf.pdf&#8221;,&#8221;I&#8221;);</p>
<p>?&gt;</p>
<p>The above script is more easy and explanatory. You can refer more about the function in the URL <a href="http://www.fpdf.org/">http://www.fpdf.org/</a></p>


<p>Related posts:<ol><li><a href='http://webnesbay.com/generating-pdf-files-with-php-and-fpdf/' rel='bookmark' title='Permanent Link: Generating PDF files with PHP and FPDF'>Generating PDF files with PHP and FPDF</a></li>
<li><a href='http://webnesbay.com/php-text-animation-tutorial/' rel='bookmark' title='Permanent Link: PHP Text Animation Tutorial And Example'>PHP Text Animation Tutorial And Example</a></li>
<li><a href='http://webnesbay.com/solve-cannot-modify-header-information-headers-already-sent/' rel='bookmark' title='Permanent Link: Solve: Cannot modify header information &#8211; headers already sent'>Solve: Cannot modify header information &#8211; headers already sent</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webnesbay.com/add-text-and-images-to-pdf-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
