[xep-support] PHP / Java Integration

Wagner, Paul, VF-Group Paul.Wagner at vodafone.com
Mon May 23 12:53:09 PDT 2005


Hi,
 
I try to integrate com.renderx.xep.XSLDriver in my PHP Code like this:
 
$driver = new Java ("com.renderx.xep.XSLDriver");
 
It makes no error!
 
 
But if try to pass some Parameter to the class, for example:
 
$driver = new Java ("com.renderx.xep.XSLDriver","help");
 
I'm getting an error "No matching constructor found in ..."
 
 
How can I solve this Problem?
 
 
In PHP Manual (http://de3.php.net/manual/en/ref.java.php) I've found example for FOP (but it doesn't work with XEP):
 
---------------------------------
This module allows PHP to interact with some interesting pieces of software - for one, it allows PHP to convert XML FO files into PDF/PS/... with the use of Apache FOP processor.
Here's an example:
<?
$basedir = new Java("java.io.File", ".");
$outdir = new Java("java.io.File", "out");
$outdir->mkdirs();

$fofile = new Java("java.io.File", $basedir, "xml/fo/helloworld.fo");
$pdffile = new Java("java.io.File", $outdir, "ResultFO2PDF.pdf");

echo "Input: ".$fofile->toString()."\n";
echo "Output: ".$pdffile->toString()."\n";

$driver = new Java("org.apache.fop.apps.Driver");
$logger = new Java("org.apache.avalon.framework.logger.ConsoleLogger");
$driver->setLogger($logger);
$driver->setRenderer($driver->RENDER_PDF);
$out = new Java("java.io.FileOutputStream", $pdffile);
$driver->setOutputStream($out);
$in = new Java("java.io.FileInputStream", $fofile);
$driver->setInputSource(new Java("org.xml.sax.InputSource", $in));
$driver->run();
$in->close();
$out->close();
?>
---------------------------------
 
Kind regards

Paul Wagner
Service Operations Centre
Global Service Platforms - Operations
Mail:     paul.wagner at vodafone.com <mailto:paul.wagner at vodafone.com> 

Vodafone Deutschland GmbH
Registered Office: Mannesmannufer 2, D-40213 Düsseldorf, Germany
Registered in Germany No. HRB 38062 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20050523/9072e78e/attachment.html>


More information about the Xep-support mailing list