3

Possible Duplicate:
Generating PDFs with PHP

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

$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++;    
   }
Community
  • 1
  • 1
Reynan
  • 261
  • 2
  • 9
  • 23

2 Answers2

0

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

B-and-P
  • 1,693
  • 10
  • 26
0

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

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

I like it and the CSS support is very cool.

René Höhle
  • 26,716
  • 22
  • 73
  • 82