本文整理汇总了PHP中MYPDF::setFooterData方法的典型用法代码示例。如果您正苦于以下问题:PHP MYPDF::setFooterData方法的具体用法?PHP MYPDF::setFooterData怎么用?PHP MYPDF::setFooterData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MYPDF
的用法示例。
在下文中一共展示了MYPDF::setFooterData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Maggiore
$this->MultiCell(0, 5, "Via Angelelli 14/a - 40013 Castel Maggiore (BO) Tel.: +39 051 6325815", 0, 'C', 0, 0, '', '', true, 0, false, true, 0, 'M');
// Page number
$this->Cell(0, 5, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
// create new PDF document
$pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Contract by neiroc_');
$pdf->SetTitle('PDF');
$pdf->SetSubject('PDF');
$pdf->SetKeywords('PDF');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, 40, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(160);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING, array(255, 64, 255), array(100, 64, 128));
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
// set default monospaced font
示例2: actionCreateAccount
public function actionCreateAccount()
{
$params = self::accountCond();
$select1 = "OrderSN as No,CreateTime,Payment,BuyerID,RealPrice as Price,BuyerName";
$select2 = "ReturnNO as No,CreateTime,PayMethod as Payment,ServiceID as BuyerID,Price";
if ($params['type'] == 1) {
$seaCon1 = "select {$select1} from pap_order t where t.Status=9";
$seaCon1 .= " and SellerID = {$params['OrganID']} and IsDelete = 0";
$seaCon1 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
$seaCon1 .= " order by CreateTime DESC";
$data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll();
$count1 = Yii::app()->papdb->createCommand(str_replace($select1, 'sum(RealPrice)', $seaCon1))->queryScalar();
} else {
if ($params['type'] == 2) {
$seaCon2 = "select {$select2} from pap_return_order t where t.Status in(4,14)";
$seaCon2 .= " and DealerID = {$params['OrganID']}";
$seaCon2 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
$seaCon2 .= " order by CreateTime DESC";
$data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll();
$count2 = Yii::app()->papdb->createCommand(str_replace($select2, 'sum(Price)', $seaCon2))->queryScalar();
} else {
$seaCon1 = "select {$select1} from pap_order t where t.Status=9";
$seaCon1 .= " and SellerID = {$params['OrganID']} and IsDelete = 0";
$seaCon1 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
$seaCon1 .= " order by CreateTime DESC";
$data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll();
$count1 = Yii::app()->papdb->createCommand(str_replace($select1, 'sum(RealPrice)', $seaCon1))->queryScalar();
$seaCon2 = "select {$select2} from pap_return_order t where t.Status in(4,14)";
$seaCon2 .= " and DealerID = {$params['OrganID']}";
$seaCon2 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
$seaCon2 .= " order by CreateTime DESC";
$data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll();
$count2 = Yii::app()->papdb->createCommand(str_replace($select2, 'sum(Price)', $seaCon2))->queryScalar();
}
}
$count1 = $count1 ? $count1 : 0;
$count2 = $count2 ? $count2 : 0;
$gain = $count1 - $count2;
$day = date('t', $params['starttime']);
$organ = Organ::model()->findByPk($params['OrganID'], array('select' => 'OrganName'))->attributes;
$html = '<div style="height:24px; line-height:24px; background-color:#1f76c8">
<div style="margin:0 auto; text-align:center">
<span style="font-family:微软雅黑; font-size:24px; color:#fff; word-spacing:8px; letter-spacing: 1.5px;">' . $params['uyear'] . '年' . $params['umonth'] . '月对账单</span>
</div>
</div>
<div style="font-size:16px; color:#343434; line-height:16px">
<p style="margin:0px; ">亲爱的' . $organ['OrganName'] . ',您好!</p>
<p style="margin:0px; ">感谢您使用由你配平台,以下是您' . $params['umonth'] . '月的平台交易明细:</p>
</div>
<div style="height:20px; line-height:18px; border-bottom:2px solid #c9c7c7; border-top:2px solid #c9c7c7; background-color:#f2f2f2; padding:0 30px">
<div style="font-size:16px; font-weight:bold; color:#565656; line-height:18px;float:left">
本月净收益: <span style="color:#1f76c8">' . $gain . '</span> 元
</div>
<div style="font-size:16px; line-height:18px;float:right">
<p style="margin:0px; line-height:15px">
本月总收入: <span style="color:#1f76c8;font-size:14px">' . $count1 . '</span>元
本月总支出: <span style="color:#1f76c8;font-size:14px">' . $count2 . '</span>元</p>
<p style="margin:0px; line-height:15px">
账单周期:' . $params['uyear'] . '年' . $params['umonth'] . '月01日—' . $params['uyear'] . '年' . $params['umonth'] . '月' . $day . '日
</p>
</div>
</div>';
Yii::import('application.extensions.tcpdf.*');
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// 设置文档信息
$pdf->SetCreator('--');
$pdf->SetAuthor('北京嘉配科技有限公司');
$pdf->SetTitle('由你配 - 对账单');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, PHP');
// 设置页眉和页脚信恿
$pdf->SetHeaderData('', 30, '', '', array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
// 设置页眉和页脚字使
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// 设置默认等宽字体
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// 设置间距
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// 设置分页
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// 设置字体
$pdf->SetFont('stsongstdlight', '', 14, true);
// 添加页面
$pdf->AddPage();
// Image example with resizing
$pdf->Image(F::themeUrl() . '/images/jpd/logo_account.jpg', 20, 28, 30, 18, 'JPG', '', '', true, 150, '', false, false, 0, false, false, false);
// 设置字体阴影
//$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));
// 输出HTML内容
$pdf->writeHTML($html, true, false, true, false, '');
if (!empty($data1)) {
$html = '<p style="color:#1f76c8">订单明细:</p>';
//.........这里部分代码省略.........
示例3: boookattach
function boookattach($results, $type = '')
{
// Include the main TCPDF library (search for installation path).
//require_once('tcpdf/examples/tcpdf_include.php');
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'utf-8', false);
//$pdf->Footer('hello');
// create new PDF document
//$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetAuthor('Nicola Asuni');
//$pdf->SetTitle('TCPDF Example 001');
//$pdf->SetSubject('<h1>TCPDF Tutorial</h1>');
//$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, '<div style="float:right">haoooooooo</div>', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(20);
//echo PDF_MARGIN_FOOTER;exit;
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set default font subsetting mode
$pdf->setFontSubsetting(true);
// Set font
// dejavusans is a UTF-8 Unicode font, if you only need to
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
//$pdf->SetFont('dejavusans', '', 10, '', true);
$pdf->SetFont('Helvetica', '', 10, '', 'false');
// Add a page
// This method has several options, check the source code documentation for more information.
$pdf->AddPage();
// set text shadow effect
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 1, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 0, 'blend_mode' => 'Normal'));
// Set some content to print
$tbl = '<br /><br/><br/><br/>
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
<tr>
<td style="width:60%"><b>Your Personal Travel Advisor:</b>' . @$results['pdfdata']['adviser_info']['name'] . '</td>
<td style="width:40%"><b>Quote Reference:</b>' . @$results['pdfdata']['adviser_info']['reference'] . '</td>
</tr>
<tr>
<td style="width:60%"><b>Phone Number:</b>' . @$results['pdfdata']['adviser_info']['phone'] . '</td>
<td style="width:40%"><b>Date:</b> ' . @$results['pdfdata']['adviser_info']['date'] . '</td>
</tr>
<tr>
<td style="width:60%"><b>Email Address:</b>' . @$results['pdfdata']['adviser_info']['email'] . '</td>
<td style="width:40%"><b>Adults:</b> ' . @$results['seg'][0]['num_adults'] . ' <b>Children:</b> ' . @$results['seg'][0]['num_children'] . '</td>
</tr>
</table>';
$pdf->writeHTML($tbl, true, false, false, false, '');
//$ci = $results['controller'];
$t = json_decode($results['row'][0]['adults_info'], true);
$tbl = '
<div>
<span>Dear ' . $t['fname'][0] . '</span>
</br>
<p>
I have pleasure in enclosing a quote in respect of your recent enquiry with Super Escapes. Please feel free to contact us, should you need any more information or advice.
</p>
</div>';
$pdf->writeHTML($tbl, true, false, false, false, '');
if (isset($results['fobj'])) {
$depts = fetch_departures();
$arrivs = fetch_arrivals();
$dep_arr = explode('-', $depts[$results['fobj']['@attributes']['depapt']]);
$arr_arr = explode('-', $arrivs[$results['fobj']['@attributes']['arrapt']]);
$ret_arr = explode('-', $depts[$results['fobj']['@attributes']['retapt']]);
$dept_start_time = substr(explode(' ', $results['fobj']['@attributes']['outdep'])[1], 0, -3);
$dept_arr_time = substr(explode(' ', $results['fobj']['@attributes']['outarr'])[1], 0, -3);
$return_start_time = substr(explode(' ', $results['fobj']['@attributes']['indep'])[1], 0, -3);
$return_arr_time = substr(explode(' ', $results['fobj']['@attributes']['inarr'])[1], 0, -3);
$tbl = '
<b><u>Flight Details : </u></b><br><br>
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
<tr>
<th style="width:35%;text-align:center;font-weight:bold;">Route</th>
<td style="width:13%;text-align:center;font-weight:bold;">Dep Date</td>
<td style="width:13%;text-align:center;font-weight:bold;">Dep Time</td>
<td style="width:13%;text-align:center;font-weight:bold;">Arr Date</td>
<td style="width:13%;text-align:center;font-weight:bold;">Arr Time</td>
<td style="width:13%;text-align:center;font-weight:bold;">Flight No</td>
//.........这里部分代码省略.........
示例4: MYPDF
$this->SetX($this->original_lMargin);
}
$this->Cell($this->w - $this->original_lMargin - $this->original_rMargin, 0, '', 'T', 0, 'C');
}
}
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('eoe.cn');
$pdf->SetTitle(PDF_HEADER_TITLE);
$pdf->SetSubject(PDF_HEADER_TITLE);
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
$pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
示例5: creatNewPdf
function creatNewPdf()
{
$agru = func_get_arg(0);
$logo = $agru['logo'];
$link = $agru['link'];
$target = $agru['target'];
$logoExtention = $agru['logo_extention'];
$date = $agru['date'];
$title = $agru['title'];
$disc = $agru['description'];
$image = $agru['image'];
$content = $agru['content'];
$copyright = $agru['copyright'];
$fileName = $agru['file_name'];
$pdfCreator = $agru['pdf_creator'];
$pdfAuthor = $agru['pdf_author'];
$pdfTitle = $agru['pdf_title'];
$pdfSubject = $agru['pdf_subject'];
$pdfKeywords = $agru['pdf_keywords'];
// create new PDF document
$pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setTempRTL('R');
$pdf->image_file = $logo;
$pdf->href = $target;
$pdf->link = $link;
$pdf->copyright = $copyright;
$this->extention = $logoExtention;
# must included in each decument[Must Include]
// appear in document properties
$pdf->SetCreator($pdfCreator);
$pdf->SetAuthor($pdfAuthor);
$pdf->SetTitle($pdfTitle);
$pdf->SetSubject($pdfSubject);
$pdf->SetKeywords($pdfKeywords);
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, ' ', ' ', array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
// header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// end of header
# set default monospaced font[Must Include]
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
# set margins[Must Include]
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
// header & footer margin
$pdf->SetHeaderMargin(50);
$pdf->SetFooterMargin(20);
$pdf->SetAutoPageBreak(TRUE, 30);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
//$pdf->SetFont('almohanad', '', 13);
$pdf->setRTL(true);
// cehck here if ar or en
$pdf->startPageGroup();
$pdf->AddPage();
$lg = array();
$lg['a_meta_charset'] = 'UTF-8';
$lg['a_meta_dir'] = 'rtl';
$pdf->setLanguageArray($lg);
$pdf->SetFont('almohanad', '', 13);
$pdf->setRTL(true);
// cehck here if ar or en
$html = '
<div >
<br/>
<span id="date"style="color:#008080" > ' . $date . ' </span>
<h3 id="title" style="color:#191970"> ' . $title . ' </h3>
<h5 id="description" style="color:#6A5ACD"> ' . $disc . ' </h5>
<img src="' . $image . '" alt="' . $title . '" />
<div style="align:justify"> ' . $content . ' </div>
</div>
';
// $pdf->writeHTML($html, true, false, false, true, "");
$pdf->writeHTMLCell($w = 170, $h = 0, $x = 0, $y = 0, $html, $border = 0, $ln = 0, $fill = false, $reseth = true, $align = "R");
$pdf->setRTL(true);
#excute the file
$pdf->Output(PDF_FILES . $fileName . '.pdf', 'F');
}