Hi folks,
A client of mine has an online catalogue (PHP/MySQL) of products for users to browse through. I would like to be able to generate a PDF catalogue from this.
Rather than starting with a blank sheet in PHP and building up the PDF from scratch, I would like to be able to create a template in Word, convert it to PDF and then use PHP to dynamically insert the catalogue data.
Actually, I'd prefer to use OpenOffice so I can save the PDF directly rather than using GhostScript to convert a Word doc to PDF, but this is the real world and my client uses Word.
Anyway. I can use ghost script to (approximately) convert from .doc to .pdf.
The challenge is to somehow use that .pdf to specify global page characteristics - headers, footers, static content, location of dynamic tables, styles for section headings etc etc Basically a pdf template.
What I want from from PHP then is to read in this PDF template, load up product info from a table (product category, product code, name, description, pricing info etc) and insert this data into the pdf in tables, breaking on product category so that each category gets its own table with the category name and description on top. Naturally, this series of tables would need to flow gracefully through page breaks as required.
Should my client want to change the look of the pdf catalogue afterwards, they would only need to upload a new pdf template.
I've trawled through the web looking for tutorials / battle stories based on the above scenario which I would imagine is fairly common, but I haven't found any.
Can anyone here shed any light on this? Have you done something like this?
Thanks,
justsomeone