How to call Apache FOP from PHP?

liunx

Guest
Hi,

I have installed Apache 2.2.2, PHP 5.1.4, j2ee (java version 1.5.0_03, javac version 1.5.0_06), JavaBridge 3.1.8rc3 and Apache FOP 0.92beta in Window XP SP2.

I can use FOP from command line in server, e.g. c:\fop test.fo test.pdf
I can also use java and javac from command line. Also PHP works with Java normally from browser, e.g.
<?php
java_require('http://Myserver/HelloWorld.jar');
$myObj = new Java('HelloWorld');
echo (String) $myObj->getHelloWorld();
?>
displays correctly "Hello World" into the browser window. Here Helloworld.jar was created from HelloWorld.class
public class HelloWorld {String hw = "Hello World";public String getHelloWorld(){return hw;}}

But the following PHP code
<?php
$pdf = "test.pdf";
$fo = "test.fo";
$options = array($fo,$pdf);
$java = new Java("org.apache.fop.apps.CommandLine", $options);
$java->run();
?>
doesn鎶
 
Back
Top