fpdf - going back to the previous page

后端 未结 8 2485
生来不讨喜
生来不讨喜 2021-02-10 15:45

I am generating pdf invoice using fpdf.

Some invoices containing many items, and details need to go into the second page. However, I need the total, and other details

8条回答
  •  -上瘾入骨i
    2021-02-10 16:07

    FPDF doesn't allow you to go back to a previous page. Once you're done with a page - either by calling AddPage() or by running out of space when SetAutoPageBreak() is turned on - you're done with it.

    The workaround is to generate your document without the total, write it to a temporary file then load it back (using FPDI: http://www.setasign.de/products/pdf-php-solutions/fpdi/) and add the total in the correct place.

提交回复
热议问题