簡體   English   中英

html頁腳未在mpdf中拉伸

[英]html footer is not stretching in mpdf

嗨,我正在使用mpdf生成pdf。 我的問題是,當我使用以下配置時,頁眉工作正常並且可以根據內容進行拉伸,但是當內容大於頁腳的空間時,頁腳變為靜態,而不進行拉伸,如果頁腳內容更多,則為裁剪。

class MyPDF extends mPDF {
    protected $pdfFileName;
    private $PDFExtension = '.pdf';
    protected  $downloadPDFMode = 'D';
    protected $pdfDownloadModes = array('D', 'F', 'S');
    private $pdfPath = 'test/';
    private $pdfMode = ''; //For loading fonts
    private $pageFormat = 'A4'; //Default A4 size
    private $marginLeft = 5;
    private $marginRight = 5;
    private $marginTop = 5;
    private $marginBottom = 5;
    private $marginHeader = 9;
    private $marginFooter = 35;
    private $javascript;
    private $n_js;

function __construct() {
    parent::mPDF($this->pdfMode, $this->pageFormat, '', '',$this->marginLeft,$this->marginRight, $this->marginTop, $this->marginBottom, $this->marginHeader, $this->marginFooter);
    parent::SetAutoFont(AUTOFONT_ALL);
    $this->setAutoTopMargin = true;
    $this->setAutoBottomMargin = 'stretch';

}

請幫助我。 提前致謝..

出於多種原因,主要是職位的年齡,我認為這不會對您有什么幫助,但是我認為MPDF的文檔很難破譯,希望我可以幫助某個類似職位的人。

我發現您提高了$ marginFooter的價值。 此值似乎是針對頁腳下方的空間的,只會將頁腳向上滑動到文檔主體中。

但是,$ marginBottom值設置了主體下方允許的空間,從而為頁腳提供了空間。 我建議降低$ marginFooter的值,並提高$ marginBottom的值,直到頁腳清除身體為止。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM