Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the total number of pages in DOMPDF?

Tags:

php

dompdf

For example Page 1 of 5.

There's an example online of how to get teh Page 1 part but not the of 5 part. This is it:

.pagenum:before { content: "Page " counter(page); }

I'm using version 0.6 and $PAGE_NUM and $PAGE_COUNT does not work.

like image 982
Pedro Avatar asked Mar 30 '11 12:03

Pedro


1 Answers

By default, inline PHP is disabled for security reasons, you need to enable it yourself in dompdf_config.custom.inc.php. See here.

For now, total page count is not supported with the CSS you are using, we are planning to make it work in 0.6 final though.

like image 118
Fabien Ménager Avatar answered Sep 21 '22 09:09

Fabien Ménager