fpdf - going back to the previous page

后端 未结 8 2489
生来不讨喜
生来不讨喜 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条回答
  •  遇见更好的自我
    2021-02-10 16:12

    Just a simple "hack", but data needs to be ordered by page number (not very difficult^ ^ )

    Put in your "for loop" placing data something like :

    // ensure we are on the good page, but fields HAVE TO be ordered by page number
    while($this->fpdf->PageNo() != $myData->getPage()){
        $this->fpdf->AddPage();
    }
    

    And you are done ! No need to alter FPDF :D

提交回复
热议问题