$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)) { // then the file is there. $data[] = "#NP\n"; $data[] = "1<FAQs>\n"; include $faqFile; foreach ($faqs as $v) { $data[] = "2<" . $v['t'] . ">\n"; // these are some VERY rough conversions, I am not recommending others do this