| 
      
      
      From: <php...@li...> - 2009-04-17 15:36:32
       | 
| I don't think that tools exist which can translate a java example to PHP
code. But since both languages use a similar syntax, you can translate it
yourself. Just use java(...)->... to access a procedure or const within a
class and new java(...) to create an instance.
So the first statements of your code would be (provided that you have copied
the fop libs to the WEB-INF/lib within JavaBridge.war and deployed it):
<?php require_once("http://.../java/Java.inc");
$fopFactory=java("org.apache.fop.apps.FopFactory");
$foUserAgent=$fopFactory->newFoUserAgent();
...
Apr 16, 2009 8:20 nachm. schrieb am <
php...@li...>:
Hello all,
I've installed FOP 0.95 and PHP-Java-Bridge on my Unix server.
I'd like to create a PDF file from FO file using the ExampleFO2PDF.java
from
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup
OS: Solaris 10
Server Version: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7d
Tomcat : Apache Tomact/6.0.16
PHP: version 5.2.9
PHP-Java-Bridge : version 5.4.3.3
I compiled the the ExampleFO2PDF.java => ExampleFO2PDF.class
and then I created a jar file => ExampleFO2PDF.jar
AFAIK, it's possible to call the Java class from a PHP script using
PHP-Java-Bridge.
Is there anyone who already tried to create a PDF file from FO file using
the ExampleFO2PDF.java I mentioned above ?
Any help would be appreciated.
btw, I can create a PDF file using command line:
fop -fo foo.fo -pdf
 foo.pdf
I cann see the pdf file from URL:
http://myhost.com:8080/fop/fop?fo=/opt/coolstack/fop/foo.fo
Al
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
 | 
| 
      
      
      From: <php...@li...> - 2009-04-20 09:16:14
       | 
| Hello,
Thank you for your advice with the class FopFactory (I will try this later).
What do you think about the following PHP script I've created ?
www:root>vi ExampleFO2PDF.php
------------
<?php
  require_once('java/Java.inc');
  $basedir = new Java("java.io.File", ".");
  $outdir = new Java("java.io.File", "out");
  $outdir->mkdirs();
  $fofile = new Java("java.io.File", $basedir, "InputFO2PDF.fo");
  $pdffile = new Java("java.io.File", $outdir, "ResultFO2PDF.pdf");
  echo "Input: ".$fofile->toString()."\n";
  echo "Output: ".$pdffile->toString()."\n";
  $myObject = new Java("embedding.ExampleFO2PDF");
  $myObject->convertFO2PDF($fofile, $pdffile);
?>
---------
When I run from command line: java embedding.ExampleFO2PDF
it's OK:
FOP
 ExampleFO2PDF
Preparing...
Input: XSL-FO (./xml/fo/helloworld.fo)
Output: PDF (./out/ResultFO2PDF.pdf)
Transforming...
PageSequence <no id> generated 1 pages.
PageSequence <no id> generated 1 pages.
Generated 2 pages in total.
Success!
But when I send a request:
http://myhost.com/embedding/ExampleFO2PDF.php
I've got error in PHP error log: phperror.log
---------
[17-Apr-2009 10:10:11] PHP Fatal error:  Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new embedding.ExampleFO2PDF. Cause: java.lang.ClassNotFoundException: embedding.ExampleFO2PDF VM: 1.6.0_10@http://java.sun.com/" at:
----------
The class embedding.ExampleFO2PDF does exist, and is in the right place (in the directory
 $CLASSPATH).
