I am working to produce pdf in codeigniter data. All code runs perfectly, it's just that I have a problem when doing a condition for the last page, the question is simple, I have data in table form and I want to display it for the entire page except for the last page.
if ( isset($pdf) ) {
$pdf->page_script('
if ($PAGE_NUM != $PAGE_COUNT) {
$font = $fontMetrics->get_font("Arial, Helvetica, sans-serif", "normal");
$size = 12;
$pageText = "Page " . $PAGE_NUM . " of " . $PAGE_COUNT;
$y = 15;
$x = 520;
$pdf->text($x, $y, $pageText, $font, $size);
}
');
}
i'm tying to change $pageText = "My string text"
and this is working fine, but I got problem when I combine with html table. So in my case I change $pageText to $pageText = "<table><tr><td>My content here</td></tr></table>"
but the results is <table><tr><td>My content here</td></tr></table>
this should be a table, anyone can help me? why the results is still string? and wont generate to be a table?
fyi, the code that I attach is running perfectly to display a page, it's just that I want to modify it so that it displays a table.
from DomPDF display data table except last page
No comments:
Post a Comment