function Creport($p, $o) { $this->Cezpdf($p, $o); } } $pdf = new Creport('a4', 'portrait'); $pdf->ezSetMargins(30, 30, 30, 30); $all = $pdf->openObject(); $pdf->saveState(); $pdf->setStrokeColor(0, 0, 0, 1); $pdf->line(30, 60, 565, 60); $pdf->line(30, 780, 565, 780); $pdf->addText(230, 810, 8, 'Berkeley and District Skittles League'); $fixtureString = "Fixtures {$bdslSeason}"; $pdf->addText(255, 800, 8, $fixtureString); $pdf->addJpegFromFile('resource/logo.jpg', 525, 786, 40); $pdf->addText(30, 788, 12, $team); $pdf->addText(30, 50, 8, 'www.berkeleydsl.org.uk'); $pdf->addText(490, 50, 8, $mydate); $pdf->restoreState(); $pdf->closeObject(); $pdf->addObject($all, 'all'); $pdf->ezSetDy(-40); $mainFont = '/pdf/fonts/Helvetica.afm'; $codeFont = '/pdf/fonts/Courier.afm'; $pdf->selectFont($mainFont); $listFile = 'csv/listteam.csv'; $fd = fopen("{$listFile}", "r"); while (!feof($fd)) { $buffer = fgetcsv($fd, 1024); for ($i = 0; $i < 9; ++$i) {
$td = $pdf->getFontDecender($ts); $tw = $pdf->getTextWidth($ts, $text); $pdf->setColor(0.6, 0, 0); $z = 0.86; $pdf->filledRectangle($x - $wl, $y - $z * $h * $factor, $tw * 1.2 + $wr + $wl, $h * $factor * $z); $pdf->setColor(1, 1, 1); $pdf->addText($x, $y - $th - $td, $ts, $text); $pdf->setColor(0.6, 0, 0); $pdf->addText($x, $y - $th - $td, $ts * 0.1, 'http://www.ros.co.nz'); $pdf->restoreState(); return $height; } //ros_logo($pdf,150,$pdf->y-100,80,150,200); $pdf->selectFont($mainFont); if (file_exists('ros.jpg')) { $pdf->addJpegFromFile('ros.jpg', 199, $pdf->y - 100, 200, 0); } else { // comment out these two lines if you do not have GD jpeg support // I couldn't quickly see a way to test for this support from the code. // you could also copy the file from the locatioin shown and put it in the directory, then // the code above which doesn't use GD will be activated. $img = ImageCreatefromjpeg('http://www.ros.co.nz/pdf/ros.jpg'); $pdf->addImage($img, 199, $pdf->y - 100, 200, 0); } //----------------------------------------------------------- // load up the document content $data = file('./data.txt'); // try adding the faq's to the document, this will not work for people re-building the file from the // download as I am not going to put in the faq file with that $faqFile = '../ros/pdf/faqs.inc'; if (file_exists($faqFile)) {