Problem/Motivation
In many applications that generate PDF documents dynamically, including invoices, reports, or manuals, providing clear navigation and reference is essential for readability and professionalism. PhpWkhtmlToPdf is a widely used PHP library that converts HTML content into PDF files, but by default, it does not automatically include page numbers in the footer. This limitation can make long documents difficult to follow, especially when users need to reference specific sections or pages. Therefore, there is a clear need to implement a solution that allows dynamic insertion of page numbers in the PDF footer, ensuring each page is correctly labeled and enhancing the usability and accessibility of the generated documents.
Proposed resolution
To address the need for page numbers in PDF documents, we propose enhancing the PhpWkhtmlToPdf configuration by adding a checkbox in the settings form that allows users to enable or disable the footer page number feature. When enabled, the library will automatically insert page numbers in the footer of every PDF page, improving document navigation and readability. When disabled, the PDF will be generated without page numbers, giving users full control over the document layout. This approach provides a flexible, user-friendly solution that accommodates different use cases while maintaining simplicity in the configuration interface.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2025-08-25 at 2.01.59 PM.png | 227.68 KB | gustavorf90 |
Issue fork entity_print-3543017
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments