本文整理匯總了PHP中FPDF::SetAuthor方法的典型用法代碼示例。如果您正苦於以下問題:PHP FPDF::SetAuthor方法的具體用法?PHP FPDF::SetAuthor怎麽用?PHP FPDF::SetAuthor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FPDF
的用法示例。
在下文中一共展示了FPDF::SetAuthor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: generate_attendees_PDF
public final function generate_attendees_PDF($tickets_list)
{
$this->load_pdf_libraries();
$pdf = new FPDF();
$ecp = TribeEvents::instance();
$pdf->AddFont('OpenSans', '', 'opensans.php');
$pdf->AddFont('SteelFish', '', 'steelfish.php');
$pdf->SetTitle('EventTicket');
$pdf->SetAuthor('The Events Calendar');
$pdf->SetCreator('The Events Calendar');
$defaults = array('event_id' => 0, 'ticket_name' => '', 'holder_name' => '', 'order_id' => '', 'ticket_id' => '', 'security_code' => '');
foreach ($tickets_list as $ticket) {
$ticket = wp_parse_args($ticket, $defaults);
$event = get_post($ticket['event_id']);
$venue_id = tribe_get_venue_id($event->ID);
$venue = !empty($venue_id) ? get_post($venue_id)->post_title : '';
$address = tribe_get_address($event->ID);
$zip = tribe_get_zip($event->ID);
$state = tribe_get_stateprovince($event->ID);
$city = tribe_get_city($event->ID);
$pdf->AddPage();
$pdf->SetDrawColor(28, 166, 205);
$pdf->SetFillColor(28, 166, 205);
$pdf->Rect(15, 10, 180, 34, 'F');
$pdf->SetTextColor(255);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 15);
$pdf->Write(5, __('EVENT NAME:', 'tribe-events-calendar'));
$pdf->SetXY(30, 28);
$pdf->SetFont('SteelFish', '', 53);
$title = strtoupper(utf8_decode($event->post_title));
$size = 53;
while ($pdf->GetStringWidth($title) > 151) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $title);
$pdf->SetTextColor(41);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 50);
$pdf->Write(5, __('TICKET HOLDER:', 'tribe-events-calendar'));
$pdf->SetXY(104, 50);
$pdf->Write(5, __('LOCATION:', 'tribe-events-calendar'));
$pdf->SetFont('SteelFish', '', 30);
$pdf->SetXY(30, 59);
$holder = strtoupper(utf8_decode($ticket['holder_name']));
$size = 30;
while ($pdf->GetStringWidth($holder) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $holder);
$pdf->SetXY(104, 59);
$venue = strtoupper(utf8_decode($venue));
$size = 30;
while ($pdf->GetStringWidth($venue) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $venue);
$pdf->SetXY(104, 71);
$address = strtoupper(utf8_decode($address));
$size = 30;
while ($pdf->GetStringWidth($address) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $address);
$pdf->SetXY(104, 83);
$address2 = array($city, $state, $zip);
$address2 = array_filter($address2);
$address2 = join(', ', $address2);
$address2 = strtoupper(utf8_decode($address2));
$size = 30;
while ($pdf->GetStringWidth($address2) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $address2);
$pdf->Line(15, 97, 195, 97);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 105);
$pdf->Write(5, __('ORDER:', 'tribe-events-calendar'));
$pdf->SetXY(80, 105);
$pdf->Write(5, __('TICKET:', 'tribe-events-calendar'));
$pdf->SetXY(120, 105);
$pdf->Write(5, __('VERIFICATION:', 'tribe-events-calendar'));
$pdf->SetFont('SteelFish', '', 53);
$pdf->SetXY(30, 118);
$pdf->Write(5, $ticket['order_id']);
$pdf->SetXY(80, 118);
$pdf->Write(5, $ticket['ticket_id']);
$pdf->SetXY(120, 118);
$pdf->Write(5, $ticket['security_code']);
$pdf->Rect(15, 135, 180, 15, 'F');
$pdf->SetTextColor(255);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 140);
$pdf->Write(5, get_bloginfo('name'));
$pdf->SetXY(104, 140);
//.........這裏部分代碼省略.........
示例2: while
/**
*
* View detail of persuratan_suratmasuk
*
**/
function action_persuratan_suratmasukcetakld($id)
{
$this->blankpage = true;
$this->db_query("SELECT * FROM persuratan_ms_flowstat");
while ($row = $this->db_fetch()) {
$arr_ms_flowstat[$row['id']] = $row['name'];
}
$this->db_query("SELECT * FROM persuratan_ms_tipesurat");
while ($row = $this->db_fetch()) {
$arr_ms_tipesurat[$row['id']] = $row['name'];
}
$this->db_query("SELECT * FROM persuratan_ms_sifatsurat");
while ($row = $this->db_fetch()) {
$arr_ms_sifatsurat[$row['id']] = $row['name'];
}
$this->db_query("SELECT * FROM persuratan_ms_tujuanakhir");
while ($row = $this->db_fetch()) {
$arr_ms_tujuanakhir[$row['id']] = $row['name'];
}
$res = $this->db_query("SELECT * , DATE_FORMAT(tglagenda, '%d-%m-%Y') AS tglagenda, DATE_FORMAT(tglsuratintern, '%d-%m-%Y') AS tglsuratintern, DATE_FORMAT(tglkma, '%d-%m-%Y') AS tglkma, DATE_FORMAT(tglsuratpengirim, '%d-%m-%Y') AS tglsuratpengirim, DATE_FORMAT(tglpembukuan, '%d-%m-%Y') AS tglpembukuan, DATE_FORMAT(tglmasuktuadawas, '%d-%m-%Y') AS tglmasuktuadawas, DATE_FORMAT(tglkeluar, '%d-%m-%Y') AS tglkeluar FROM persuratan_suratmasuk \n WHERE ms_tujuanakhir_id='{$id}' AND ms_flowstat_id = 101\n {$this->groupfield} ORDER BY tglagenda DESC");
$this->db_query("SELECT * , DATE_FORMAT(tglagenda, '%d-%m-%Y') AS tglagenda, DATE_FORMAT(tglsurat, '%d-%m-%Y') AS tglsurat FROM persuratan_suratmasuk WHERE ms_tujuanakhir_id='{$id}' AND ms_flowstat_id = 101 {$this->groupfield} ORDER BY tglagenda DESC, id DESC");
if ($this->db_numrows() > 0) {
//==============
// Start create PDF
//==============
require 'fpdf/fpdf.php';
$pdf = new FPDF('P', 'mm', array(215, 330));
$pdf->SetAuthor('Agus Sudarmanto, S.Kom.');
while ($row = $this->db_fetch()) {
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 16);
$cellBox = 195;
$pdf->Rect(10, 7, $cellBox, 25);
$pdf->Rect(10, 38, $cellBox, 24);
$pdf->Rect(150, 38, 55, 24);
$pdf->Rect(10, 62, $cellBox, 50);
$pdf->Rect(10, 118, $cellBox, 133);
$pdf->Rect(150, 118, 55, 133);
$pdf->Cell($cellBox, 7, 'MAHKAMAH AGUNG REPUBLIK INDONESIA', 0, 1, 'C');
$pdf->Cell($cellBox, 7, 'SEKRETARIAT WAKIL KETUA MA BIDANG NON YUDISIAL', 0, 1, 'C');
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell($cellBox, 7, 'Lembar Disposisi', 0, 1, 'C');
$pdf->Image('pdf/logo.png', 23, 10, 16);
$pdf->SetFont('Arial', '', 10);
$arr = array(array('Nomor Agenda', $row[noagenda]), array('Tanggal Agenda', $row[tglagenda]), array('Agno TU', $row[nosuratintern]), array('Tanggal TU', $row[tglsuratintern]), array('', ''), array('Nomor Surat', $row[nosuratpengirim]), array('Tanggal', $row[tglsuratpengirim]), array('Pengirim', $row[namapengirim]), array('Perihal', $row[perihal]));
$pdf->SetY(40);
for ($i = 0, $c = sizeof($arr); $i < $c; $i++) {
$pdf->SetX(13);
$pdf->Cell(31, 5, $arr[$i][0]);
$pdf->Cell(5, 5, !in_array($i, array(4, 9)) ? ':' : '');
$pdf->MultiCell($i < 5 ? 100 : 158, 5, $arr[$i][1], 0, 1);
}
$pdf->SetY(45);
$arr = array(array('Jenis Surat', $arr_ms_sifatsurat[$row['ms_sifatsurat_id']]));
for ($i = 0, $c = sizeof($arr); $i < $c; $i++) {
$pdf->SetX(155);
$pdf->Cell(20, 5, $arr[$i][0]);
$pdf->Cell(5, 5, ':');
if ($i == 0) {
$pdf->SetFont('', 'B');
}
$pdf->MultiCell(70, 5, $arr[$i][1], 0, 1);
if ($i == 0) {
$pdf->SetFont('', '');
}
}
$arr = array(array('Diteruskan kepada :'), array('KMA RI'), array('WKMA RI Bid. Yud'), array('WKMA RI Bid. Non Yud'), array('Para Tuaka'), array('Kabawas'), array('Lainnya'));
$pdf->SetY(120);
for ($i = 0, $c = sizeof($arr); $i < $c; $i++) {
$pdf->SetX($i == 0 ? 155 : 163);
$pdf->Cell(31, 7, $arr[$i][0], 0, 1);
}
$pdf->SetFont('Arial', '', 8);
$pdf->SetY(251);
for ($i = 0; $i < 6; $i++) {
$pdf->Rect(157, 128 + $i * 7, 4, 4);
}
$pdf->SetY(150);
$pdf->SetX(130);
}
$pdf->Output();
$res = $this->db_query("UPDATE persuratan_suratmasuk \n SET ms_flowstat_id = 102\n WHERE ms_tujuanakhir_id='{$id}' AND ms_flowstat_id = 101");
}
}
示例3: save
//.........這裏部分代碼省略.........
$borders .= 'T';
$pdf->SetDrawColor(
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 0, 2)),
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 2, 2)),
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 4, 2))
);
}
if ($style->getBorders()->getBottom()->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
$borders .= 'B';
$pdf->SetDrawColor(
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 0, 2)),
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 2, 2)),
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 4, 2))
);
}
if ($borders == '') {
$borders = 0;
}
if ($sheet->getShowGridlines()) {
$borders = 'LTRB';
}
// Image?
$iterator = $sheet->getDrawingCollection()->getIterator();
while ($iterator->valid()) {
if ($iterator->current()->getCoordinates() == PHPExcel_Cell::stringFromColumnIndex($column) . ($row + 1)) {
try {
$pdf->Image(
$iterator->current()->getPath(),
$pdf->GetX(),
$pdf->GetY(),
$iterator->current()->getWidth(),
$iterator->current()->getHeight(),
'',
$this->_tempDir
);
} catch (Exception $ex) { }
}
$iterator->next();
}
// Print cell
$pdf->MultiCell(
$cellWidth,
$cellHeight,
$cellData,
$borders,
$alignment,
($style->getFill()->getFillType() == PHPExcel_Style_Fill::FILL_NONE ? 0 : 1)
);
// Coordinates
$endX = $pdf->GetX();
$endY = $pdf->GetY();
// Revert to original Y location
if ($endY > $startY) {
$pdf->SetY($startY);
if ($lineHeight < $lineHeight + ($endY - $startY)) {
$lineHeight = $lineHeight + ($endY - $startY);
}
}
$pdf->SetX($startX + $singleCellWidth);
// Hyperlink?
if ($sheet->getCellByColumnAndRow($column, $row)->hasHyperlink()) {
if (!$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->isInternal()) {
$pdf->Link(
$startX,
$startY,
$endX - $startX,
$endY - $startY,
$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->getUrl()
);
}
}
}
// Garbage collect!
$sheet->garbageCollect();
// Next line...
$pdf->Ln($lineHeight);
}
}
// Document info
$pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
$pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
$pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
$pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
$pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());
// Write to file
fwrite($fileHandle, $pdf->output($pFilename, 'S'));
// Close file
fclose($fileHandle);
}
示例4: UsersTrafficPeriodPDF
function UsersTrafficPeriodPDF()
{
//require('chart.php');
require 'lib/fpdf.php';
global $SAMSConf;
global $DATE;
$DB = new SAMSDB();
$sdate = $DATE->sdate();
$edate = $DATE->edate();
$bdate = $DATE->BeginDate();
$eddate = $DATE->EndDate();
$size = "";
if (isset($_GET["size"])) {
$size = $_GET["size"];
}
require "reportsclass.php";
$dateselect = new DATESELECT($DATE->sdate(), $DATE->edate());
$lang = "./lang/lang.{$SAMSConf->LANG}";
require $lang;
define('FPDF_FONTPATH', 'lib/font/');
require 'lib/fpdf.php';
$pdfFile = new FPDF();
$pdfFile->Open();
$pdfFile->AddFont('Nimbus', '', 'Nimbus.php');
$pdfFile->SetAuthor("SQUID Account Management System");
$pdfFile->SetCreator("Created by SAMS2");
$pdfFile->SetTitle("SAMS2 users statistic");
// UsersTrafficPeriodPDF();
$pdfFile->AddPage();
$pdfFile->SetFont('Nimbus', '', 15);
//$pdfFile->SetFont('SUSESerif-Roman','',16);
$pdfFile->SetXY(50, 15);
echo " {$usersbuttom_2_traffic_UsersTrafficPeriod_1}<BR>{$usersbuttom_2_traffic_UsersTrafficPeriod_2}<br>";
$pdfFile->Write(0, " {$usersbuttom_2_traffic_UsersTrafficPeriod_1}<BR>{$usersbuttom_2_traffic_UsersTrafficPeriod_2}");
$pdfFile->Output();
}
示例5: quotation
public function quotation()
{
// Vérification de la présence des bonnes données
if (!isset($this->request->data['Project']['id']) || empty($this->request->data['Project']['id']) || !isset($this->request->data['Project']['dev_salary']) || empty($this->request->data['Project']['dev_salary']) || !isset($this->request->data['Project']['leaddev_salary']) || empty($this->request->data['Project']['leaddev_salary']) || !isset($this->request->data['Project']['tva']) || empty($this->request->data['Project']['tva'])) {
die;
}
$id = base64_decode($this->request->data['Project']['id']);
$this->loadModel('Macrotask');
$this->loadModel('Task');
$this->loadModel('User');
if (($project = $this->Project->findFirst(array('conditions' => array('Project.id' => $id)))) != null) {
// On crée un nouveau document PDF
$pdf = new FPDF();
$pdf->SetTitle("Devis - " . $project->name);
$pdf->SetAuthor("E-Novative Keys");
$pdf->AddPage();
$pdf->SetAutoPageBreak(true);
$pdf->SetFont('Helvetica', 'B', 12);
$pdf->Image('http://enkwebservice.com/img/logo.png', 55, 6, 100);
$pdf->Ln(30);
$pdf->Cell(40, 20, "Devis Projet - " . iconv('UTF-8', 'windows-1252', $project->name));
$pdf->Ln(30);
// On charge les macrotaches liées au projet
$macrotasks = $this->Macrotask->find(array('conditions' => array('Macrotask.project_id' => $project->id)));
$totalCost = 0;
if ($macrotasks != null) {
$pdf->Cell(40, 20, iconv('UTF-8', 'windows-1252', "Tâches effectuées sur ce projet :"));
$pdf->Ln(15);
$pdf->SetFont('Helvetica', '', 12);
// Pour chaque macrotache...
for ($i = 0; $i < count($macrotasks); $i++) {
$task = $this->Task->find(array('conditions' => array("macrotask_id" => $macrotasks[$i]->id)));
$hours = 0;
// On charge les tâches et on additionne le temps de travail
if ($task != null) {
for ($j = 0; $j < count($task); $j++) {
$hours += $task[$j]->hours;
}
}
$users = $this->User->find(array('condition' => array('User.id IN' => '(SELECT user_id FROM macrotasks_users WHERE macrotask_id = ' . $macrotasks[$i]->id . ')')));
$roles = array('dev' => 0, 'leaddev' => 0);
// On récupère le statut des utilisateurs ayant travaillé sur la macrotache
if ($users != null) {
for ($j = 0; $j < count($users); $j++) {
if (in_array($users[$j]->role, array('trainee', 'employee', 'dev'))) {
$roles['dev']++;
} else {
if (in_array($users[$j]->role, array('leaddev', 'admin'))) {
$roles['leaddev']++;
}
}
}
}
$cost = ($roles['dev'] * $this->request->data['Project']['dev_salary'] + $roles['leaddev'] * $this->request->data['Project']['leaddev_salary']) / ($roles['dev'] + $roles['leaddev']) * $hours;
$totalCost += $cost;
$pdf->Cell(10);
$pdf->Cell(60, 20, iconv('UTF-8', 'windows-1252', $i + 1 . ". " . $macrotasks[$i]->name . " : "));
$pdf->Cell(40, 20, iconv('UTF-8', 'windows-1252', $cost . " € (HT)"));
$pdf->Cell(40, 20, iconv('UTF-8', 'windows-1252', $cost + $cost * ($this->request->data['Project']['tva'] / 100) . " € (TTC)"));
$pdf->Ln(10);
}
}
$pdf->SetFont('Helvetica', 'B', 12);
$pdf->Ln(20);
$pdf->Cell(5);
$pdf->Cell(65, 20, iconv('UTF-8', 'windows-1252', "Coût total HT : "));
$pdf->Cell(40, 20, iconv('UTF-8', 'windows-1252', $totalCost . " €"));
$pdf->Ln(7);
$pdf->Cell(5);
$pdf->Cell(65, 20, iconv('UTF-8', 'windows-1252', "TVA appliquée : "));
$pdf->Cell(40, 20, iconv('UTF-8', 'windows-1252', $this->request->data['Project']['tva'] . " %"));
$pdf->Ln(7);
$pdf->Cell(5);
$pdf->Cell(65, 20, iconv('UTF-8', 'windows-1252', "Remise appliquée : "));
$pdf->Cell(40, 20, iconv('UTF-8', 'windows-1252', $project->discount . " %"));
$pdf->Ln(7);
$pdf->Cell(5);
$pdf->Cell(65, 20, iconv('UTF-8', 'windows-1252', "Coût total TTC : "));
$pdf->Cell(40, 20, iconv('UTF-8', 'windows-1252', $totalCost + $totalCost * ($this->request->data['Project']['tva'] / 100) - $totalCost * ($project->discount / 100) . " €"));
$pdf->Output("Devis - " . $project->name . ".pdf ", 'I');
die;
}
}
示例6: otr_pdf_writer
public function otr_pdf_writer($file, $info)
{
// Generate Filename based on Person's & Timestamp
$path = getcwd();
if (!is_dir($path . '/img/')) {
if (mkdir($path . '/img')) {
if (!mkdir($path . '/img/otr_pdfs')) {
return false;
}
} else {
return false;
}
} elseif (!is_dir($path . '/img/otr_pdfs/')) {
if (!mkdir($path . '/img/otr_pdfs')) {
return false;
}
}
$url_file_path = '/img/otr_pdfs/' . $file;
$filename = $path . $url_file_path;
$info['student_full_name'] = $info['first_name'] . ' ' . $info['middle_name'] . ' ' . $info['last_name'];
$pdf = new FPDF('P', 'mm', array(218, 290));
$pdf->SetAuthor($info['student_full_name']);
$pdf->SetTitle('OTR');
$pdf->SetFont('Helvetica', 'B', 20);
$pdf->SetTextColor(50, 60, 100);
$pdf->AddPage('P');
$pdf->SetFontSize(10);
// Background image
$pdf->Image('img/otr_multi_form2.png', 0, 0);
$start_x = 18;
$start_y = 46;
for ($i = 0; $i < 3; $i++) {
// Fill out first form
// Name
$pdf->SetFont('Times', 'B', 14);
$start_address_Y = $start_y - 27;
foreach ($info['otr_address'] as $otr_address) {
$pdf->SetXY($start_x + 109, $start_address_Y);
$pdf->Write(5, $otr_address);
$start_address_Y += 5;
}
$pdf->SetFont('Helvetica', 'B', 10);
$pdf->SetXY($start_x, $start_y);
$pdf->Write(5, $info['student_full_name']);
// Address
$pdf->SetXY($start_x + 2, $start_y + 6.5);
$pdf->Write(5, $info['address1']);
// City, State
$pdf->SetXY($start_x + 1, $start_y + 13);
$pdf->Write(5, $info['city'] . ', ' . $info['state']);
// Zip Code
$pdf->SetXY($start_x + 58, $start_y + 13);
$pdf->Write(5, $info['zip_code']);
// Phone Number & Email
$pdf->SetXY($start_x + 15, $start_y + 26);
$pdf->Write(5, $info['home_phone']);
$pdf->SetFontSize(8);
$pdf->SetXY($start_x + 52, $start_y + 26);
$pdf->Write(5, $info['email']);
$pdf->SetFontSize(10);
// Birth Date
$birth_date = explode('-', $info['dob']);
$pdf->SetXY($start_x + 115, $start_y + 26);
$pdf->Write(5, $birth_date[0]);
$pdf->SetXY($start_x + 122.5, $start_y + 26);
$pdf->Write(5, $birth_date[1]);
$pdf->SetXY($start_x + 130, $start_y + 26);
$pdf->Write(5, $birth_date[2]);
// Today's Date
$pdf->SetXY($start_x + 102, $start_y + 32.5);
$pdf->Write(5, date('m'));
$pdf->SetXY($start_x + 109.5, $start_y + 32.5);
$pdf->Write(5, date('d'));
$pdf->SetXY($start_x + 117, $start_y + 32.5);
$pdf->Write(5, date('Y'));
// Move to the next form:
$start_y = $start_y + 93;
}
$pdf->Output($filename);
if (file_exists($filename)) {
return $url_file_path;
} else {
return false;
}
}
示例7: get_receipt
public function get_receipt($transaction_id)
{
$this->load->library('fpdf');
$transaction_details = $this->get_transaction($transaction_id);
$this->load->model('User_model');
$this->User_model->initialize($transaction_details['user_id']);
$user_details = $this->User_model->get('*');
//lookup profile
$profile_details = $this->get_profile($transaction_details['profile_id'], 'billingperiod, amount, taxamt');
//lookup subscription
$subscription_details = $this->get_subscription_by_transaction($transaction_id);
$pdf = new FPDF('P', 'mm', 'Letter');
$pdf->AddPage();
$pdf->SetAuthor('ESCTT Inc.');
$pdf->SetTitle('Invoice');
$pdf->Image('http://v1.riskmp.com/assets/images/logo.png', 10, 10, 35, 19, '', 'http://v1.riskmp.com/');
$pdf->SetXY(50, 10);
$pdf->SetFont('Arial', 'B', 40);
$pdf->Cell(100, 20, 'Receipt');
$address_x = $pdf->GetX();
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'ESCTT Inc.');
$pdf->Ln(5);
$pdf->SetX($address_x);
$pdf->Write(14, '131 Bloor Street West');
$pdf->Ln(5);
$pdf->SetX($address_x);
$pdf->Write(14, 'Suite 200/318');
$pdf->Ln(5);
$pdf->SetX($address_x);
$pdf->Write(14, 'Toronto, ON M5S 1R8');
$pdf->Ln(5);
$pdf->SetX($address_x);
$pdf->Write(14, 'Business # ' . BUSINESS_NUMBER);
$pdf->SetXY(10, 40);
$pdf->set_field_title_font($pdf);
$pdf->Write(10, 'Client: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(10, $user_details['first_name'] . " " . $user_details['last_name']);
$pdf->set_field_title_font($pdf);
$pdf->SetX(140);
$pdf->Write(10, 'Generated on: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(10, date("Y-m-d"));
$pdf->Ln(16);
$pdf->SetFont('Arial', 'B', 18);
$pdf->Write(6, 'Transaction Details');
$pdf->Ln(6);
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Transaction ID: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, $transaction_id);
$pdf->Ln(7);
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Order Time: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, $transaction_details['order_time']);
$pdf->Ln(7);
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Payment Method: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, 'Credit Card');
$pdf->Ln(16);
$pdf->SetFont('Arial', 'B', 18);
$pdf->Write(6, 'Purchase Details');
$pdf->Ln(4);
//set table header and body fonts
$thfont = array('family' => 'Arial', 'style' => 'B', 'size' => 11);
$tbfont = array('family' => 'Arial', 'style' => '', 'size' => 11);
$pdf->Ln(4);
$twidth = array(150, 50);
//column widths
$theader = array('Item', 'Amount');
//column titles
$tdata = array(array('RiskMP Membership @ 1 ' . $profile_details['billingperiod'], '$' . $profile_details['amount']), array('Tax', '$' . $profile_details['taxamt']), array('Grand Total', '$' . number_format(floatval($profile_details['amount']) + floatval($profile_details['taxamt']), 2, '.', '')));
$pdf->create_table($theader, $tdata, $twidth, 'L', 'L', $thfont, $tbfont);
//add table to pdf document
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Subscription Start Date: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, $subscription_details['date_of_redemption']);
$pdf->Ln(7);
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Subscription Expiry Date: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, $subscription_details['expiry_date']);
return $pdf;
}
示例8:
// compteur pour le nombre d'élève à affiché
$nb_eleve_aff = 1;
// si la variable $gepiSchoolName est vide alors on cherche les informations dans la base
if ( empty($gepiSchoolName) )
{
$gepiSchoolName=getSettingValue('gepiSchoolName');
}
// création du document
$pdf->SetCreator($gepiSchoolName);
// auteur du document
$pdf->SetAuthor($gepiSchoolName);
// mots clé
$pdf->SetKeywords('');
// sujet du document
$pdf->SetSubject('Bilan journalier des absences');
// titre du document
$pdf->SetTitle('Bilan journalier des absences');
// méthode d'affichage du document à son ouverture
$pdf->SetDisplayMode('fullwidth', 'single');
// compression du document
$pdf->SetCompression(TRUE);
// change automatiquement de page à 5mm du bas
$pdf->SetAutoPageBreak(TRUE, 5);
/* **************************** */
示例9: FPDF
<?php
session_start();
require_once '../includes/connecti.php';
require_once '../includes/funcs.inc.php';
if (isset($_GET['report']) && $_GET['report'] == 'true') {
$MAX_LIMIT = 8;
require_once '../includes/fpdf.php';
$pdf = new FPDF('L', 'cm', array(7.7, 15.9));
$pdf->SetAuthor("imranzahid+corpus@gmail.com");
$pdf->SetSubject("Cheque");
$pdf->SetTitle("Cheque");
$pdf->SetCreator("Imran Zahid");
$pdf->AddPage();
$pdf->SetFont('Arial', '', 12);
$amt = explode(' ', convertCurrency($_GET['amount']) . " Only.");
$str1 = "";
$sep = "";
$w = 0;
$counter = 0;
do {
$temp = $str1 . $sep . $amt[$counter];
$w = $pdf->GetStringWidth($temp);
if ($w < $MAX_LIMIT) {
$str1 .= $sep . $amt[$counter];
$sep = " ";
$counter++;
}
if ($counter > count($amt)) {
break;
}
示例10: FPDF
<?php
include "../../libraries/tcpdf/font/times.php";
//fpdf
$this->load->library('fpdf');
//fpdf
$nombre = "";
$fpdf = new FPDF();
ob_end_clean();
//inicializa pagina pdf
$fpdf->Open();
$fpdf->AddPage();
$fpdf->SetAuthor("codigoweblibre.comli.co - codigoweblibre.wordpress.com", true);
$fpdf->SetCreator("codigoweblibre.comli.co - codigoweblibre.wordpress.com", true);
//Cabecera
$fpdf->SetFont('Arial', 'B', 12);
$fpdf->SetTextColor("0", "8", "8");
//rojo
//$fpdf->Image(base_url() . 'img/User.png', 10, 10, -100);
$fpdf->SetFontSize(10);
$fpdf->Image('imagenes/banner.png', 8, 10, 192, 22, 'PNG');
$fpdf->Cell(100, 30, ' ', 0, 1, 'C');
$fpdf->Image('imagenes/bandera2.png', 8, 35, 192, 1, 'PNG');
$fpdf->Cell(0, 6, 'UNIDAD EJECUTORA DE TITULACION', 0, 1, 'C');
$fpdf->Cell(0, 6, 'DEL MINISTERIO DE OBRAS PUBLICAS, SERVICIOS Y VIVIENDA', 0, 1, 'C');
$fpdf->SetFont('Arial', 'BU', 10);
$fpdf->Cell(0, 3, '', 0, 1, 'C');
$fpdf->Cell(0, 6, 'REPORTE DE PERSONAL POR FECHA DE MODIFICACION', 0, 1, 'C');
$fpdf->Ln();
$fpdf->SetFont('Arial', 'B', 10);
$fpdf->Cell(45, 7, "Nombre ", 1);
示例11: PHPlot
$plot = new PHPlot();
$plot->SetPlotType('bars');
$plot->SetDataType('text-data');
$plot->SetShading(0);
$plot->SetDataValues($data1);
$plot->SetFileFormat('png');
$plot->SetIsInline(true);
$plot->PHPlot(1200, 550, "images/tmp/img7.png");
$plot->DrawGraph();
$img7 = "images/tmp/img7.png";
//en consesionario
/** PDF **/
$pdf = new FPDF('L', 'mm', 'Letter');
$title = 'Incidencias Generales';
$pdf->SetTitle($title);
$pdf->SetAuthor('Loop Media');
$pdf->AddPage();
//bg
$pdf->Image('images/pdf_bg.jpg', 0, 0, $pdf->w, $pdf->h);
//tittulo
$pdf->SetFont('Times', '', 42);
$pdf->SetTextColor(250, 250, 250);
$pdf->SetY(15);
$pdf->Cell(0, 10, utf8_decode('Reporte de Incidencias'), 0);
//subtitulo
$pdf->SetFont('Times', '', 32);
$pdf->SetTextColor(76, 76, 76);
$pdf->SetY(28);
$pdf->Cell(0, 10, utf8_decode('Estadísticas Generales'), 0);
$pdf->AddPage();
//head
示例12: xml2pdf
/**
* Генерирует PDF-документ на основании XML-файла.
*
* @param string $file Файл для обработки
* @param mixed $replacements массив для подстановки значений
* @return FPDF сформированный документ PDF или FALSE в случае неудачи
*/
public static function xml2pdf($file, $replacements = false)
{
// Новая обработка PDF
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/odt2pdf.php';
$tpl = basename($file, ".xml") . ".odt";
$t = new odt2pdf($tpl);
$t->convert($replacements);
return $t;
/**
* @deprecated
*/
if (!file_exists($file)) {
return false;
}
require_once dirname(__FILE__) . '/fpdf/fpdf.php';
define('FPDF_FONTPATH', dirname(__FILE__) . '/fpdf/font/');
if (is_array($replacements)) {
foreach ($replacements as &$val) {
$val = htmlspecialchars_decode($val, ENT_QUOTES);
}
}
$replacements['$tab'] = ' ';
$xml = new DOMDocument('1.0', 'windows-1251');
$xml->load($file);
$pdf = new FPDF();
// Загружаем шрифты
$pdf->AddFont('ArialMT', '', 'c9bb7ceca00657d007d343f4e34b71a8_arial.php');
$pdf->AddFont('Arial-BoldMT', '', '9cb9fc616ba50d7ecc7b816984f2ffda_arialbd.php');
$pdf->AddFont('TimesNewRomanPSMT', '', '5f37f1915715e014ee2254b95c0b6cab_times.php');
$pdf->AddFont('TimesNewRomanPS-BoldMT', '', 'e07f6c05a47ebec50a80f29789c7f1f6_timesbd.php');
/*
Загружаем XML-документ и читаем из него основные параметры лоя итогового PDF-документа
*/
$root = $xml->documentElement;
$title = $root->getAttribute('title') ? iconv('windows-1251', 'utf-8', $root->getAttribute('title')) : '';
// заголовок документа
$author = $root->getAttribute('author');
// автор
$margin_left = $root->getAttribute('margin-left') ? $root->getAttribute('margin-left') : 20;
// отступ слева
$margin_right = $root->getAttribute('margin-right') ? $root->getAttribute('margin-right') : 20;
// отступ справа
$margin_top = $root->getAttribute('margin-top') ? $root->getAttribute('margin-top') : 20;
// отступ сверху
$font_name = $root->getAttribute('font-name') ? $root->getAttribute('font-name') : 'ArialMT';
// дефолтный шрифт (имя)
$font_size = (int) $root->getAttribute('font-size') ? (int) $root->getAttribute('font-size') : 10;
// дефолтный шрифт (размер)
$text_width = (int) $root->getAttribute('width') ? (int) $root->getAttribute('width') : 170;
// ширина печатной области документа
$paragraph_indent = (int) $root->getAttribute('paragraph-indent') ? (int) $root->getAttribute('paragraph-indent') : 0;
// отступ между параграфами
$printable = $pdf->h - $margin_top - 20;
$pdf->SetTitle($title, true);
$pdf->SetAuthor($author);
$pdf->SetLeftMargin($margin_left);
$pdf->SetRightMargin($margin_right);
$pdf->SetTopMargin($margin_top);
$pdf->AddPage();
$pdf->SetFont($font_name, '', $font_size);
$pdf->SetX($margin_left);
$locates = array();
// разбор XML-документа
$xpath = new DOMXPath($xml);
$scale = $xpath->query('/document/page/*');
if ($scale->length) {
$footer = $xpath->query('//footer');
$footer = $footer->length ? $footer->item(0) : NULL;
$no_brake = $xpath->query('//nobreak');
$no_brake = $no_brake->length ? TRUE : FALSE;
// если есть теги <nobreak>, то расставляем разрывы страниц руками
if ($no_brake) {
$pdf->SetAutoPageBreak(false);
}
$last_y = 0;
$pages = array();
foreach ($scale as $node) {
$last_y = intval($pdf->y);
if ($node->tagName == 'nobreak' && $node->getAttribute('start')) {
$max_h = $last_y;
$loc_offset = 0;
foreach ($xpath->query('//cell|locate[(following::nobreak)]') as $i => $nd) {
if ($nd->tagName == 'nobreak' && $node->getAttribute('end')) {
break;
}
$_h = $nd->getAttribute('height');
if ($i > 0 && !$loc_offset) {
$_h = 0;
}
$max_h += intval($_h);
$loc_offset = $nd->getAttribute('x_offset');
}
$max_h += $last_y;
//.........這裏部分代碼省略.........
示例13: FPDF
<?php
require_once 'fpdf16/fpdf.php';
// $orientação (P|L), $unidade (cm, mm, etc), $folha (A4, Letter, etc)
$pdf = new FPDF('P', 'cm', 'A4');
// título do documento
$pdf->SetTitle('Arquivo teste - PHP Advanced II');
// autor do documento
$pdf->SetAuthor('Charles Schaefer - PHPrime');
// Adiciona a primeira página, tipo retrato
$pdf->AddPage('P');
// Indica a fonte que vai ser utilizada
$pdf->SetFont('Arial', 'B', 14);
// indica a cor do texto (r, g, b)
$pdf->SetTextColor(250, 0, 0);
// Posição do texto
$pdf->SetXY(5, 5);
// Escreve o texto
// $altura_linha, $texto
$pdf->Write(0.5, 'Gerando arquivos PDF com FPDF');
// Quebra de linha no arquivo ($altura)
$pdf->Ln(1);
$pdf->write(1, 'Texto simples, de introdução');
// $x, $y, $texto
$pdf->Text(1, 8, 'Dessa vez utilizando o método Text()');
$pdf->Output('/tmp/teste.pdf');
示例14: array
$imp_type_papier = $_REQUEST['imp_type_papier'];
$imp_logo = $_REQUEST['imp_logo'];
$nb_papier = $_REQUEST['nb_papier'];
$couleur_rgb_prim = func_SetRgbValueFromHex($coul_prim);
$couleur_rgb_sec = func_SetRgbValueFromHex($coul_sec);
define('FPDF_FONTPATH', './font/');
require './fpdf.php';
$lycee = "IUT";
$ville = "POITIERS";
$auteur = "Sébastien CELLES";
$auteur_mail = "s.celles@gmail.com";
$tick = array("no" => 0, "small" => 1, "big" => 2, "verybig" => 3);
$width = array("normal" => 0.1, "bold" => 0.35, "normal-bold" => 0.25);
$pdf = new FPDF();
$pdf->Open();
$pdf->SetAuthor($auteur);
$pdf->SetTitle('Génération de papiers spéciaux');
$pdf->SetMargins(0, 0);
$pdf->SetLineWidth($width["normal"]);
$pdf->SetAutoPageBreak(1);
$pdf->SetFont('Arial', '', 8);
$pdf->SetTextColor(0, 0, 0);
$date = date("d/m/Y à H:i:s");
switch ($_REQUEST['papier']) {
// Génération papier quadrillé 5mm x 5mm
case 1:
for ($page = 1; $page <= $nb_papier; $page++) {
$pdf->AddPage();
$pdf->SetDrawColor($couleur_rgb_sec[0], $couleur_rgb_sec[1], $couleur_rgb_sec[2]);
for ($i = 10; $i <= 280; $i += 5) {
$pdf->Line(10, $i, 200, $i);
示例15: pdf_create
/**
* @brief Create PDF for a reference
*
* We create a simple cover page for the PDF. This page contains basic bibliographic metadata
* for the PDF, in order for Mendeley to process the PDF correctly. In response to my discovery
* that Mendeley doesn't accept all XMP (Ticket#2010040110000015) support@mendeley.com replied that
* they have some heuristic tests to see if the metadata is valid, such as whether the information
* about the title and authors occurs on the first of the PDF.
*
*
* @param reference_id Reference id
* @param pdf_filename Full path of PDF file to create
*
*/
function pdf_create($reference_id, $pdf_filename)
{
global $config;
// Get reference
$reference = db_retrieve_reference($reference_id);
// Get tags
$tags = pdf_tags($reference->reference_id, 10);
// Paper size
// A4 = 210 x 297
$paper_width = 210;
// mm
$paper_height = 297;
// mm
$margin = 10;
//----------------------------------------------------------------------------------------------
// PDF
$pdf = new FPDF('P', 'mm', 'A4');
//$pdf = PDF_Rotate('P', 'mm', 'A4');
//----------------------------------------------------------------------------------------------
// Basic metadata (e.g., that displayed by Mac OS X Preview)
$pdf->SetTitle($reference->title, true);
// true means use UTF-8
$pdf->SetAuthor(reference_authors_to_text_string($reference), true);
// true means use UTF-8
if (count($tags) > 0) {
$pdf->SetKeywords(join(", ", $tags), true);
}
//----------------------------------------------------------------------------------------------
// Cover page (partly to ensure Mendeley accepts XMP metadata)
$pdf->AddPage();
// Title
$pdf->SetFont('Arial', '', 24);
$pdf->SetXY($margin, $margin);
$pdf->Write(10, utf8_decode($reference->title));
// Authors
$y = $pdf->GetY();
$pdf->SetXY($margin, $y + 16);
$pdf->SetFont('Arial', 'B', 16);
$pdf->Write(6, utf8_decode(reference_authors_to_text_string($reference)));
// Citation
$y = $pdf->GetY();
$pdf->SetXY($margin, $y + 10);
$pdf->SetFont('Arial', 'I', 12);
$pdf->Write(6, utf8_decode($reference->secondary_title));
$pdf->SetFont('Arial', '', 12);
$pdf->Write(6, ' ' . $reference->volume);
if (isset($reference->issue)) {
$pdf->Write(6, '(' . $reference->issue . ')');
}
$pdf->Write(6, ':' . $reference->spage);
if (isset($reference->epage)) {
$pdf->Write(6, '-' . $reference->epage);
}
$pdf->Write(6, ' (' . $reference->year . ')');
// URL
$url = $config['web_root'] . 'reference/' . $reference->reference_id;
$pdf->Write(6, ' ');
$pdf->SetTextColor(0, 0, 255);
$pdf->SetFont('', 'U');
$pdf->Write(6, $url, $url);
$pdf->SetFont('', '');
$pdf->SetTextColor(0, 0, 0);
//----------------------------------------------------------------------------------------------
// If we add taxon names as keywords
if (count($tags) > 0) {
$keywords = "Keywords: " . join("; ", $tags);
$y = $pdf->GetY();
$pdf->SetXY($margin, $y + 10);
$pdf->Write(6, $keywords);
}
//----------------------------------------------------------------------------------------------
// Footer giving credit to BHL
$y = $paper_height;
$y -= $margin;
$y -= 40;
$pdf->Image($config['web_dir'] . '/images/cc/cc.png', 10, $y, 10);
$pdf->Image($config['web_dir'] . '/images/cc/by.png', 20, $y, 10);
$pdf->Image($config['web_dir'] . '/images/cc/nc.png', 30, $y, 10);
$pdf->SetXY(10, $y + 10);
$pdf->SetFont('Arial', '', 10);
$pdf->SetTextColor(0, 0, 0);
$pdf->Write(6, 'Page images from the Biodiversity Heritage Library, ');
//Then put a blue underlined link
$pdf->SetTextColor(0, 0, 255);
$pdf->SetFont('', 'U');
$pdf->Write(6, 'http://www.biodiversitylibrary.org/', 'http://www.biodiversitylibrary.org/');
//.........這裏部分代碼省略.........