PDF Generation with Apache FOP

apache_fop_logoI wrote a small PHP class for generation of PDF document using XML,XSL-FO and Apache FOP Generation.

Here is a process outline:

  1. Install Apache FOP on your server;
  2. Edit the relevant path to the executible in the declaration part of the class;
  3. Create XML string;
  4. Create XSL file to convert the XML string to XSL-FO;
  5. Create instance of XMLPDFGeneration class
  6. Set debug flag, fo file output directory and pdf file output directory
  7. Call XMLPDFExecute() function;
  8. You are done – the PDF file is generated;

You can download the code here .

Leave a Reply

Spam Protection by WP-SpamFree