本文整理汇总了PHP中FPDF::SetTextColor方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::SetTextColor方法的具体用法?PHP FPDF::SetTextColor怎么用?PHP FPDF::SetTextColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDF
的用法示例。
在下文中一共展示了FPDF::SetTextColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: post_id_upc_terms_handler
public function post_id_upc_terms_handler()
{
$this->id = preg_split('/[^\\d]/', $this->id, 0, PREG_SPLIT_NO_EMPTY);
$pdf = new FPDF('P', 'mm', 'Letter');
$pdf->SetMargins(6.35, 6.35, 6.35);
// quarter-inch margins
$pdf->SetAutoPageBreak(false);
$pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
$pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
$margins = $pdf->GetMargins();
$margins['top'] = 0.0;
$check_left_x = $margins['left'] > 3.175 ? $margins['right'] : 3.175 - $margins['left'];
$real_check_top_y = 183.675 - $margins['top'];
$check_right_x = 203.2 - $margins['left'];
$real_check_bottom_y = 255.112 - $margins['top'];
$line_height = 5;
$envelope_window_tab = 15;
$right_col1 = 130;
$right_col2 = 170;
$my_address = array('610 E 4th St', 'Duluth, MN 55805', 'Tel: 218.728.0884', 'www.wholefoods.coop');
$check_date = date('F j, Y');
$dbc = $this->connection;
$dbc->setDefaultDB($this->config->get('OP_DB'));
$signage = new COREPOS\Fannie\API\item\FannieSignage(array());
foreach ($this->id as $card_no) {
$pdf->AddPage();
$account = \COREPOS\Fannie\API\member\MemberREST::get($card_no);
$primary = array();
foreach ($account['customers'] as $c) {
if ($c['accountHolder']) {
$primary = $c;
break;
}
}
$check_number = rand(100000, 999995);
for ($i = 0; $i < 3; $i++) {
$pdf->SetFont('Gill', '', 10);
$check_top_y = $real_check_top_y - $i * 90;
$check_bottom_y = $real_check_bottom_y - $i * 90;
$pdf->SetXY($check_left_x, $check_top_y);
$pdf->Ln($line_height * 4.25);
foreach ($my_address as $line) {
$pdf->SetX($check_left_x + $envelope_window_tab + 20);
if ($line == 'www.wholefoods.coop') {
$pdf->SetFont('Gill', 'B', 9);
}
$pdf->Cell(0, $line_height, $line, 0, 1);
}
$pdf->SetFont('Gill', 'B', 10);
$pdf->SetXY($check_left_x + $right_col1, $check_top_y);
$pdf->Cell(30, $line_height, 'Check Number:', 0, 0, 'R');
$pdf->SetFont('Gill', '', 10);
$pdf->SetTextColor(0xff, 0x58, 0);
$pdf->SetX($check_left_x + $right_col2);
$pdf->Cell(30, $line_height, $check_number, 0, 0, 'R');
$pdf->SetFont('Gill', 'B', 10);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY($check_left_x + $right_col1, $check_top_y + 1.5 * $line_height);
$pdf->Cell(30, $line_height, 'Date:', 0, 0, 'R');
$pdf->SetFont('Gill', '', 10);
$pdf->SetTextColor(0xff, 0x58, 0);
$pdf->SetX($check_left_x + $right_col2);
$pdf->Cell(30, $line_height, $check_date, 0, 0, 'R');
$pdf->SetXY($check_left_x + $right_col1, $check_top_y + 3 * $line_height);
$pdf->SetFont('Gill', 'B', 10);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(30, $line_height, 'Amount:', 0, 0, 'R');
$pdf->SetXY($check_left_x + $right_col1 + 30, $check_top_y + 3 * $line_height);
$pdf->SetFont('Gill', '', 10);
$pdf->SetTextColor(0xff, 0x58, 0);
$pdf->MultiCell(40, $line_height, str_repeat(' ', 2) . $this->terms, 0, 'R');
$pdf->SetTextColor(0, 0, 0);
$their_address = array($primary['firstName'] . ' ' . $primary['lastName']);
$their_address[] = $account['addressFirstLine'];
if ($account['addressSecondLine']) {
$their_address[] = $account['addressSecondLine'];
}
$their_address[] = $account['city'] . ', ' . $account['state'] . ' ' . $account['zip'];
$pdf->SetXY($check_left_x + $envelope_window_tab, $check_top_y + 11 * $line_height);
$pdf->SetFont('Gill', 'B', 10);
foreach ($their_address as $line) {
$pdf->SetX($check_left_x + $envelope_window_tab);
$pdf->Cell(0, $line_height, $line, 0, 1);
}
$pdf->SetFont('Gill', '', 10);
$pdf->SetXY($check_left_x, $check_bottom_y + $line_height - 1);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Gill', 'B', 10);
$pdf->Cell(0, $line_height, 'Redeemable only at Whole Foods Co-op', 0, 0, 'C');
$pdf->SetFont('Gill', '', 10);
$pdf->SetXY($check_left_x + 145, $check_top_y + 6 * $line_height + 1);
$pdf->SetFont('Gill', '', 8);
$pdf->MultiCell(50, $line_height - 2, 'Limit one per day. Cannot be applied to previous purchases. No cash value.');
$pdf->SetFont('Gill', '', 10);
$pdf->SetFillColor(0xcc, 0xcc, 0xcc);
$pdf->Rect($check_left_x + 84, $check_top_y + 28, 39, 15, 'F');
$pdf->SetFillColor(0, 0, 0);
$signage->drawBarcode(ltrim($this->upc, '0'), $pdf, $check_left_x + 87, $check_top_y + 30, array('height' => 11, 'fontsize' => 0));
$pdf->Image('logo.rgb.noalpha.png', $check_left_x + $envelope_window_tab, $check_top_y + 20, 20);
$pdf->SetFont('Gill', 'B', '31');
//.........这里部分代码省略.........
示例2: generarFolleto
public function generarFolleto()
{
$concursos = $this->concursoMapper->findConcurso("pinchosOurense");
$establecimientos = $this->establecimientoMapper->findAllValidados();
$pinchos = $this->pincho->all();
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 30);
$pdf->SetTextColor(85, 53, 20);
$pos_y = 10;
$pdf->Cell(0, 24, $concursos->getNombre(), 0, 0, "L");
$pdf->Ln();
$pdf->SetFont('Arial', '', 16);
$pdf->SetTextColor(0, 0, 0);
$pdf->MultiCell(0, 6, $concursos->getDescripcionConcurso(), 0, "L");
$pdf->SetTextColor(85, 53, 20);
$pdf->SetFont('Arial', 'B', 13);
$pdf->Cell(0, 24, "Establecimientos participantes", 0, 0, "L");
foreach ($establecimientos as $establecimiento) {
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 13);
$pdf->SetTextColor(85, 53, 20);
$pdf->SetFillColor(182, 145, 107);
$pdf->Cell(0, 10, utf8_decode($establecimiento->getNombre()), 1, 0, "C", "false");
$pdf->Ln();
$pdf->SetFont('Arial', 'I', 13);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(0, 10, utf8_decode($establecimiento->getDescripcion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, utf8_decode($establecimiento->getLocalizacion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, utf8_decode("Pincho:"), 0, 0, "L");
foreach ($pinchos as $pincho) {
if ($pincho->getEstablecimiento() == $establecimiento->getId()) {
$pdf->Ln();
$pdf->Cell(5);
$pdf->Cell(0, 10, utf8_decode($pincho->getNombre()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(5);
$pdf->Cell(0, 10, utf8_decode($pincho->getDescripcion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(5);
if ($pincho->isCeliaco()) {
$pdf->Cell(0, 10, utf8_decode("Apto para celiaco"), 0, 0, "L");
} else {
$pdf->Cell(0, 10, utf8_decode("No apto para celiaco"), 0, 0, "L");
}
}
}
$pdf->Ln(5);
}
$pdf->Output("folleto.pdf", "D");
}
示例3: generate_pdf
private function generate_pdf($srcText, $dest)
{
// Set some document variables
$author = "";
$x = 50;
$text = "<<<EOT" . $srcText . "EOT";
// Create fpdf object
$pdf = new FPDF('P', 'pt', 'Letter');
// Set base font to start
$pdf->SetFont('Times', 'B', 24);
// Add a new page to the document
$pdf->addPage();
// Set the x,y coordinates of the cursor
$pdf->SetXY($x, 50);
// Write 'Simple PDF' with a line height of 1 at the current position
$pdf->Write(25, 'Simple PDF');
// Reset the font
$pdf->SetFont('Courier', 'I', 10);
// Set the font color
$pdf->SetTextColor(255, 0, 0);
// Reset the cursor, write again.
$pdf->SetXY($x, 75);
$pdf->Cell(0, 11, "By: {$author}", 'B', 2, 'L', false);
// Place an image on the pdf document
//$pdf->Image('graph.jpg', $x, 100, 150, 112.5, 'JPG');
// Reset font, color, and coordinates
$pdf->SetFont('Arial', '', 12);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY($x, 250);
// Write out a long text blurb.
$pdf->write(13, $srcText);
// echo "<pre>";
// print_r($pdf);exit;
$fileName = substr($dest, 0, strpos($dest, '.')) . "_" . time() . '.pdf';
$pdf->Output($fileName, 'F');
}
示例4: generatePDF
function generatePDF($print_id, $print_type = 1)
{
include "config.php";
require_once 'fpdf/fpdf.php';
$db = go\DB\DB::create($db_params, 'mysql');
$db->query('SET CHARACTER SET cp1251');
$get_print = $db->query('SELECT `finish_number`, `valve_type_id` FROM {numbers} WHERE `print_id`=?', array($_GET['print_id']))->assoc();
$get_print_info = $db->query('SELECT DISTINCT(`nm`.`order`) as `order`, `us`.`name` as `name`, `nm`.`print_id` as `print_id` FROM {numbers} `nm` LEFT JOIN {users} `us` ON (`nm`.`user_id` = `us`.`id`) WHERE `print_id`=?', array($_GET['print_id']))->row();
define('FPDF_FONTPATH', 'fpdf/fonts');
$pdf = new FPDF("L", "mm", array("88", "7"));
$pdf->AddFont('Arial-BoldMT', 'B', 'arial_bold.php');
$pdf->SetFont('Arial-BoldMT', 'B', 11);
$pdf->SetTextColor(0);
//Add info for this order
$pdf->AddPage('L');
$pdf->SetAutoPageBreak(false);
$pdf->SetXY(0, 0);
$pdf->Cell(43, 7, $get_print_info['name'], 0, 0, "C", 0);
$pdf->Cell(4, 7, '', 0, 0, "C", 0);
$pdf->Cell(43, 7, $get_print_info['order'], 0, 0, "C", 0);
//End of add
for ($i = 0; $i < count($get_print); $i++) {
$pdf->AddPage('L');
$pdf->SetAutoPageBreak(false);
$pdf->SetXY(0, 0);
$pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i]['finish_number'], 0, 0, "C", 0);
$pdf->Cell(4, 7, '', 0, 0, "C", 0);
if ($i + $print_type < count($get_print)) {
$pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i + $print_type]['finish_number'], 0, 0, "C", 0);
}
$pdf->SetAutoPageBreak(false);
$i += $print_type;
}
return $pdf->Output($get_print_info['print_id'] . '.pdf', 'I');
}
示例5: SetTextColor
function SetTextColor($r, $g = -1, $b = -1)
{
if (is_string($r)) {
$this->HTML2RGB($r, $r, $g, $b);
}
parent::SetTextColor($r, $g, $b);
}
示例6: sprintf
// Seite hinzufügen
$pdf->AddPage();
// Logo auf erster Seite einfügen
$pdf->Image('./img/acb_logo_gross.jpg', 95, 10, 25);
// Position auf der X- und Y-Achse
$pdf->SetY(40);
// Schriftart festlegen
$pdf->SetFont('Times', 'BU', 14);
$pdf->Cell(160, 7, utf8_decode('Telefonnummern der Flugleiter/-innen, Aero-Club Butzbach e.V.'), 0, 1, 'C');
// Schriftart festlegen
$pdf->SetFont('Times', '', 11);
$pdf->Cell(160, 5, sprintf(utf8_decode('Stand: %s %d'), utf8_decode($_monate[date('n')]), date('Y')), 0, 1, 'C');
// Position auf der X- und Y-Achse
$pdf->SetXY(20, 280);
// Schriftart und -farbe ändern
$pdf->SetTextColor(128, 128, 128);
$pdf->SetFont('Times', '', 8);
// Ausgabe des Fusszeilentext
$pdf->Cell(0, 10, 'Seite ' . $pdf->PageNo() . ' von {nb}', 0, 0, 'C');
// Position auf der X- und Y-Achse
$x = 20;
$y = 63;
// alle Flugleiter des Vereins ermitteln
$data = getFlugleiterliste();
// Schriftfarbe setzen
$pdf->SetTextColor(0, 0, 0);
foreach ($data as $mitglied) {
// Schriftart festlegen
$pdf->SetFont('Times', 'B', 11);
// Schriftfarbe setzen
$pdf->SetTextColor(0, 0, 0);
示例7: empty
// passage des creneaux en revus
while ( $nb_creneaux > $k )
{
// nom du creneau sur lequelle nous travaillons actuellement
$nom_creneau = $creneaux[$k];
if ( !empty($tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['A']) and $tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['A'] === '1' and empty($tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['R']))
{
// si la couleur à était demandé alors on l'initialise
if ( $couleur_fond === '1' )
{
// couleur de caractère
$pdf->SetTextColor(255, 0, 0);
// couleur du fond de cellule
$pdf->SetFillColor(255, 223, 223);
}
// construction de la cellule du tableau
$pdf->Cell($largeur_1_creneau, $hau_donnee, 'A', 1, 0, 'C', $couleur_fond);
// remise de la couleur du caractère à noir
$pdf->SetTextColor(0, 0, 0);
}
elseif ( !empty($tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['R']) and $tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['R'] === '1' and empty($tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['A']) )
{
示例8: fee_month
public function fee_month()
{
$date_from = $this->input->get("date_from");
$date_to = $this->input->get("date_to");
$event = $this->input->get("event");
require_once "../assets/fpdf/fpdf.php";
$pdf = new FPDF();
$pdf->AliasNbPages();
$pdf->AddPage('L', 'A4');
//title
$pdf->SetFont('Arial', 'B', 16);
$pdf->Cell(0, 10, 'Report Absensi Moderasi HM Sampoerna', 0, 0, 'C');
$pdf->Ln(10);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(0, 5, 'Periode Tanggal : ' . $date_from . ' s/d ' . $date_to, 0, 0, 'C');
$pdf->Ln(5);
$pdf->Cell(0, 5, 'Event : ' . $this->event_model->get_event_name($this->input->get("event")), 0, 0, 'L');
$pdf->Ln(10);
//header
$pdf->SetFont('Arial', 'B', 8);
$pdf->SetDrawColor(0, 0, 0);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(10, 14, 'No', 1, 0, 'C');
$pdf->Cell(40, 14, 'Moderator', 1, 0, 'C');
$from = date_create(format_ymd($date_from));
$to = date_create(format_ymd($date_to));
$j = 0;
while ($from <= $to) {
$pdf->SetXY(60 + $j, 35);
$pdf->Cell(6, 7, date_format($from, "d"), 1, 0, 'C');
$pdf->SetXY(60 + $j, 42);
$pdf->Cell(6, 7, date_format($from, "m"), 1, 0, 'C');
date_add($from, date_interval_create_from_date_string('1 days'));
$j += 6;
}
$pdf->SetXY($j + 60, 35);
$pdf->Cell(0, 14, 'Jumlah', 1, 0, 'C');
$pdf->Ln(14);
//rows
$pdf->SetFont('Arial', '', 8);
$pdf->SetDrawColor(0, 0, 0);
$pdf->SetTextColor(0, 0, 0);
$result = $this->user_event_model->get_user_month()->result();
$total = 0;
$i = 1;
$j = 0;
foreach ($result as $r) {
$pdf->Cell(10, 7, $i++, 1, 0, 'C');
$pdf->Cell(40, 7, $r->user, 1, 0, 'L');
$from = date_create(format_ymd($date_from));
$to = date_create(format_ymd($date_to));
$j = 0;
$jum = 0;
while ($from <= $to) {
$jumlah = $this->absent_model->check_exist_month($r->user_kode, $event, date_format($from, 'Y-m-d'));
$pdf->Cell(6, 7, number_format($jumlah), 1, 0, 'C');
$jum += $jumlah;
date_add($from, date_interval_create_from_date_string('1 days'));
$j++;
}
$pdf->Cell(0, 7, number_format($jum), 1, 0, 'C');
$total += $jum;
$pdf->Ln(7);
}
$pdf->SetFillColor(240, 240, 240);
$pdf->SetFont('Arial', 'B', 8);
$pdf->Cell(50 + 6 * $j, 7, 'Total : ', 1, 0, 'R', true);
$pdf->Cell(0, 7, number_format($total), 1, 0, 'C', true);
$pdf->SetFont('Arial', '', 10);
$this->_footer($pdf);
$pdf->Output("Fee Moderasi HM Sampoerna", "I");
}
示例9: FPDF
/**
* Download task list as attachment
*
* @access public
* @param void
* @return null
*/
function download_list()
{
$task_list = ProjectTaskLists::findById(get_id());
if (!$task_list instanceof ProjectTaskList) {
flash_error(lang('task list dnx'));
$this->redirectTo('task');
}
// if
$this->canGoOn();
if (!$task_list->canView(logged_user())) {
flash_error(lang('no access permissions'));
$this->redirectToReferer(get_url('task'));
}
// if
$output = array_var($_GET, 'output', 'csv');
$project_name = active_project()->getName();
$task_list_name = $task_list->getName();
$task_count = 0;
if ($output == 'pdf') {
Env::useLibrary('fpdf');
$download_name = "{$project_name}-{$task_list_name}-tasks.pdf";
$download_type = 'application/pdf';
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetTitle($task_list_name);
$pdf->SetCompression(true);
$pdf->SetCreator('ProjectPier');
$pdf->SetDisplayMode(fullpage, single);
$pdf->SetSubject(active_project()->getObjectName());
$pdf->SetFont('Arial', 'B', 16);
$task_lists = active_project()->getOpenTaskLists();
$pdf->Cell(0, 10, lang('project') . ': ' . active_project()->getObjectName(), 'C');
$pdf->Ln();
foreach ($task_lists as $task_list) {
$pdf->SetFont('Arial', 'B', 14);
$pdf->Write(10, lang('task list') . ': ' . $task_list->getObjectName());
$pdf->Ln();
$tasks = $task_list->getTasks();
$line = 0;
// Column widths
$w = array(10, 0, 0);
// Header
//for($i=0;$i<count($header);$i++)
// $this->Cell($w[$i],7,$header[$i],1,0,'C');
//$this->Ln();
$pdf->SetFont('Arial', 'I', 14);
foreach ($tasks as $task) {
$line++;
if ($task->isCompleted()) {
$task_status = lang('completed');
$pdf->SetTextColor(100, 200, 100);
$task_completion_info = lang('completed task') . ' : ' . format_date($task->getCompletedOn());
} else {
$task_status = lang('open');
$pdf->SetTextColor(255, 0, 0);
$task_completion_info = lang('due date') . ' : ' . lang('not assigned');
if ($task->getDueDate()) {
$task_completion_info = lang('due date') . ' : ' . format_date($task->getDueDate());
}
}
if ($task->getAssignedTo()) {
$task_assignee = $task->getAssignedTo()->getObjectName();
} else {
$task_assignee = lang('not assigned');
}
$pdf->Cell($w[0], 6, $line);
$pdf->Cell($w[2], 6, $task_status, "TLRB");
$pdf->Ln();
$pdf->Cell($w[0], 6, '');
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell($w[2], 6, $task_completion_info, "TLRB");
$pdf->Ln();
$pdf->Cell($w[0], 6, '');
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell($w[2], 6, $task_assignee, "TLRB");
$pdf->Ln();
$pdf->Cell($w[0], 6, '');
$pdf->SetTextColor(0, 0, 0);
$pdf->MultiCell($w[2], 6, $task->getText(), "TLRB");
$pdf->Ln();
}
}
$pdf->Output($download_name, 'D');
} else {
$download_name = "{$project_name}-{$task_list_name}-tasks.txt";
$download_type = 'text/csv';
$download_contents = $task_list->getDownloadText($task_count, "\t", true);
download_contents($download_contents, $download_type, $download_name, strlen($download_contents));
}
die;
}
示例10: FPDF
//Creación del objeto de la clase heredada
$pdf = new FPDF();
$pdf->AliasNbPages();
//Primera página
$pdf->AddPage();
$id_ticket = $_GET['id_ticket'];
// Imagen de encabezado
$pdf->Image("./images/banner4.jpg", 10, 0, 180, 40, "JPG", "");
// Titulo del Reporte
$pdf->SetFont('Arial', 'B', 20);
$pdf->SetY(45);
$pdf->Cell(50, 10, 'Detalle del Ticket No. ' . $id_ticket);
// Configuracion de colores
$pdf->SetY(60);
$pdf->SetFillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->SetDrawColor(128, 0, 0);
$pdf->SetLineWidth(0.3);
$pdf->SetFont('', 'B');
if ($result = $obj_modelo->GetDetalleTicket($id_ticket)) {
if ($obj_conexion->GetNumberRows($result) > 0) {
// Establecemos la cabecera de la tabla
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetTextColor(128, 0, 0);
$pdf->Cell(20, 7, 'Numero', 1, 0, 'C', true);
$pdf->Cell(40, 7, 'Sorteo', 1, 0, 'C', true);
//$pdf->Cell(30,7,'Hora Sorteo',1,0,'C',true);
$pdf->Cell(30, 7, 'Signo', 1, 0, 'C', true);
$pdf->Cell(30, 7, 'Monto', 1, 0, 'C', true);
$pdf->Cell(40, 7, 'Apuesta Ganadora', 1, 0, 'C', true);
$pdf->SetFont('Arial', '', 8);
示例11: FPDF
<?php
$name = $_POST['name'];
$characteristics = $_POST['characteristics'];
$image = $_POST['image'];
require 'fpdf17/fpdf.php';
//create a FPDF object
$pdf = new FPDF();
//set document properties
$pdf->SetAuthor('Anon');
$pdf->SetTitle($name);
//set font for the entire document
$pdf->SetFont('Helvetica', 'B', 20);
$pdf->SetTextColor(50, 60, 100);
//set up a page
$pdf->AddPage('P');
//$pdf->SetDisplayMode(real,'default');
//insert an image and make it a link
$pdf->Image('logo.png', 10, 20, 33, 0);
//display the title without a border around it
$pdf->SetXY(50, 20);
$pdf->SetDrawColor(50, 60, 100);
$pdf->Cell(100, 10, $name, 0, 0, 'C', 0);
// Insert a dynamic image from a URL
$pdf->Image($image, 75, 30, 0, 50);
//Set x and y position for the main text, reduce font size and write content
$pdf->SetXY(10, 90);
$pdf->SetFontSize(10);
$pdf->Write(5, $characteristics);
//Output the document
$pdf->Output();
示例12: FPDF
}
//email Invoice
$to = $email;
$from = "no-reply@hpvcindia.in";
$subject = "HPVC2015-Registration";
$message = "<p>Congatulations your payment is Succesfull.</p><p>Find the attachment for Invoice</p><p>Your Unique Code for uploading report is :<b>" . $tkn . "</b></p><p>The Code will expire immediately after uploading report</p>";
require "fpdf/fpdf.php";
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont("Arial", "B", 11);
//$pdf->Image('img/header.jpg',10,null,190,0);
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Cell(40, 10, "Congratulations", 0, 0, "");
$pdf->SetTextColor(241, 98, 97);
$pdf->Cell(0, 10, $cap_nm, 0, 1, "");
$pdf->SetTextColor(241, 98, 97);
$pdf->SetFont("Arial", "B", 14);
$pdf->Cell(0, 10, "Your Payment is Succesfull.", 0, 1, "");
$pdf->SetFont("Arial", "B", 11);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(50, 10, "Team Name:", 0, 0, "");
$pdf->SetTextColor(241, 98, 97);
$pdf->Cell(0, 10, $team_nm, 0, 1, "");
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(50, 10, "Reference No:", 0, 0, "");
$pdf->SetTextColor(241, 98, 97);
$pdf->Cell(0, 10, $refno, 0, 1, "");
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(50, 10, "Transaction ID:", 0, 0, "");
示例13: foreach
/** THE FOLLOWING SHOULD BE REPEATED FOR EACH STUDENT **/
if (count($reports)) {
foreach ($reports as $id => $report) {
$teacherName = $report['classInfo']['first_name'] . " " . $report['classInfo']['last_name'];
$rcv = 0;
/** used for row shading **/
$pdf->AddPage('P');
$pdf->SetMargins($lm, $tm);
//$pdf->SetTitle($className."_".$termName."_".$sname."_ProgressReport.pdf");
/** START BUILDING THE PAGE **/
/** First the heading **/
$y_coord = $tm;
$x_coord = $lm;
$pdf->SetFillColor(255, 255, 255);
/** Page Title **/
$pdf->SetTextColor(51, 102, 102);
$pdf->SetFont('Times', 'B', $titlefs);
$pdf->SetXY($x_coord, $y_coord);
$title = $pdf->Cell($headingw, $titleh, 'Questar III Student Progress Report', 0, 1, 'C', 0);
$y_coord += $titleh;
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Times', 'B', $colheadingfs);
$pdf->SetXY($x_coord, $y_coord);
$pdf->Cell($headingw, 0.4, $report['studentName'], 0, 2, 'L', 0);
$pdf->Cell($headingw, 0.4, $report['classInfo']['course_name'] . ' ~ ' . $teacherName, 0, 2, 'L', 0);
$pdf->Cell($headingw, 0.4, "School Year " . $schoolYear . " ~ " . $report['classInfo']['term_name'], 0, 2, 'L', 0);
$pdf->Cell($headingw, 0.4, "Printed on " . $currentDate, 0, 2, 'L', 0);
/** SUMMARY SECTION **/
$y_coord = $tm + $titleh;
$x_coord = $lm + $headingw;
$pdf->SetFont('Times', 'B', $colheadingfs + 1);
示例14:
$pdf->AddPage();
$pdf->SetFont("Helvetica", "B", 22);
$pdf->Cell(0, 20, "Certificate", "B", 1, "C");
$pdf->Ln();
$pdf->SetFont("Helvetica", "B", 16);
$pdf->Cell(0, 20, "OF PHP Knowledge", "I", 0, "C");
$pdf->Ln();
$pdf->Cell(0, 20, "Issued to VitoshAcademy.Com", "I", 0, "C");
$pdf->Ln();
$pdf->Cell(0, 20, "By VitoshAcademy.Com", "I", 0, "C");
$pdf->Ln();
$pdf->SetFont("Helvetica", "B", 11);
$pdf->SetDrawColor(255, 0, 255);
$pdf->SetLineWidth(0.1);
$pdf->SetFillColor(192, 192, 192);
$pdf->SetTextColor(255, 0, 0);
$pdf->Cell(25, 5, "N", "LTR", 0, "C", 1);
$pdf->Cell(25.1, 5, "N * 11", "LTR", 0, "C", 1);
$pdf->Cell(25.2, 5, "N * 13", "LTR", 0, "C", 1);
$pdf->Cell(25.3, 5, "N * 17", "LTR", 0, "C", 1);
$pdf->Cell(25.4, 5, "N * 19", "LTR", 0, "C", 1);
$pdf->Cell(25.5, 5, "N * 23", "LTR", 0, "C", 1);
$pdf->Cell(25.6, 5, "N * 31", "LTR", 0, "C", 1);
$pdf->Ln();
$bool_draw = True;
for ($w = 7; $w <= 50; $w = $w + 7) {
if ($bool_draw == True) {
$pdf->SetFillColor(105, 110, 115);
$pdf->SetTextColor(1, 300, 1);
$bool_draw = False;
} else {
示例15: exportPdf
function exportPdf()
{
$db = JFactory::getDBO();
while (ob_get_level()) {
ob_end_clean();
}
header("Content-Encoding: None", true);
require JPATH_COMPONENT . DS . 'helpers' . DS . 'fpdf.php';
include_once JPATH_COMPONENT . DS . 'helpers' . DS . 'font' . DS . 'helvetica.php';
$quiz_id = intval(JRequest::getVar("id", ""));
//create a FPDF object
$pdf = new FPDF();
//set font for the entire document
$pdf->SetFont('Arial', 'B', 20);
$pdf->SetTextColor(50, 60, 100);
//set up a page
$pdf->AddPage();
@$pdf->SetDisplayMode(real, 'default');
$pdf->SetXY(10, 5);
$pdf->SetFontSize(8);
$z = 25;
$t = $z + 10;
$pdf->SetXY(10, $t);
$pdf->SetFontSize(7);
$pdf->Cell(25, 10, JText::_("GURU_NAME"), 'LRTB', '', 'L', 0);
$pdf->Cell(39, 10, JText::_("GURU_EMAIL"), 'LRTB', '', 'L', 0);
$pdf->Cell(100, 10, JText::_("GURU_PROGRAM"), 'LRTB', '', 'L', 0);
$pdf->Ln();
$pid = JRequest::getVar("course", 0);
$result = array();
$user = JFactory::getUser();
$sql = "select `id` from #__guru_program where `author` like '%|" . intval($user->id) . "|%' OR `author`='" . intval($user->id) . "'";
$db->setQuery($sql);
$db->query();
$courses_ids = $db->loadColumn();
$sql = "select `id`, `name` from #__guru_program where `author` like '%|" . intval($user->id) . "|%' OR `author`='" . intval($user->id) . "'";
$db->setQuery($sql);
$db->query();
$courses_names = $db->loadAssocList("id");
if (!isset($courses_ids) || count($courses_ids) <= 0) {
$courses_ids = array("0" => "0");
}
if (intval($pid) != 0) {
$courses_ids = array(intval($pid));
}
$sql = "select distinct(`userid`) from #__guru_buy_courses where `course_id` in (" . implode(",", $courses_ids) . ")";
$db->setQuery($sql);
$db->query();
$students_ids = $db->loadColumn();
if (isset($students_ids) && count($students_ids) > 0) {
$sql = "select distinct(c.`userid`), A.`courses`, u.* from #__guru_buy_courses c, (select `userid`, GROUP_CONCAT(`course_id` SEPARATOR '-') as courses from #__guru_buy_courses where `course_id` in (" . implode(",", $courses_ids) . ") group by `userid`) as A, #__users u, #__guru_customer cust where `course_id` in (" . implode(",", $courses_ids) . ") and c.`userid`=A.`userid` and u.`id`=c.`userid` and cust.`id`=u.`id`";
$db->setQuery($sql);
$db->query();
$result = $db->loadAssocList();
}
$new_id = 0;
$nr = 1;
for ($i = 0; $i < count($result); $i++) {
$name = $result[$i]["name"];
$email = $result[$i]["email"];
$courses = $result[$i]["courses"];
$student_courses = array();
$courses = explode("-", $courses);
if (isset($courses) && count($courses) > 0) {
foreach ($courses as $key => $value) {
$student_courses[] = $courses_names[$value]["name"];
}
}
$pdf->SetFontSize(7);
$pdf->Cell(25, 10, $name, 'LRTB', '', 'L', 0);
$pdf->Cell(39, 10, $email, 'LRTB', '', 'L', 0);
$pdf->Cell(100, 10, implode(", ", $student_courses), 'LRTB', '', 'L', 0);
$pdf->Ln();
}
//Output the document
$pdf->Output('ExportResult.pdf', 'I');
}