print data as pdf using php
<p>i have a website in that user needs to take report as pdf[in code] , i tried the following code , nut it displayes some special characters , Please help me to fix this issue.</p>

<pre><code>&lt;?php 
require('fpdf.php'); 

//create a FPDF object
$pdf=new FPDF();

//set document properties
$pdf-&gt;SetAuthor('Lana Kovacevic');
$pdf-&gt;SetTitle('FPDF tutorial');

//set font for the entire document
$pdf-&gt;SetFont('Helvetica','B',20);
$pdf-&gt;SetTextColor(50,60,100);

//set up a page
$pdf-&gt;AddPage('P'); 
$pdf-&gt;SetDisplayMode(real,'default');

//insert an image and make it a link
$pdf-&gt;Image('logo.png',10,20,33,0,' ','http://www.fpdf.org/');

//display the title with a border around it
$pdf-&gt;SetXY(50,20);
$pdf-&gt;SetDrawColor(50,60,100);
$pdf-&gt;Cell(100,10,'FPDF Tutorial',1,0,'C',0);

//Set x and y position for the main text, reduce font size and write content
$pdf-&gt;SetXY (10,50);
$pdf-&gt;SetFontSize(10);
$pdf-&gt;Write(5,'Congratulations! You have generated a PDF.');

//Output the document
$pdf-&gt;Output('example1.pdf','I'); 
?&gt; 
</code></pre>

<p>i got the output as below
g  endstream endobj 1 0 obj &lt;> endobj 5 0 obj &lt;> endobj 2 0 obj &lt;&lt; /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] /Font &lt;&lt; /F1 5 0 R >> /XObject &lt;&lt; >> >> endobj 6 0 obj &lt;&lt; /Producer (FPDF 1.6) /Title (FPDF tutorial) /Author (Lana Kovacevic) /CreationDate (D:20100215182640) >> endobj 7 0 obj &lt;&lt; /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 8 0000000000 65535 f 0000000407 00000 n 0000000595 00000 n 0000000204 00000 n 0000000282 00000 n 0000000494 00000 n 0000000699 00000 n 0000000822 00000 n trailer &lt;&lt; /Size 8 /Root 7 0 R /Info 6 0 R >> startxref 925 %%EOF </p>
