Re: [PHP] XSL:FO + PHP

2005-05-06 Thread Dan Rossi

Have you tried this? It seems HTMLDoc is still free... I've used that 
tool
also... pretty satisfied.

http://www.htmldoc.org/software.php

I have used htmldoc in the past for this, but feel its a workaround, 
htmldoc is purely for generating manuals, which is what it does best, i 
wonder if it handles docbook files itself ? However it doesnt render so 
well. FOP is dedicated for this and is cross platform. Htmldoc is 
commercial software now therefore I am the only one with the licence.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] XSL:FO + PHP

2005-05-05 Thread rouvas
On Wednesday 04 May 2005 22:30, Dan Rossi wrote:
 On 05/05/2005, at 1:47 AM, Kristen G. Thorson wrote:
  Dan,
 
  I have done this before, but it was only a proof-of concept excercise
  for me, so my procedure may not work for you.  My test was against an
  Amazon web service and generating a PDF from the XML returned to me.
 
  This method used Apache's FOP.  Before executing the following code, I
  saved the XML returned from Amazon as a temp file ($xmlfile).
 
   $PDFfile = $xmlfile.pdf;
   $callstring = $FOPpath/fop.sh -xsl $xslforoot/$xslfofile -xml
  $xmlfile -pdf $PDFfile;
   $answer = shell_exec( $callstring );
   header( Content-type: $ctype );
   $pieces = explode( /, $xmlfile );
   header( Content-Disposition: attachment; filename=.$pieces[ count(
  $pieces )-1 ] );
   readfile( $xmlfile.pdf );
 
 
  I hope this is helpful to you,
  kgt

 Hi yes this is exactly what i may have to do. I have  tried all the
 usual outlets in terms of subclasses of FPDF , all are limited and
 crappy, it just cant do tables properly. The closest I got was with
 PDML however it was still tedious to build a table with ! Now I think
 processing for such a command line would take forever this is what I
 need to do, a print button displays on the header of a form entry. What
 i need to do is collect the data from that database entry and display
 it as a view with the data rather than the form and make it printable
 in a pdf. This ideally means generate xml from the db entry, save it as
 a file, execute commandline with temp xml file, readfile the pdf. I
 dont think it should take too long to output to the browser right ? I
 think a step i'd like to skip is the readfile, and work out how to send
 to standard output and use passthru ?

 In the past I have used an app called HTMLDoc, its the bomb for making
 pdf manuals with chapters and table of contents. It also requires
 saving a temp html file and then sends the pdf as standard output.
 However HTMLDoc is not free anymore, I only have one licence for that
 to make docs only.

Have you tried this? It seems HTMLDoc is still free... I've used that tool 
also... pretty satisfied.

http://www.htmldoc.org/software.php

-Stathis

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XSL:FO + PHP

2005-05-04 Thread Kristen G. Thorson
Dan,
I'm glad this may work for you.  As far as the speed: it's of course 
difficult to judge, and I certainly didn't test it under any real load, 
but I had no problems creating and serving a several page document with 
graphics in it.  We were testing the concept of something like this for 
a system with a non-public system, so weren't overlly concerned about 
testing the efficiency of this, especially since this wasn't to be our 
final approach.  I'd be interested if you find out more information on 
the subject.

On using passthru:  I do not think FOP has the option to passthru the 
PDF output from the command line call.  It was necessary to save the 
generated PDF and then serve it.  (I haven't double checked, but I think 
I saved the file because I had to.)  Of course FOP is open source so you 
have the opportunity to make it work with you.

kgt
Dan Rossi wrote:
On 05/05/2005, at 1:47 AM, Kristen G. Thorson wrote:


Dan,
I have done this before, but it was only a proof-of concept excercise 
for me, so my procedure may not work for you.  My test was against an 
Amazon web service and generating a PDF from the XML returned to me.

This method used Apache's FOP.  Before executing the following code, 
I saved the XML returned from Amazon as a temp file ($xmlfile).

 $PDFfile = $xmlfile.pdf;
 $callstring = $FOPpath/fop.sh -xsl $xslforoot/$xslfofile -xml 
$xmlfile -pdf $PDFfile;
 $answer = shell_exec( $callstring );
 header( Content-type: $ctype );
 $pieces = explode( /, $xmlfile );
 header( Content-Disposition: attachment; filename=.$pieces[ count( 
$pieces )-1 ] );
 readfile( $xmlfile.pdf );

I hope this is helpful to you,
kgt

Hi yes this is exactly what i may have to do. I have  tried all the 
usual outlets in terms of subclasses of FPDF , all are limited and 
crappy, it just cant do tables properly. The closest I got was with 
PDML however it was still tedious to build a table with ! Now I think 
processing for such a command line would take forever this is what I 
need to do, a print button displays on the header of a form entry. 
What i need to do is collect the data from that database entry and 
display it as a view with the data rather than the form and make it 
printable in a pdf. This ideally means generate xml from the db entry, 
save it as a file, execute commandline with temp xml file, readfile 
the pdf. I dont think it should take too long to output to the browser 
right ? I think a step i'd like to skip is the readfile, and work out 
how to send to standard output and use passthru ?

