Invoice variables in mpdf header/footer

Hello, i discovered the mpdf functions $mpdf->SetHTMLHeader and footer, i added them in mpdf_helper and all works. Is it possible to add in that function’s html code invoice variables? like $invoice->user_company and so on? I think the problem is that the create pdf function does not have relative invoice id, any mode to fix that? i need recursive header/footer in my invoices, with client data on them.