fpdf - going back to the previous page

后端 未结 8 2484
生来不讨喜
生来不讨喜 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:08

    if(!empty($this->replace) && !empty($this->replacement)){
        $this->pages[$n]=str_replace($this->replace,$this->replacement,$this->pages[$n]);
    }
    

    I added this code to the fpdf class in _putpages() right under /Page content line 2851

    Example after adding above to code:

    $pdf->replace = array("{paid_msg}","{balance}");
    $pdf->replacement = array("Paid","0.00");
    

    It can be a string or an array.

提交回复
热议问题