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



Reply via email to