PDF Generation with Apache FOP
I wrote a small PHP class for generation of PDF document using XML,XSL-FO and Apache FOP Generation.
Here is a process outline:
- Install Apache FOP on your server;
- Edit the relevant path to the executible in the declaration part of the class;
- Create XML string;
- Create XSL file to convert the XML string to XSL-FO;
- Create instance of XMLPDFGeneration class
- Set debug flag, fo file output directory and pdf file output directory
- Call XMLPDFExecute() function;
- You are done – the PDF file is generated;
You can download the code here .


