Get PDF output from XML generated by a PHP file and translated with an XSLT

vicious

New Member
I've used a couple of days to think of a best practice to generate a PDF, which end users can customize the layout for themselves. The PDF output needs to be saved on the server or sent back to the PHP file so the PHP file can save it, and the PHP file needs to know that it went OK. I thought the best way to do this was to use XML, XSLT and Apache Cocoon. But I'm not sure if this is possible or if it's a good idea since I can't find any information of people doing anything similar. It cannot be an uncommon problem. The idea came when I read about Cocoon converting XML through XSLT to PDF: http://cocoon.apache.org/2.1/howto/howto-html-pdf-publishing.htmland being able to take in variables:http://old.nabble.com/how-to-access-post-parameters-from-sitemap-td31478752.htmlThis is what I had in mind:[*]A php file gets called by a user, the php file generates a source XML file with a specific name[*]The php file then makes a request to Cocoon (on the same web server) to apply the user defined XSLT on the XML file. A parameter will be needed here to know which XSLT to apply. [*]The request is handled by the PHP file and then saved as a PDF on the server, and can later be mailed away. Will this work at all? Is there a better way to handle this?The core problem is that the users need to be able to customize the layout on the PDFs themselves, and I need the server to save the PDF and to mail it later on. The users will use it for order confirmations, invoices, etc. And I wouldn't like to hard code the layout for each user.
 
Back
Top