简体   繁体   English

html页脚未在mpdf中拉伸

[英]html footer is not stretching in mpdf

Hi I am using mpdf to generate pdfs. 嗨,我正在使用mpdf生成pdf。 My problem is when i was using the following configuration, The header was working fine and stretching based on content, But footer was becoming static and not stretching the when content was more than space for the footer, And if footer content is more, it was cropped. 我的问题是,当我使用以下配置时,页眉工作正常并且可以根据内容进行拉伸,但是当内容大于页脚的空间时,页脚变为静态,而不进行拉伸,如果页脚内容更多,则为裁剪。

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';

}

Please help me in this. 请帮助我。 Thanks in advance.. 提前致谢..

For several reasons, mainly the age of the post, I don't imagine this will help you in particular, but I feel that MPDF's documentation is frustratingly hard to decipher, and hopefully I may be able to help someone is a similar position. 出于多种原因,主要是职位的年龄,我认为这不会对您有什么帮助,但是我认为MPDF的文档很难破译,希望我可以帮助某个类似职位的人。

I see that you've bumped up your $marginFooter value. 我发现您提高了$ marginFooter的价值。 This value seems to be for the space underneath the footer, and will simply slide your footer up into the body of your document. 此值似乎是针对页脚下方的空间的,只会将页脚向上滑动到文档主体中。

The $marginBottom value, however, sets the space allowed under the body, allowing room for your footer. 但是,$ marginBottom值设置了主体下方允许的空间,从而为页脚提供了空间。 I suggest lowering your $marginFooter value, and bumping up your $marginBottom value until your footer clears your body. 我建议降低$ marginFooter的值,并提高$ marginBottom的值,直到页脚清除身体为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM