|
From: <php...@li...> - 2008-11-25 12:20:36
|
Hello,
I've installed PHP-Java-Bridge 5.2.2
and would like to create a PDF file using FOP and PHP.
OS: Solaris 10
FOP: version 0.95
PHP: version 5.2.6
Java: jdk1.6.0
Apache: Server Version: Apache/2.2.9
when I run fop form the command line, the PDF file was created.
./fop test.fo test.pdf
But when I created a PHP file, let's say mytest.php as following:
---------------------------
<?php
include_once ("XML/fo2pdf.php");
$pdf = new XML_fo2pdf( );
$pdf->tmpdir = "/tmp";
$pdf->run("/tmp/simple.fo", "/tmp/simple.pdf");
$pdf->printPDF();
$pdf->deletePDF();
?>
---------------------------
I could not see any PDF file in my browser after checking the PHP page
http://my-server/mytest.php
The script exit after executing $pdf->run("/tmp/simple.fo", "/tmp/simple.pdf");
without any errors or warning (I've checked the apache log file, php-java-bridge.log file,phperror logfile)
I have tried the runFromFile and runFromString (in fo2pdf.php) methods they behave the same way.
My question is : is PHP-Java-Bridge 5.2.2 working with FOP 0.95 and PHP 5.2.6, Java_1.6.0 ?
Any help would be appreciated.
BTW, the same script (PHP) is working with:
FOP: 0.20.4, PHP-Java-Bridge-4.0.8a, Java jdk1.5.0_06 (I mean the PDF file has been created).
Al
|
|
From: <php...@li...> - 2008-11-25 20:20:32
|
Hi,
[.. not working]
> FOP: version 0.95
[...but]
> is working with: FOP: 0.20.4,
Umm, you should then report the problem to FOP, then. -- FOP seems to be some PHP extenstion which doesn't have any links to the PHP/Java Bridge.
> is PHP-Java-Bridge 5.2.2 working with FOP 0.95 and PHP 5.2.6, Java_1.6.0 ?
What do you mean with this? Your script doesn't even use java() statements, so how can this be a PHP/Java Bridge problem?
BTW: Since you have Java installed, you may want to check out the itext PDF library instead. It is a very powerful and mature library which can create and even transform PDF in various ways, see our itext examples from the source download for details.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2008-11-26 00:14:28
|
Apache FOP is a Java library which converts XSL-FO to PDF; it is invoked via the Java Bridge from PHP. I run a system (on FreeBSD, but platform doesn't matter) which uses PHP 5.2 and Java Bridge 4.0.8a to call FOP 0.20.5. We don't use the PEAR library XML_fo2pdf like you do, but the code is very simple and thus similar. I've attempted to use FOP 0.95, but in short, FOP broke compatibility between 0.20.x and 0.95. We continue to use 0.20.5 in production simply because it works and there's no need to upgrade. Considering that XML_fo2pdf is out of maintenance by about five years [1], odds are it just doesn't work with FOP 0.95. If you have any true need for FOP 0.95 over 0.20.x, you will need to hack XML_fo2pdf. If you do take the time, I'd suggest posting your patch to the PEAR website when you're finished. Cheers, Patrick van Staveren [1] http://pear.php.net/package/XML_fo2pdf/ php...@li... wrote: > Hi, > > [.. not working] > >> FOP: version 0.95 >> > > [...but] > >> is working with: FOP: 0.20.4, >> > > Umm, you should then report the problem to FOP, then. -- FOP seems to be some PHP extenstion which doesn't have any links to the PHP/Java Bridge. > > > >> is PHP-Java-Bridge 5.2.2 working with FOP 0.95 and PHP 5.2.6, Java_1.6.0 ? >> > > What do you mean with this? Your script doesn't even use java() statements, so how can this be a PHP/Java Bridge problem? > > > BTW: Since you have Java installed, you may want to check out the itext PDF library instead. It is a very powerful and mature library which can create and even transform PDF in various ways, see our itext examples from the source download for details. > > > Regards, > Jost Boekemeier > > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > -- Patrick "Trick" van Staveren http://trick.vanstaveren.us |
|
From: <php...@li...> - 2008-11-26 09:09:47
|
Hello,
thank you for your answer.
> What do you mean with this? Your script doesn't even use java()
> statements, so how can this be a PHP/Java Bridge problem?
My script doesn't use Java, but the PEAR package "XML/fo2pdf.php" does.
The script exited after running:
$options = @new Java("org.apache.fop.apps.CommandLineOptions", $options)
(from fo2pdf.php)
As Patrick said, FOP 0.95 is not compatible with "XML/fo2pdf.php",
therefore I should hack this package or will use the Apache FOP
embedding Fop2PDF.java from:
http://xmlgraphics.apache.org/fop/0.94/embedding.html#ExampleFO2PDF
cheers,
Al
>
--- On Tue, 11/25/08, php...@li... <php...@li...> wrote:
From: php...@li... <php...@li...>
Subject: Re: [Php-java-bridge-users] FOP & PHP-Java-Bridge
To: php...@li...
Date: Tuesday, November 25, 2008, 4:16 PM
Apache FOP is a Java library which converts XSL-FO to PDF; it is invoked
via the Java Bridge from PHP.
I run a system (on FreeBSD, but platform doesn't matter) which uses PHP
5.2 and Java Bridge 4.0.8a to call FOP 0.20.5. We don't use the PEAR
library XML_fo2pdf like you do, but the code is very simple and thus
similar.
I've attempted to use FOP 0.95, but in short, FOP broke compatibility
between 0.20.x and 0.95. We continue to use 0.20.5 in production simply
because it works and there's no need to upgrade. Considering that
XML_fo2pdf is out of maintenance by about five years [1], odds are it
just doesn't work with FOP 0.95.
If you have any true need for FOP 0.95 over 0.20.x, you will need to
hack XML_fo2pdf. If you do take the time, I'd suggest posting your patch
to the PEAR website when you're finished.
Cheers,
Patrick van Staveren
[1] http://pear.php.net/package/XML_fo2pdf/
php...@li... wrote:
> Hi,
>
> [.. not working]
>
>> FOP: version 0.95
>>
>
> [...but]
>
>> is working with: FOP: 0.20.4,
>>
>
> Umm, you should then report the problem to FOP, then. -- FOP seems to be
some PHP extenstion which doesn't have any links to the PHP/Java Bridge.
>
>
>
>> is PHP-Java-Bridge 5.2.2 working with FOP 0.95 and PHP 5.2.6,
Java_1.6.0 ?
>>
>
> What do you mean with this? Your script doesn't even use java()
statements, so how can this be a PHP/Java Bridge problem?
>
>
> BTW: Since you have Java installed, you may want to check out the itext
PDF library instead. It is a very powerful and mature library which can create
and even transform PDF in various ways, see our itext examples from the source
download for details.
>
>
> Regards,
> Jost Boekemeier
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
> Build the coolest Linux based applications with Moblin SDK & win great
prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
--
Patrick "Trick" van Staveren
http://trick.vanstaveren.us
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|