php - mPDF - get position of element -
can current position (x,y) of element on page?
for example, have this:
$mpdf = new mpdf('', 'a4', 9, 'arial', 7, 7, 8, 18, 0, 6); $mpdf->writehtml('<div id="audit_list"><table>'); $mpdf->writehtml('<tr><td>text 1</td></tr>'); var_dump($mpdf->y); // otput 8 $mpdf->writehtml('<tr><td>text 2</td></tr>'); var_dump($mpdf->y); // otput 8 $mpdf->writehtml('<tr><td>text 3</td></tr>'); var_dump($mpdf->y); // otput 8 $mpdf->writehtml('<tr><td>text 4</td></tr>'); var_dump($mpdf->y); // otput 8 $mpdf->writehtml('</table></div>'); var_dump($mpdf->y); // otput 28.425833333333
why output of table elements <tr><td>
8?
thank much.
$mpdf->x
$mpdf->y
x = horizontal , y = vertical
you can use built-in methods if have older version of mpdf make code clearer:
$mpdf->getx()
$mpdf->gety()
Comments
Post a Comment