如何在PHP中将数据从表传输到pdf [重复]

时间:2022-01-10 23:04:30

Possible Duplicate:
Generating PDFs with PHP

可能重复:使用PHP生成PDF

how to transfer data from table to pdf? or is there other ways to print reports from table this is my current table i want it to transfer on pdf

如何将数据从表格传输到PDF格式?或者是否有其他方法从表中打印报告这是我目前的表格,我希望它在pdf上传输

$tbl_select_exp=mysql_query("select * from expeditures where Date between '$date1' and '$date2' and active= '1' order by        Date ASC"); 
    while($test = mysql_fetch_array($tbl_select_exp))
   {
    ?><tr id="<?php  echo  $test['ExpenseID'] ?>" onclick="a(this.id); myfunction(this)">
    <?php
    echo"<td>".$test['Date']."</td>";
    echo"<td>".$test['ORno']."</td>";
    echo"<td>".$test['AccountName']."</td>";
    echo"<td>".$test['Amount']."</td>";
    echo "</tr>";   
    $test++;    
   }

2 个解决方案

#1


0  

For simple PDF take a look at FPDF library, for more advanced features check tcPDF and mPDF.

对于简单的PDF,请查看FPDF库,了解更多高级功能,检查tcPDF和mPDF。

#2


0  

I use wkhtmltopdf its a very simple command line tool which makes a pdf file from your HTML sources.

我使用wkhtmltopdf这是一个非常简单的命令行工具,它可以从HTML源代码生成pdf文件。

From your script you can call it with exec or you can google for helper classes.

从你的脚本你可以用exec调用它,或者你可以google帮助类。

I like it and the CSS support is very cool.

我喜欢它,CSS支持非常酷。

#1


0  

For simple PDF take a look at FPDF library, for more advanced features check tcPDF and mPDF.

对于简单的PDF,请查看FPDF库,了解更多高级功能,检查tcPDF和mPDF。

#2


0  

I use wkhtmltopdf its a very simple command line tool which makes a pdf file from your HTML sources.

我使用wkhtmltopdf这是一个非常简单的命令行工具,它可以从HTML源代码生成pdf文件。

From your script you can call it with exec or you can google for helper classes.

从你的脚本你可以用exec调用它,或者你可以google帮助类。

I like it and the CSS support is very cool.

我喜欢它,CSS支持非常酷。