--- On Fri, 4/17/09, php...@li... <php...@li...> wrote:
From: php...@li... <php...@li...>
Subject: Re: [Php-java-bridge-users] ExampleFO2PDF.java & PHP-Java-Bridge
To: php...@li...
Date: Friday, April 17, 2009, 8:36 AM
I don't think that tools exist which can translate a java example to PHP
code. But since both languages use a similar syntax, you can translate it
yourself. Just use java(...)->... to access a procedure or const within a
class and new java(...) to create an instance.
So the first statements of your code would be (provided that you have copied
the fop libs to the WEB-INF/lib within JavaBridge.war and deployed it):
<?php require_once("http://.../java/Java.inc");
$fopFactory=java("org.apache.fop.apps.FopFactory");
$foUserAgent=$fopFactory->newFoUserAgent();
...
Apr 16, 2009 8:20 nachm. schrieb am <
php...@li...>:
Hello all,
I've installed FOP 0.95 and PHP-Java-Bridge on my Unix server.
I'd like to create a PDF file from FO file using the ExampleFO2PDF.java
from
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup
OS: Solaris 10
Server Version: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7d
Tomcat : Apache Tomact/6.0.16
PHP: version 5.2.9
PHP-Java-Bridge : version 5.4.3.3
I compiled the the ExampleFO2PDF.java => ExampleFO2PDF.class
and then I created a jar file => ExampleFO2PDF.jar
AFAIK, it's possible to call the Java class from a PHP script using
PHP-Java-Bridge.
Is there anyone who already tried to create a PDF file from FO file using
the ExampleFO2PDF.java I mentioned above ?
Any help would be appreciated.
btw, I can create a PDF file using command line:
fop -fo foo.fo -pdf
 foo.pdf
I cann see the pdf file from URL:
http://myhost.com:8080/fop/fop?fo=/opt/coolstack/fop/foo.fo
Al
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
      
 | 
| 
      
      
      From: <php...@li...> - 2009-04-20 10:16:16
       | 
| Hi,
If it is true that
  java emb.FPDF
works, then it is also true that:
  java -jar JavaBridge.jar SERVLET:8090 3 jb.log &
  echo '<?php require("http://localhost:8090/JavaBridge/java/Java.inc");java("emb.FPDF")->main(array());?>'
| php -dallow_url_include=On
works.
Everything else is guesswork.
Please copy your classes to JavaBridge.war's WEB-INF/classes and your
libraries to its WEB-INF/lib and re-deploy the modified JavaBridge.war.
After that use the above PHP code to test (change the port nr to 8080 or
whichever port your j2ee server listens on).
There's a user-contributed video on our web site which shows how to work
with tomcat: http://php-java-bridge.sourceforge.net/pjb/installation.php
Regards,
Jost Boekemeier
Apr 20, 2009 11:17 vorm. schrieb am <
php...@li...>:
Hello,
Thank you for your advice with the class FopFactory (I will try this later).
What do you think about the following PHP script I've created ?
www:root>vi ExampleFO2PDF.php
------------
<?php
  require_once('java/Java.inc');
  $basedir = new Java("java.io.File", ".");
  $outdir = new Java("java.io.File", "out");
  $outdir->mkdirs();
  $fofile = new Java("java.io.File", $basedir, "InputFO2PDF.fo");
  $pdffile = new Java("java.io.File", $outdir, "ResultFO2PDF.pdf");
  echo "Input: ".$fofile->toString()."\n";
  echo "Output: ".$pdffile->toString()."\n";
  $myObject = new Java("embedding.ExampleFO2PDF");
  $myObject->convertFO2PDF($fofile, $pdffile);
?>
---------
When I run from command line: java embedding.ExampleFO2PDF
it's OK:
FOP
 ExampleFO2PDF
