Jump to content

PDFGenerator.php marginFooter set to 0 but still a margin


Blutch_

Recommended Posts

Hello,

I'm trying to add a table at the very end of a a4 paper. 

I modified the invoices tpls files with my custom html.

So I modified in "classes/pdf/PDFGenerator.php"  in function  "writePage()" :

    public function writePage()
    {
        $this->SetHeaderMargin(5);
        $this->SetFooterMargin(0);
        $this->setMargins(10, 40, 10);
        $this->AddPage();
        $this->writeHTML($this->content, true, false, true, false, '');
    }

I set FooterMargin to 0, but as you can see in the file Attached, there is still a margin(see red rectangle) that might be linked to TCPDF but I really don't know how to get rid of this margin !

 

I tried to remove the pagination in the same file "classes/pdf/PDFGenerator.php".



My table has to be at the really end of the paper as it is then scanned and has to respect a specific format....

I can't find any related problems on google, or on this forum...

Would appreciate if someone could help me a bit :)

Have a nice day !
 

MarginWhy.png

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Okay, my problem was linked to TCPDF, here is how I manage to get rid of this extra margin :

I modified in "classes/pdf/PDFGenerator.php"  the function  "writePage()" :

 /**
     * Write a PDF page.
     */
    public function writePage()
    {
        $this->SetHeaderMargin(5);
        $this->SetFooterMargin(0);
        $this->setMargins(10, 40, 10);
        $this->SetAutoPageBreak(TRUE, 0);
        $this->AddPage();
        $this->writeHTML($this->content, true, false, true, false, '');
    }

Might be ugly but fix my problem. 

Solved 
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...