In the work need to convert Office document software to PDF file, look for a lot of technical discovery use OpenOffice can complete this request, but the function that call it is all Java write, all need to invoke Java class in PHP, have the following debugging process.
1, the installation of Java, this process I do not write, there are a lot of online, speaking also very fine. (In fact, you can not install, I was the original machine on the Java entire directory to save the direct use of the software to achieve green)
2, download Php-java-bridge package. Address: http://sourceforge.net/projects/php-java-bridge/files, download Javabridgetemplate621.war in binary package column. Use WinRAR decompression to find the Javabridge.jar file under Web-inf\lib.
3, use Java.exe to open this file: Java-jar Javabridge.jar (can also use the Javaw.exe after such execution can immediately exit the command window), in the pop-up window select 8080 port.
4, a new PHP file test is successful. The contents of the document are as follows:
<?php
Require_once ("Http://localhost:8080/JavaBridge/java/Java.inc");
$System = Java ("Java.lang.System");
echo $System->getproperties ();
?>
The URL address is included in the above, so you need to set the php.ini file Allow_url_include to ON.
5, edit your own Java class, and use Jar.exe packaging. Put all the required packages in the Jre7/lib/ext directory. (You need to restart Javabridge.jar when a new package is put in.)