I have been tasked with automating the invoicing system at our company. Currently, all data is stored in a local MySQL database and someone manually updates an Excel spreadsheet, which is then merged into a MS Word template for generating invoices. The objective is to streamline this process by allowing the invoice to be generated as a PDF directly from our intranet website.
Originally, my plan was to create an HTML/CSS template and utilize wkhtmltopdf to generate the PDF. However, I encountered issues with creating repeatable headers and footers on each page using Webkit, as thead
and tfoot
are not supported. Even after attempting solutions suggested in discussions like this one, the problem persisted.
This led me to considering XML and XSL-FO, although I am unfamiliar with the latter. Could this be the best approach? Are there any tools or libraries available to simplify the conversion of my HTML+CSS to XML+XSL-FO? Is there perhaps another alternative solution that I have overlooked?
UPDATE
Currently, our server runs on CentOS Linux with a MySQL database. All existing code is written in PHP, though there may be changes as we revamp the entire system. It is likely that Linux and MySQL will continue to be integral components moving forward.