$pdf = PDF::loadView('resume.resume',array('resumeData' => $resumeData))->setOption('page-width', 200)->setOption('page-height', 287)->setOption('page-offset', 2);
with page-offset option page number is not display in pdf file
I solved this by appending setOption('footer-right','[page]') to the code line. You can place the page number where you like it, just change the 'fotter-right' for other position. The important point is to add the [page] to the option, so the page number is printed.
By any chance do you know how to set the footer to something like "Page 1 from 2" or something like that?
Yes, just do setOption("footer-right", "Page [page] from [topage]"), where [topage] is the total number of pages of the document.
can [topage] be used in the blade template?
I think that it not possible to use it on blade, since it is a variable managed by wkhtmtopdf during the conversion to pdf, so it is not visible to blade during the preparation of the view that is rendered to a pdf.
How do I get the page numbers in the footer on the right?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy.
If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.
Most helpful comment
I solved this by appending setOption('footer-right','[page]') to the code line. You can place the page number where you like it, just change the 'fotter-right' for other position. The important point is to add the [page] to the option, so the page number is printed.