Preparing...
Input: XSL-FO (./xml/fo/helloworld.fo)
Output: PDF (./out/ResultFO2PDF.pdf)
Transforming...
PageSequence <no id> generated 1 pages.
PageSequence <no id> generated 1 pages.
Generated 2 pages in total.
Success!
But when I send a request:
http://myhost.com/embedding/ExampleFO2PDF.php
I've got error in PHP error log: phperror.log
---------
[17-Apr-2009 10:10:11] PHP Fatal error:  Uncaught
[[o:Exception]:"java.lang.Exception: CreateInstance failed: new
embedding.ExampleFO2PDF. Cause: java.lang.ClassNotFoundException:
embedding.ExampleFO2PDF VM: 1.6.0_10@http://java.sun.com/" at:
----------
The class embedding.ExampleFO2PDF does exist, and is in the right place (in
the directory
 $CLASSPATH).
--- On Fri, 4/17/09, php...@li... <
php...@li...> wrote:
From: php...@li... <
php...@li...>
Subject: Re: [Php-java-bridge-users] ExampleFO2PDF.java & PHP-Java-Bridge
To: php...@li...
Date: Friday, April 17, 2009, 8:36 AM
I don't think that tools exist which can translate a java example to PHP
code. But since both langu...
 | 
| 
      
      
      From: <php...@li...> - 2009-04-21 09:40:30
       | 
| Hello Jost,
thank you very much for your advice.
I've tried to put my class (ExampleFO2PDF.class) to 
/opt/coolstack/tomcat6/webapps/JavaBridge/WEB-INF/classes
(since I'm running Tomcat port 8080), but still without success.
I've still got error :  java.lang.ClassNotFoundException:embedding.ExampleFO2PDF
It seems, I have problem with the Java classes, I'm not expert in Java,
hence I will learn, how to create/modify classes/classpath in Java, then I will try again
this example.
thank you for your help.
Al
--- On Mon, 4/20/09, php...@li... <php...@li...> wrote:
From: php...@li... <php...@li...>
Subject: Re: [Php-java-bridge-users] ExampleFO2PDF.java & PHP-Java-Bridge
To: php...@li...
Date: Monday, April 20, 2009, 3:16 AM
Hi,
If it is true that
  java emb.FPDF
works, then it is also true that:
  java -jar JavaBridge.jar SERVLET:8090 3 jb.log &
  echo '<?php require("http://localhost:8090/JavaBridge/java/Java.inc");java("emb.FPDF")->main(array());?>'
| php -dallow_url_include=On
works.
Everything else is guesswork.
Please copy your classes to JavaBridge.war's WEB-INF/classes and your
libraries to its WEB-INF/lib and re-deploy the modified JavaBridge.war.
After that use the above PHP code to test (change the port nr to 8080 or
whichever port your j2ee server listens on).
There's a user-contributed video on our web site which shows how to work
with tomcat: http://php-java-bridge.sourceforge.net/pjb/installation.php
Regards,
Jost Boekemeier
Apr 20, 2009 11:17 vorm. schrieb am <
php...@li...>:
Hello,
Thank you for your advice with the class FopFactory (I will try this later).
What do you think about the following PHP script I've created ?
www:root>vi ExampleFO2PDF.php
------------
<?php
  require_once('java/Java.inc');
  $basedir = new Java("java.io.File", ".");
  $outdir = new Java("java.io.File", "out");
  $outdir->mkdirs();
  $fofile = new Java("java.io.File", $basedir, "InputFO2PDF.fo");
  $pdffile = new Java("java.io.File", $outdir, "ResultFO2PDF.pdf");
  echo "Input: ".$fofile->toString()."\n";
  echo "Output: ".$pdffile->toString()."\n";
  $myObject = new Java("embedding.ExampleFO2PDF");
  $myObject->convertFO2PDF($fofile, $pdffile);
?>
---------
When I run from command line: java embedding.ExampleFO2PDF
it's OK:
FOP
 ExampleFO2PDF
Preparing...
Input: XSL-FO (./xml/fo/helloworld.fo)
Output: PDF (./out/ResultFO2PDF.pdf)
Transforming...
PageSequence <no id> generated 1 pages.
PageSequence <no id> generated 1 pages.
Generated 2 pages in total.
Success!
But when I send a request:
http://myhost.com/embedding/ExampleFO2PDF.php
I've got error in PHP error log: phperror.log
---------
[17-Apr-2009 10:10:11] PHP Fatal error:  Uncaught
[[o:Exception]:"java.lang.Exception: CreateInstance failed: new
embedding.ExampleFO2PDF. Cause: java.lang.ClassNotFoundException:
embedding.ExampleFO2PDF VM: 1.6.0_10@http://java.sun.com/" at:
----------
The class embedding.ExampleFO2PDF does exist, and is in the right place (in
the directory
 $CLASSPATH).
--- On Fri, 4/17/09, php...@li... <
php...@li...> wrote:
From: php...@li... <
php...@li...>
Subject: Re: [Php-java-bridge-users] ExampleFO2PDF.java & PHP-Java-Bridge
To: php...@li...
Date: Friday, April 17, 2009, 8:36 AM
I don't think that tools exist which can translate a java example to PHP
code. But since both langu...
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
      
 |