|
Resident Grouch
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 
|
For those who need to do what I needed to do (print good-looking reports or summaries of page content), you might want to try pdf-php. This prepares .pdf pages in a VERY simple manner, using objects. You download this thing, unzip it, and put it in a directory. There is no need for "installation" on a server, or even for modifying the php .ini file. In other words, you can move this up to a site you have no server control over, and use it. It's free. You can find it here. The attached images show the original portion of the web page containing the data, and the resulting pdf output. Here's what the code looks like (disregarding the DB query and other PHP code):
$doc =& new Cezpdf ();
$doc->selectFont('pdf/fonts/Helvetica.afm');
$doc->ezSetMargins(30, 60, 30, 30);
$doc->ezStartPageNumbers (300,15,10,'','',1);
$doc->ezText ($letterhead, "16", array ("justification" => "center"));
$doc->ezSetDy (-5);
$doc->ezText ($header, "14", array ("justification" => "center"));
$doc->ezText ($reportdate, "10", array ("justification" => "center"));
$doc->ezSetDy (-5);
$doc->ezText ($title, "14", array ("justification" => "center"));
$doc->ezText ($sort, "12", array ("justification" => "center"));
$doc->ezSetDy (-10);
$doc->ezColumnsStart();
$doc->ezTable ($theArray, $cols, "", array ('width' => '250',
'cols' => array ('ytdnew' => array ('justification' => 'right'),
'ytdused' => array ('justification' => 'right'),
'ytdtotal' => array ('justification' => 'right'))));
$doc->ezStream (); I am suitably impressed.
|