Menu

#981 Wrong vertical position of a html table on next pages

v1.0_(example)
closed
None
1
2014-10-03
2014-10-03
No

Good afternoon
In first excuse me for my poor english, I live in Marseille, France

I use Version : 6.0.093
I have just changed an old lib fpdf by your new library tcpdf
Its works fine
I appreciate WiteHtml

I made a test with an invoice containing several lines (screen captures joints)
I can't resolve a problem with a invoice on 2 pages
- The page 1 is Ok
- On the pages 2 and 3, the beginig of the table is printed with a vertical position = 0 insted of 8 cm

The code : I Use TCPDF with a template containing :
- function Header()
- function Body()
- function Footer()
- The header and footer are written with native tcpdf code
- The body is an html table drawn by WiteHtml (Html joint)
- I will be inspired by the Example 48 : http://www.tcpdf.org/examples/example_048.pdf
- In Header(), I put the correct vertical position by using $this->SetY($BodyMin + 2); // 8 cm

I cant give you all the code that draw this document because it take > 1000 lines
But I can give you the mains lines

:::php

// Constants
$MarginL = 10;
$MarginR = 200;
$MarginT = 10;
$BodyMin = 80;
$BodyMax = 20;

class INVOICE extends TCPDF
{
function Header()
{
. . .

$this->SetY($BodyMin + 2);

}

function Body()
{
. . .

$this->SetHeaderMargin($BodyMin);
$this->SetFooterMargin($BodyMax);
$this->SetAutoPageBreak(true, $BodyMax);
$this->SetY($BodyMin + 2);

..

// Here, I design the table in the $Html var

. . .

$this->writeHTML($Html);

}

function Footer()
{
. . .
}
}

Possible cause :
I think when the page break occurs, you draw , in the new page, the beginig of the table in html BEFORE calling Header()
If it is the case, the vertical position is never initialised on the pages 2 and 3

Or I have forgotten a initialization line ?

Thank you for your help
I will really want to use tcpdf

5 Attachments

Discussion

  • Nicola Asuni

    Nicola Asuni - 2014-10-03
    • status: open --> closed
     
  • Nicola Asuni

    Nicola Asuni - 2014-10-03

    This is not a bug but an implementation issue, please ask help on the forum.

     

Log in to post a comment.