0

Can anyone help me to add a footer in pdf generation using headless chrome??

I used headless chrome which generates pdf from HTML file. This process happens in the background of laravel.

Every thing works fine but don't know how to add custom footer with page number.

Nima Patel
  • 296
  • 6
  • Not sure what you are using exactly but I use the chrome remote interface and the code at https://stackoverflow.com/a/49147539/487813 (also not sure why this is tagged PHP and Laravel) – apokryfos Oct 14 '22 at 08:02
  • Using headless chrome is like telling chrome to print to a pdf. You should check chrome printing options. But I think you can only turn on/off footer/header printing: https://support.google.com/chrome/thread/104293547/hello-how-can-i-edit-my-headers-and-footers?hl=en If you need a more flexible way to make the pdf consider using one of the php library like FPDF or TCPDF. Alternatively, you can edit the chrome pdf file with one of the above library and add the footer you need – Roberto Braga Oct 14 '22 at 08:15
  • Does this answer your question? [Alter the default header/footer when printing to PDF](https://stackoverflow.com/questions/44575628/alter-the-default-header-footer-when-printing-to-pdf) – ASHu2 Oct 18 '22 at 07:03

0 Answers0