Esempio n. 1
0
    $text = 'R&OS';
    $ts = 100 * $factor;
    $th = $pdf->getFontHeight($ts);
    $td = $pdf->getFontDescender($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, $project_url);
    $pdf->restoreState();
    return $height;
}
ros_logo($pdf, 100, $pdf->y - 80, 80, 180, 300);
$pdf->selectFont($mainFont);
if (file_exists('ros.jpg')) {
    $pdf->addJpegFromFile('ros.jpg', 199, 650, 200, 0);
}
if (file_exists('github.jpg')) {
    $pdf->ezSetDy(-30);
    $pdf->addJpegFromFile('github.jpg', 330, $pdf->y);
    $pdf->addLink($project_url . 'pdf-php', 330, $pdf->y, 394, $pdf->y + 64);
}
//-----------------------------------------------------------
// load up the document content
$data = file('./data.txt');
$pdf->ezNewPage();
$pdf->ezStartPageNumbers(intval($pdf->ez['pageWidth'] / 2) + 20, 28, 10, '', '', 1);
$size = 12;
Esempio n. 2
0
    $text = 'R&OS';
    $ts = 100 * $factor;
    $th = $pdf->getFontHeight($ts);
    $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