0

I am trying to create invoice and exporting in pdf using DOMPDF. Where I am stuck is, the table I am using to display product details, is just remaining till rows only, where I want it to add blank rows till new footer div comes up

Current Invoice :

enter image description here

What I want :

enter image description here

I am using Code Igniter and DOMPDF

I have already tried foreach ($rows as $row):{}

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
NaikNiket
  • 29
  • 1
  • 5

1 Answers1

0

This isn't really something you can do with Dompdf. What you would have to do is determine how many rows fit on a page then just add more rows using PHP before you give the document to Dompdf. The only way this would really be feasible would be if the height of the rows was known in advance.

BrianS
  • 13,284
  • 15
  • 62
  • 125
  • There is the possibility doing this in two passes. You could use callbacks in the first pass to determine the height of the table. Then add sufficient rows to fill the space for the second pass. I leave this as an exercise for the reader (thus not part of the answer). – BrianS Aug 09 '17 at 23:11