A
A
Anton Vasiliev2021-07-04 22:25:35
PHP
Anton Vasiliev, 2021-07-04 22:25:35

How to get the number of pages (variable) into a variable before generating a file through mpdf?

Good afternoon! How to get the total number of pages (a variable for further processing, output through placeholders is not suitable) that will be generated (or during the formation) through the mpdf library?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adamos, 2021-07-05
@Adamos

And how does anyone, including mpdf, know how many pages your document will spread to before all these calculations are done? Between PDF generation and file output, the number of pages is known:

$mpdf->WriteHTML($html);
$pageCount = $mpdf->page;
$mpdf->Output();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question