Jump to content

PHP PDF Table


dizzy1

Recommended Posts

php PDF_new table

 

Hi Im trying to display a table using PHP's PDF SO far i got. It creates the pdf but not the table.

 

<?php
    $myReport  = " <table align='Center'>   ";						
$myReport .= " <tr> ";	
$myReport .= " <td> ";	
$myReport .= " erer";	
$myReport .= " </td>";	
$myReport .= " </tr>";	
$myReport .= " </table>";	

$mypdf = PDF_new();
PDF_open_file($mypdf, "");
PDF_begin_page($mypdf, 595, 842);
$myfont = PDF_findfont($mypdf, "Times-Roman", "host", 0);
PDF_setfont($mypdf, $myfont, 10);







PDF_show_xy($mypdf, "Sample PDF, constructed by PHP in real-time.", 50, 750);
PDF_show_xy($mypdf, "$myReport ", 50, 730);






PDF_end_page($mypdf);
PDF_close($mypdf);

$mybuf = PDF_get_buffer($mypdf);
$mylen = strlen($mybuf);
header("Content-type: application/pdf");
header("Content-Length: $mylen");
header("Content-Disposition: inline; filename=Fountain_Report.pdf");
print $mybuf;

PDF_delete($mypdf);
?>

Link to comment
https://forums.phpfreaks.com/topic/147039-php-pdf-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.