php - Get position of text in mPDF to determine vertical height of HTML element -
i generating pdfs mpdf class , wondering if , how possible determine position of last line of text in document generated mpdf?
i need html box cover in height remaining space between last line of text , bottom margin of document. setting html element height: 100% pushes element new page , covering whole height of new page.
the content of page generated dynamically based on number of factors, can never sure @ vertical position last line at.
if knew vertical position of last line, subtract value total page height , set css element have height.
is possible or there other solutions?
you can use purpose "$mpdf->y" (current position in user unit cell positioning):
$mpdf=new mpdf('', 'a4'); $mpdf->writehtml('line1<pagebreak>line2<br>line3'); // $unusedspaceh = $mpdf->h - $mpdf->y - $mpdf->bmargin; $unusedspacew = $mpdf->w - $mpdf->lmargin - $mpdf->rmargin; // $mpdf->rect($mpdf->x, $mpdf->y, $unusedspacew, $unusedspaceh); $mpdf->output();
Comments
Post a Comment