Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.