Sunday, 25 August 2013

Add image on to dompdf

Add image on to dompdf

<script type="text/php">
if(isset($pdf)){
$w = $pdf->get_width();
$h = $pdf->get_height();
$footer = $pdf->open_object();
global $id
$pdf->image('s/'.$id.'-here.jpg', "jpg", 0, $h - 279, 611, 279);
$pdf->close_object();
$pdf->add_object($footer, "all");
}
</script>
I am trying to add a footer similar image on the end of the page and this
is the only code I actually managed to have the picture on the bottom,
however I got two problems now:
If the tables text (content) of the PHP html goes to long it's hidden by
the image (in this case) i want to break the page and then add the image
in the bottom on the new page.
How can I make it's only added on the last page if there are more than one
by simply the dynamic output I am doing on a table.
Anyway I can overcome the problems above with simply this code? I've been
trying using header/bottom CSSes like
https://code.google.com/p/cleanstickyfooter/ as well but the method above
is working expect the sligh issues just described. THE HTML is simple
tables with a width of 100%...
QUICK update (though)
I think I can solve the first issue by adding a empty div with a set
height of the image, now I would only want to add this onto the last
page... How?

No comments:

Post a Comment