我是FPDF的新手。如何使用PHP MySQL创建PDF文件?
但我想下面。如何使用FPDF从HTML标签创建PDF?下面
<?php
require('fpdf.php');
include (connection.php)
$result = mysql_query("SELECT * FROM emp");
<!--- I don't know how to add the html tag here -->
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Output();
?>
是我的PHP程序
<?php
include (connection.php)
$result = mysql_query("SELECT * FROM emp");
?>
<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<?php
while($row = mysql_fetch_array($result))
{
?>
<tr>
<td> <?php print $row['FirstName']; ?></td>
<td> <?php print $row['LastName']; ?></td>
</tr>
<?php
}
?>
</table>
<?php
mysql_close($con);
?>
[How to create a PDF file with PHP?](http://stackoverflow.com/questions/4666171/how-to-create-a-pdf-file-with-php) – 2011-03-18 15:12:51
因为你是对HTML感到舒服,您可能需要考虑[HTML to PDF转换器列表](http://stackoverflow.com/q/3178448/264628)。它不仅涵盖了基于PHP的解决方案,还列出了各种选项。 – BrianS 2011-03-18 18:05:59