We need a library for printing invoices, delivery notes, incoming invoice and so on.
The library should print at least pdf files but should be easily expandable to print jpegs, html, or anything else.
For the PDF generation you can use a existing library like pdflib.
The Documents has to be compatible with the german rights, so there are some special abilities that the library need:
1. there are headers and footers that are printed on every single page. But the header nor the footer has only static content. It could be that we have text in our data array that we want to insert into the header or the footer.
2. almost every document has a scroll of articles. This list can expand over multiple pages (between the header and the footer). If a list arrives the end of a page it has to print a sum of the listed articles.
The layout of a document is defined in a xml file. This file defines where a print element (like the customer addressfield) has to be positioned an how the text should be formatted. Also it has to define what the datasource is (this is a key from a array which gets send to the printing library).
An example and specification is attached to this description.
What we have done: writing the xml parser for the template. There are some special things we did with it: it makes no difference if you write
everything is getting into the array key "@conf". just try out the example.