0

I'm trying to get mPDF number of pages to be saved in a php variable.

$mpdf->setHeader({"nb"});

Is there a way to get the value this outputs in php.

I want to save it in a variable.

halfelf
  • 9,737
  • 13
  • 54
  • 63
  • 2
    Did you check [this link](https://stackoverflow.com/questions/10280595/how-to-get-a-page-count-in-an-mpdf-document) – Niklesh Raut Nov 07 '19 at 08:34
  • First I needed the page number, So I could make a barcode out of it. I managed to do that. The problem was I was trying to make the number four digits, using str_pad() which did not work because the number is given when the document gets compiled. – Gerald Ibra Nov 07 '19 at 13:15

1 Answers1

0

I realized {nb} cannot be modified with php because it gets its value when the pdf gets compiled.