In the past I have used an app called HTMLDoc, its the bomb for making 
pdf manuals with chapters and table of contents. It also requires 
saving a temp html file and then sends the pdf as standard output. 
However HTMLDoc is not free anymore, I only have one licence for that 
to make docs only.

.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] XSL:FO + PHP

2005-05-04 Thread Dan Rossi
On 05/05/2005, at 5:57 AM, Kristen G. Thorson wrote:
 especially since this wasn't to be our final approach.  I'd be 
interested if you find out more information on the subject.
What did you decide on ?
On using passthru:  I do not think FOP has the option to passthru the 
PDF output from the command line call.  It was necessary to save the 
generated PDF and then serve it.  (I haven't double checked, but I 
think I saved the file because I had to.)  Of course FOP is open 
source so you have the opportunity to make it work with you.

Yeh I want to avoid readfile, my only option is to build my own 
embedded java app which sends the out.byteArray :) This should be a fun 
pet project as i've been wanting to get into java for a while :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] XSL:FO + PHP

2005-05-04 Thread Kristen G. Thorson
Dan Rossi wrote:
On 05/05/2005, at 5:57 AM, Kristen G. Thorson wrote:
 especially since this wasn't to be our final approach.  I'd be 
interested if you find out more information on the subject.

What did you decide on ?

LOL.  That part got beyond me.  I don't understand how all the PDF forms 
stuff works, and I wasn't a part of the implementation of it.  Something 
like XML + FDF = PDF.  We decided against using the XSL:FO because we 
needed to create a form, but this form had an exact layout that we would 
need to emulate, and the other way was the path of least resistance.

kgt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] XSL:FO + PHP

2005-05-04 Thread Dan Rossi
On 05/05/2005, at 7:14 AM, Kristen G. Thorson wrote:
Dan Rossi wrote:
On 05/05/2005, at 5:57 AM, Kristen G. Thorson wrote:
 especially since this wasn't to be our final approach.  I'd be 
interested if you find out more information on the subject.

What did you decide on ?

LOL.  That part got beyond me.  I don't understand how all the PDF 
forms stuff works, and I wasn't a part of the implementation of it.  
Something like XML + FDF = PDF.  We decided against using the XSL:FO 
because we needed to create a form, but this form had an exact layout 
that we would need to emulate, and the other way was the path of least 
resistance.

kgt

a form in a pdf ? Eek ok FDF , do you mean FPDF ? Frankly i find XSL:FO 
easier to code than native FPDF :) Anyway I have started on the FOP 
examples on the apache site and cooking up a java app that can spit out 
the byteArray to the screen as standard out :) It'll do similar to how 
the servlet does it and how php does readfile, dont know of any memory 
issues as I am totally java green :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] XSL:FO + PHP

2005-05-04 Thread Dan Rossi
On 05/05/2005, at 8:28 AM, Dan Rossi wrote:
For any interested parties, there is a tool called html2fo which will 
convert html to a formatted object file which can then be sent to FOP.  
I also found another example where any xhtml file can be transformed 
with a global xsl stylesheet to transform the html firstly to fo. More 
shortly.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] XSL:FO + PHP

2005-05-04 Thread Dan Rossi
On 05/05/2005, at 1:47 AM, Kristen G. Thorson wrote:


Dan,
I have done this before, but it was only a proof-of concept excercise 
for me, so my procedure may not work for you.  My test was against an 
Amazon web service and generating a PDF from the XML returned to me.

This method used Apache's FOP.  Before executing the following code, I 
saved the XML returned from Amazon as a temp file ($xmlfile).

 $PDFfile = $xmlfile.pdf;
 $callstring = $FOPpath/fop.sh -xsl $xslforoot/$xslfofile -xml 
$xmlfile -pdf $PDFfile;
 $answer = shell_exec( $callstring );
 header( Content-type: $ctype );
 $pieces = explode( /, $xmlfile );
 header( Content-Disposition: attachment; filename=.$pieces[ count( 
$pieces )-1 ] );
 readfile( $xmlfile.pdf );

I hope this is helpful to you,
kgt

Hi yes this is exactly what i may have to do. I have  tried all the 
usual outlets in terms of subclasses of FPDF , all are limited and 
crappy, it just cant do tables properly. The closest I got was with 
PDML however it was still tedious to build a table with ! Now I think 
processing for such a command line would take forever this is what I 
need to do, a print button displays on the header of a form entry. What 
i need to do is collect the data from that database entry and display 
it as a view with the data rather than the form and make it printable 
in a pdf. This ideally means generate xml from the db entry, save it as 
a file, execute commandline with temp xml file, readfile the pdf. I 
dont think it should take too long to output to the browser right ? I 
think a step i'd like to skip is the readfile, and work out how to send 
to standard output and use passthru ?

In the past I have used an app called HTMLDoc, its the bomb for making 
pdf manuals with chapters and table of contents. It also requires 
saving a temp html file and then sends the pdf as standard output. 
However HTMLDoc is not free anymore, I only have one licence for that 
to make docs only.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php