本文整理汇总了PHP中TCPDF::setFooterData方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::setFooterData方法的具体用法?PHP TCPDF::setFooterData怎么用?PHP TCPDF::setFooterData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF
的用法示例。
在下文中一共展示了TCPDF::setFooterData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPdfOutput
public function testPdfOutput()
{
// 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('TCPDF Tutorial');
$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->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(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 (optional)
$pdf->setLanguageArray($this->langSettings);
// ---------------------------------------------------------
// 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', '', 14, '', true);
// 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' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
// Set some content to print
$html = <<<EOD
<h1>Welcome to <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;"> <span style="color:black;">TC</span><span style="color:white;">PDF</span> </a>!</h1>
<i>This is the first example of TCPDF library.</i>
<p>This text is printed using the <i>writeHTMLCell()</i> method but you can also use: <i>Multicell(), writeHTML(), Write(), Cell() and Text()</i>.</p>
<p>Please check the source code documentation and other examples for further information.</p>
<p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>
EOD;
// Print text using writeHTMLCell()
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
$this->comparePdfs($pdf);
}
示例2: pdfthongkeAction
public function pdfthongkeAction()
{
$translate = Zend_Registry::get('Zend_Translate');
$this->view->title = 'Thống kê - ' . $translate->_('TEXT_DEFAULT_TITLE');
$this->view->headTitle($this->view->title);
$layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED;
$option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath);
Zend_Layout::startMvc($option);
$date = new Zend_Date();
$date->subMonth(1);
$thang = $this->_getParam('thang', $date->toString('M'));
$nam = $this->_getParam('nam', $date->toString('Y'));
$auth = Zend_Auth::getInstance();
$identity = $auth->getIdentity();
$em_id = $identity->em_id;
$emModel = new Front_Model_Employees();
$phongbanModel = new Front_Model_Phongban();
$my_info = $emModel->fetchRow('em_id=' . $em_id . ' and em_status=1');
$phong_ban_id = $list_phongban = $phong_ban = array();
if ($my_info) {
$phong_ban_id[] = $my_info->em_phong_ban;
$list_phongban = $phongbanModel->fetchDataStatus($my_info->em_phong_ban, $phong_ban);
}
if (sizeof($list_phongban)) {
foreach ($list_phongban as $phong_ban_info) {
$phong_ban_id[] = $phong_ban_info->pb_parent;
}
}
$phong_ban_id = implode(',', $phong_ban_id);
$list_nhan_vien = $emModel->fetchAll("em_phong_ban in ({$phong_ban_id}) and em_status=1");
$holidaysModel = new Front_Model_Holidays();
$holidays = $holidaysModel->fetchData();
$listHoliday = array();
foreach ($holidays as $holiday) {
$listHoliday[$holiday['hld_id']] = $holiday['hld_code'];
}
$k = 0;
if ($list_nhan_vien) {
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor(PDF_AUTHOR);
$pdf->SetTitle(PDF_HEADER_TITLE);
$pdf->SetSubject(PDF_HEADER_TITLE);
$pdf->SetKeywords('bang luong');
$pdf->setPrintHeader(false);
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(5, PDF_MARGIN_TOP, 5);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('dejavusans', '', 14, '', true);
$pdf->AddPage('L', 'A4');
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
$text_outout = '
<style>
.ten-co-quan {
color: #000;
font-size: 10pt;
height: 50px;
text-align:center;
}
.ten-bang-luong{
height: 30px;
text-align:center;
font-size: 10pt;
}
table.first {
color: #003300;
font-family: helvetica;
font-size: 8pt;
border-left: 3px solid red;
border-right: 3px solid #FF00FF;
border-top: 3px solid green;
border-bottom: 3px solid blue;
background-color: #ccffcc;
}
.borders {
border: 1px solid #000;
font-size: 10px;
}
.tieu-de{
height: 20px;
font-size: 11px;
}
.noi-dung{
font-size: 10px;
}
td.second {
border: 2px dashed green;
}
.lowercase {
text-transform: lowercase;
}
//.........这里部分代码省略.........
示例3: getPdfFileData
/**
* @param TicketsOrder $order
* @param string $format 'S': data string - 'I' to see in browser
* @return string
*/
public function getPdfFileData(TicketsOrder $order, $format = 'S')
{
$pdf = new \TCPDF();
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Billets du Louvre');
$pdf->SetTitle('Commande ' . $order->getRef());
$pdf->setPrintHeader(false);
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set style for barcode
$style = array('border' => 0, 'vpadding' => 'auto', 'hpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 1, 'module_height' => 1);
/** @var Ticket $ticket */
foreach ($order->getTickets() as $ticket) {
$pdf->AddPage();
$html = $this->renderTicket(array('visit_date' => $order->getVisitDate()->format('d/m/Y'), 'visit_duration' => $order->getVisitDuration(), 'code' => $order->getRef(), 'ticket_name' => $ticket->getName(), 'price' => $ticket->getPrice(), 'details' => $ticket->getTicketDetails()));
$pdf->writeHTML($html, true, false, true);
$pdf->write2DBarcode($order->getRef(), 'QRCODE,H', 150, 10, 50, 50, $style, 'N');
$pdf->lastPage();
}
return $pdf->Output('tickets.pdf', $format);
}
示例4: executeIndex
//.........这里部分代码省略.........
end($this->all_rows);
// Check which field we need to display.
foreach ($fields as $field_id) {
// See lib\form\ReportingForm.class.php for indexes
switch ($field_id) {
case 0:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Date'), $reservation->getDate());
break;
case 1:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('User'), $reservation->getUser()->getFullName());
break;
case 2:
$this->all_rows[key($this->all_rows)][] = array($activity_name, $reservation->getActivity()->getName());
break;
case 3:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Duration'), number_format($reservation->getDuration()));
break;
case 4:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Room'), $reservation->getRoomprofile()->getRoom()->getName());
break;
case 5:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Reason'), !is_null($reservation->getReservationreason()) ? $reservation->getReservationreason()->getName() : null);
break;
case 6:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Comment'), $reservation->getComment());
break;
case 7:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Group'), $resa_group_name);
break;
case 8:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Members count'), number_format($reservation->getMembersCount()));
break;
case 9:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Guests count'), number_format($reservation->getGuestsCount()));
break;
case 10:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Status'), number_format($reservation->getStatus()));
break;
case 11:
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Price'), number_format($reservation->getPrice()));
break;
case 12:
$valuedFeaturesArray = $reservation->getRoomprofile()->getRoom()->getValuedFeaturesArray();
$concat = '';
foreach ($valuedFeaturesArray as $featureName => $values) {
$concat .= $featureName . '=' . $values . ' | ';
}
$concat = rtrim($concat, ' | ');
$this->all_rows[key($this->all_rows)][] = array($i18n->__('Features'), $concat);
break;
case 90:
$this->all_rows[key($this->all_rows)][] = array($free_field_1_name, $reservation->getCustom1());
break;
case 91:
$this->all_rows[key($this->all_rows)][] = array($free_field_2_name, $reservation->getCustom2());
break;
case 92:
$this->all_rows[key($this->all_rows)][] = array($free_field_3_name, $reservation->getCustom3());
break;
}
}
}
if ($export == 'csv') {
$this->setLayout(false);
$this->getResponse()->clearHttpHeaders();
$this->getResponse()->setHttpHeader('Pragma: public', true);
$this->getResponse()->setHttpHeader('Content-disposition', sprintf('attachment; filename="%s"', 'reporting-' . date('Y-m-d') . '.csv'));
$this->getResponse()->setContentType('text/csv; charset=utf-8');
$this->getResponse()->sendHttpHeaders();
$this->setTemplate('exportCSV');
} else {
if ($export == 'pdf') {
$config = sfTCPDFPluginConfigHandler::loadConfig();
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('ISLOG Tempos');
$pdf->SetTitle('Tempos report export');
$pdf->SetSubject('Tempos export');
$pdf->SetKeywords('Tempos, report, ISLOG');
$pdf->SetHeaderData(sfConfig::get('app_has_logo'), PDF_HEADER_LOGO_WIDTH, $i18n->__('Report'), sprintf($i18n->__('Usage report from %s to %s'), $this->form->getValue('begin_date'), $this->form->getValue('end_date')));
$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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('dejavusans', '', 10, '', true);
$pdf->AddPage();
$this->writeHtmlTable($pdf, $this->all_rows);
$pdf->Output('reporting-' . date('Y-m-d') . '.pdf', 'I');
exit;
}
}
}
}
示例5: TCPDF
include '../../protected/config/db_config.php';
$db = new db_config();
$connect = $db->connect();
// create new PDF document
//$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// add a page
$pdf = new TCPDF();
//$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'LETTER', true, 'UTF-8', false);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetAuthor('Nicola Asuni');
$pdf->SetSubject('');
$pdf->SetKeywords('');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . 'ZÁRIL lifestyle store', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData(array(0, 1, 0), array(0, 1, 1));
$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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$resolution = array(80, 100);
$pdf->AddPage('P', $resolution);
$pdf->SetTitle('Tenant Sales Report');
$html = $_GET['html'];
#$html .='<div>'. $html .'</div>';
$pdf->writeHTML($html, false, false, true, false, '');
$pdf->Output('..');
示例6: TCPDF
<?php
// Include the main TCPDF library (search for installation path).
require_once 'tcpdf_include.php';
// 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('TCPDF Tutorial');
$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, array(0, 64, 255), array(0, 64, 128));
//$pdf->setFooterData(array(0,64,0), array(0,64,128));
$pdf->setFooterData(PDF_FOOTER_STRING, 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(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 (optional)
if (@file_exists(dirname(__FILE__) . 'lang/spa.php')) {
示例7: ConstructFlightEventsList
public function ConstructFlightEventsList($extFlightId, $sections = [], $colored = false)
{
$flightId = $extFlightId;
$user = $this->_user->username;
$Fl = new Flight();
$flightInfo = $Fl->GetFlightInfo($flightId);
$bruType = $flightInfo['bruType'];
unset($Fl);
$Bru = new Bru();
$bruInfo = $Bru->GetBruInfo($bruType);
$flightApHeaders = $Bru->GetBruApHeaders($bruType);
$flightBpHeaders = $Bru->GetBruBpHeaders($bruType);
$prefixArr = $Bru->GetBruApCycloPrefixes($bruType);
unset($Bru);
$Frame = new Frame();
$framesCount = $Frame->GetFramesCount($flightInfo['apTableName'], $prefixArr[0]);
//giving just some prefix
unset($Frame);
// create new PDF document
$pdf = new TCPDF('L', 'mm', 'A4', true, 'UTF-8', false);
// set document information
$pdf->SetCreator($user);
$pdf->SetAuthor($user);
$pdf->SetTitle('Flight events list');
$pdf->SetSubject('Flight events list');
// $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
$bort = $flightInfo['bort'];
$voyage = $flightInfo['voyage'];
$copyDate = date('H:i:s d-m-Y', $flightInfo['startCopyTime']);
$Fr = new Frame();
$flightDuration = $Fr->FrameCountToDuration($framesCount, $bruInfo['stepLength']);
unset($Fr);
$usrInfo = $this->_user->userInfo;
$headerStr = $usrInfo['company'];
$imageFile = '';
if ($colored && $usrInfo['logo'] != '') {
$imageFile = SITE_ROOT_DIR . '/fileUploader/files/' . uniqid() . '.png';
file_put_contents($imageFile, $usrInfo['logo']);
$img = file_get_contents($imageFile);
$pdf->SetHeaderData('$' . $img, "20", $headerStr, "", [0, 10, 50], [0, 10, 50]);
} else {
// set default header data
$pdf->SetHeaderData("", "", $headerStr, "", [0, 10, 50], [0, 10, 50]);
}
$pdf->setFooterData([0, 10, 50], [0, 10, 50]);
// set header and footer fonts
$pdf->setHeaderFont(array('dejavusans', '', 11));
$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 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', '', 12, '', true);
// Add a page
// This method has several options, check the source code documentation for more information.
$pdf->AddPage();
if ($imageFile !== '') {
unlink($imageFile);
}
// set text shadow effect
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => [196, 196, 196], 'opacity' => 1, 'blend_mode' => 'Normal'));
// Pasport
$strStyle = "text-align:center; font-size: xx-large; font-weight: bold; color: rgb(0, 10, 64);";
$str = '<p style="' . $strStyle . '">' . $this->lang->pasport . '</p>';
$pdf->writeHTML($str, true, false, false, false, '');
// Pasport info
$strStyle = "text-align:center;";
$str = '<p style="' . $strStyle . '">' . $this->lang->bruType . ' - ' . $bruInfo['bruType'] . '. <br>' . $this->lang->bort . ' - ' . $flightInfo['bort'] . '; ' . $this->lang->voyage . ' - ' . $flightInfo['voyage'] . '; ' . $this->lang->route . ' : ' . ($new_string = preg_replace('/[^a-zA-z0-9]/', '', $flightInfo['departureAirport']) . ' - ' . preg_replace('/[^a-zA-z1-9]/', '', $flightInfo['arrivalAirport']) . '. <br>' . $this->lang->flightDate . ' - ' . date('H:i:s d-m-Y', $flightInfo['startCopyTime']) . '; ' . $this->lang->duration . ' - ' . $flightDuration . '. <br>');
$fileName = date('Y-m-d_H.i.s', $flightInfo['startCopyTime']) . '_' . $flightInfo['bort'] . '_' . $flightInfo['voyage'] . '_' . $bruInfo['bruType'];
if (strpos($bruInfo['aditionalInfo'], ";") >= 0) {
$counterNeedBrake = false;
$aditionalInfoArr = explode(";", $flightInfo['flightAditionalInfo']);
foreach ($aditionalInfoArr as $aditionalInfo) {
if ($aditionalInfo != "") {
$nameVal = explode(":", $aditionalInfo);
if (count($nameVal) > 1) {
$name = $nameVal[0];
$val = $nameVal[1];
if ($counterNeedBrake) {
$str .= (isset($this->lang->{$name}) ? $this->lang->{$name} : $name) . " - " . $val . "; </br>";
$counterNeedBrake = !$counterNeedBrake;
} else {
$str .= (isset($this->lang->{$name}) ? $this->lang->{$name} : $name) . " - " . $val . "; ";
$counterNeedBrake = !$counterNeedBrake;
}
}
}
//.........这里部分代码省略.........
示例8: rekapitulasi_lahan_kecamatan_pdf
public function rekapitulasi_lahan_kecamatan_pdf($tahun, $periode)
{
/// 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('Dinas PU CKTR Sidoarjo');
$pdf->SetTitle('Rekapitulasi_Lahan_Perkecamatan_Triwulan' . $periode . '_' . $tahun);
$pdf->SetSubject('TCPDF');
$pdf->SetKeywords('TCPDF, PDF');
$pdf->SetHeaderData('sidoardjo.png', 20, 'PEMERINTAH KABUPATEN SIDOARDJO', 'DINAS PEKERJAAN UMUM CIPTA KARYA DAN TATA RUANG', 'REKAPITULASI DATA LAHAN PERUMAHAH / PEMUKIMAN');
$pdf->setFooterData('Triwulan ' . $periode . ' Tahun ' . $tahun);
$pdf->setBarcode(date('Y-m-d H:i:s'));
// 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 (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 20);
// add a page
$pdf->AddPage('L', 'A3');
// $pdf->Write(0, 'PEMBANGUNAN PERUMAHAN / PEMUKIMAN', '', 0, 'C', true, 0, false, false, 0);
// $pdf->Write(0, 'REKAPITULASI DATA LAHAN PERUMAHAH / PEMUKIMAN', '', 0, 'C', true, 0, false, false, 0);
$pdf->SetFont('helvetica', '', 11);
// $pdf->Write(0, 'Tahun :' .$tahun, '', 0, 'L', true, 0, false, false, 0);
// $pdf->Write(0, 'Periode : Triwulan' .$periode, '', 0, 'L', true, 0, false, false, 0);
$pdf->SetLineWidth(5);
$pdf->SetDrawColor(0, 128, 255);
$pdf->SetFillColor(255, 255, 128);
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
$k['JML_IJIN_LOKASI'] = $k['LUAS'] = $k['RENCANA_TAPAK'] = $k['PEMBEBASAN'] = $k['TERBANGUN'] = $k['BELUM_TERBANGUN'] = $k['DIALOKASIKAN'] = $k['PEMBEBASAN'] = $k['DIMATANGKAN'] = $k['AKTIF_DLM_PEMBANGUNAN'] = $k['AKTIF_BERHENTI'] = $k['AKTIF_SDH_SELESAI'] = $k['TIDAK_AKTIF'] = 0;
$tb = "";
$this->load->model('m_report');
$nilai = $this->m_report->jumlah_kecamatan();
foreach ($nilai as $nil) {
$jmlkec = $nil['JUMLAH'];
$data['jumlah'] = $nil['JUMLAH'];
}
for ($j = 1; $j <= $jmlkec; $j++) {
$data['lah_kec'][$j] = $this->m_report->tabel_lahan_kecamatan_all($j, $tahun, $periode);
$data['aktifpemb'][$j] = $this->m_report->aktif_dalam_pembangunan($j, $tahun, $periode);
$data['aktifber'][$j] = $this->m_report->aktif_berhenti($j, $tahun, $periode);
$data['aktifsel'][$j] = $this->m_report->aktif_sdh_selesai($j, $tahun, $periode);
$data['tdkaktif'][$j] = $this->m_report->tidak_aktif($j, $tahun, $periode);
}
for ($c = 1; $c < $jmlkec; $c++) {
foreach ($data['lah_kec'][$c] as $i) {
$tb .= "<tr>\n <td width=\"28px\">" . $c . "</td>\n <td width=\"100px\">" . $i['NAMA_KECAMATAN'] . "</td> \n <td width=\"87px\">" . $i['JML_IJIN_LOKASI'] . " </td>\n <td width=\"87px\">" . $i['LUAS'] . " </td>\n <td width=\"87px\">" . $i['RENCANA_TAPAK'] . " </td>\n <td width=\"90px\">" . $i['PEMBEBASAN'] . " </td>\n <td width=\"87px\">" . $i['TERBANGUN'] . " </td>\n <td width=\"87px\">" . $i['BELUM_TERBANGUN'] . " </td>\n <td width=\"90px\">" . $i['DIALOKASIKAN'] . " </td>\n <td width=\"90px\">" . $i['PEMBEBASAN'] . " </td>\n <td width=\"87px\">" . $i['DIMATANGKAN'] . " </td>";
$k['JML_IJIN_LOKASI'] += $i['JML_IJIN_LOKASI'];
$k['LUAS'] += $i['LUAS'];
$k['RENCANA_TAPAK'] += $i['RENCANA_TAPAK'];
$k['PEMBEBASAN'] += $i['PEMBEBASAN'];
$k['TERBANGUN'] += $i['TERBANGUN'];
$k['BELUM_TERBANGUN'] += $i['BELUM_TERBANGUN'];
$k['DIALOKASIKAN'] += $i['DIALOKASIKAN'];
$k['PEMBEBASAN'] += $i['PEMBEBASAN'];
$k['DIMATANGKAN'] += $i['DIMATANGKAN'];
}
foreach ($data['aktifpemb'][$c] as $i) {
$tb .= "<td width=\"87px\">" . $i['AKTIF_DLM_PEMBANGUNAN'] . "</td>";
$k['AKTIF_DLM_PEMBANGUNAN'] += $i['AKTIF_DLM_PEMBANGUNAN'];
}
foreach ($data['aktifber'][$c] as $i) {
$tb .= "<td width=\"87px\">" . $i['AKTIF_BERHENTI'] . " </td>";
$k['AKTIF_BERHENTI'] += $i['AKTIF_BERHENTI'];
}
foreach ($data['aktifsel'][$c] as $i) {
$tb .= "<td width=\"87px\">" . $i['AKTIF_SDH_SELESAI'] . " </td>";
$k['AKTIF_SDH_SELESAI'] += $i['AKTIF_SDH_SELESAI'];
}
foreach ($data['tdkaktif'][$c] as $i) {
$tb .= "<td width=\"87px\">" . $i['TIDAK_AKTIF'] . " </td> \n </tr> ";
$k['TIDAK_AKTIF'] += $i['TIDAK_AKTIF'];
}
}
$tb1 = "";
$tb1 .= "<tr>\n \n <td width=\"130px\">JUMLAH</td>\n <td width=\"87px\">" . $k['JML_IJIN_LOKASI'] . " </td>\n <td width=\"87px\">" . $k['LUAS'] . " </td>\n <td width=\"87px\">" . $k['RENCANA_TAPAK'] . " </td>\n <td width=\"90px\">" . $k['PEMBEBASAN'] . " </td>\n <td width=\"87px\">" . $k['TERBANGUN'] . " </td>\n <td width=\"87px\">" . $k['BELUM_TERBANGUN'] . " </td>\n <td width=\"90px\">" . $k['DIALOKASIKAN'] . " </td>\n <td width=\"90px\">" . $k['PEMBEBASAN'] . " </td>\n <td width=\"87px\">" . $k['DIMATANGKAN'] . " </td>\n <td width=\"87px\">" . $k['AKTIF_DLM_PEMBANGUNAN'] . " </td>\n <td width=\"87px\">" . $k['AKTIF_BERHENTI'] . " </td>\n <td width=\"87px\">" . $k['AKTIF_SDH_SELESAI'] . " </td>\n <td width=\"87px\">" . $k['TIDAK_AKTIF'] . " </td>\n \n </tr> ";
$tbl = <<<EOD
<table border="1" cellpadding="2" cellspacing="2">
<thead>
<tr style="background-color:#FFFF00;color:#0000FF;">
<td width="28px" align="center"><b>NO</b></td>
<td width="100px" align="center"><b>Kecamatan</b></td>
<td width="87px " align="center"> <b>Perusahaan</b></td>
//.........这里部分代码省略.........
示例9: TCPDF
require_once 'lib/tcpdf/tcpdf.php';
date_default_timezone_set("PRC");
$json = json_decode($_POST['content']);
if ($json) {
//实例化
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
// 设置文档信息
$pdf->SetCreator('today.exformation.com.cn');
$pdf->SetAuthor('today.exformation.com.cn');
$pdf->SetTitle($json->today);
$pdf->SetSubject($json->today);
$pdf->SetKeywords($json->today);
// 设置页眉和页脚信息
$pdf->SetHeaderData('', 0, '今日|' . $json->today, 'today.exformation.com.cn');
$pdf->setFooterData('today.exformation.com.cn');
// 设置页眉和页脚字体
$pdf->setHeaderFont(array('droidsansfallback', '', '10'));
$pdf->setFooterFont(array('helvetica', '', '8'));
// 设置默认等宽字体
$pdf->SetDefaultMonospacedFont('courier');
// 设置间距
$pdf->SetMargins(15, 21, 15);
$pdf->SetHeaderMargin(5);
$pdf->SetFooterMargin(10);
$pdf->setCellHeightRatio(0.7);
// 设置分页
$pdf->SetAutoPageBreak(TRUE, 25);
// set image scale factor
$pdf->setImageScale(1.25);
// set default font subsetting mode
示例10: TCPDF
<?php
// Include the main TCPDF library (search for installation path).
require_once 'tcpdf.php';
require_once 'config/eng.php';
// 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('PGIpharm');
$pdf->SetTitle('PGIpharm drug response report');
$pdf->SetSubject('');
$pdf->SetKeywords('PGI, PDF, research, test, report');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING, array(0, 0, 0), array(0, 0, 0));
$pdf->setFooterData(array(0, 0, 0), array(0, 0, 0));
// 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 (optional)
// ---------------------------------------------------------
示例11: create_pdf
public function create_pdf()
{
/**
* Creates an example PDF TEST document using TCPDF
* @package com.tecnick.tcpdf
* @abstract TCPDF - Example: Default Header and Footer
* @author Nicola Asuni
* @since 2008-03-04
*/
// 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('Guadalajara');
$pdf->SetTitle('Formato Guadalajara');
$pdf->SetSubject('Formatos Espacios Abiertos');
$pdf->SetKeywords('Guadalajara, centro_historico');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, '', '', array(91, 104, 113), array(91, 104, 113));
$pdf->setFooterData(array(91, 104, 113), array(91, 104, 113));
// 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 (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('times', '', 14, '', true);
// INICIA FORMATO DE DECLARACIÓN PERSONA FÍSICA
$pdf->AddPage();
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
$html = <<<EOD
<br>
<h1>titulo</h1>
<p style="text-align: right;">texto</p>
<br>
<br>
EOD;
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
// TERMINA FORMATO DE DECLARACIÓN PERSONA FÍSICA
// ---------------------------------------------------------
// Close and output PDF document
// This method has several options, check the source code documentation for more information.
$pdf->Output('formatos_guadalajara.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
}
示例12: downAction
//.........这里部分代码省略.........
<td>PC thâm niên</td>
<td>' . $tham_nien . ' Năm</td>
<td>' . $hs_pc_tham_nien . '</td>
<td>' . number_format($thanh_tien_pc_tham_nien, 0, '.', ',') . '</td>
</tr>
<tr>
<td>PC ưu đãi nghề</td>
<td>' . $uu_dai_nghe . '%</td>
<td>' . $hs_pc_uu_dai_nghe . '</td>
<td>' . number_format($thanh_tien_pc_uu_dai_nghe, 0, '.', ',') . '</td>
</tr>
<tr>
<td>PC công vụ</td>
<td>' . $cong_vu . '%</td>
<td>' . $hs_pc_cong_vu . '</td>
<td>' . number_format($thanh_tien_pc_cong_vu, 0, '.', ',') . '</td>
</tr>
<tr>
<td>PC kiêm nhiệm</td>
<td colspan="2">' . $hs_pc_kiem_nhiem . '</td>
<td>' . number_format($thanh_tien_pc_kiem_nhiem, 0, '.', ',') . '</td>
</tr>
<tr>
<td>PC khác</td>
<td colspan="2">' . $hs_pc_khac . ($hs_pc_khac_type ? '%' : '') . '</td>
<td>' . number_format($thanh_tien_pc_khac, 0, '.', ',') . '</td>
</tr>
<tr>
<td colspan="3">Tổng cộng (I)</td>
<td>' . number_format($tong_1, 0, '.', ',') . '</td>
</tr>
<tr>
<td>Tỷ lệ tăng thêm</td>
<td colspan="2">' . $hs_tang_them . '</td>
<td>' . number_format($ti_le_tang_them, 0, '.', ',') . '</td>
</tr>
<tr>
<td colspan="3"><strong>Tổng cộng (II)</strong></td>
<td><strong>' . number_format($tong_2, 0, '.', ',') . '</strong></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" class="tieu-de"></td>
</tr>
' . $khen_thuong_text_out . '
<tr>
<td colspan="3" class="tieu-de"></td>
</tr>
' . $ky_luat_text_out . '
<tr>
<td colspan="3" class="tieu-de"></td>
</tr>
<tr>
<td colspan="3">
<br/>
<table border="1" width="100%" class="noi-dung" cellpadding="5" nobr="true">
<tr>
<td style="width: 395pt;"><strong>Tổng được nhận = II + III + IV</strong></td>
<td style="width: 100pt;"><strong>' . number_format($tong_cong, 0, '.', ',') . '</strong></td>
</tr>
</table>
</td>
</tr>
</table>
';
/*
$mpdf->WriteHTML($text_outout);
$file_name = $this->loc_tieng_viet($em_info->em_ho) . '_' . $this->loc_tieng_viet($em_info->em_ten) . '_' . $thang . '-' . $nam . '.pdf';
$mpdf->Output($file_name, 'D');
*/
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor(PDF_AUTHOR);
$pdf->SetTitle(PDF_HEADER_TITLE);
$pdf->SetSubject(PDF_HEADER_TITLE);
$pdf->SetKeywords('bang luong');
$pdf->setPrintHeader(false);
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
$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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('dejavusans', '', 14, '', true);
$pdf->AddPage();
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
$file_name = $this->loc_tieng_viet($em_info->em_ho) . '_' . $this->loc_tieng_viet($em_info->em_ten) . '_' . $thang . '-' . $nam . '.pdf';
$pdf->writeHTMLCell(0, 0, '', '', $text_outout, 0, 1, 0, true, '', true);
// ---------------------------------------------------------
// Close and output PDF document
// This method has several options, check the source code documentation for more information.
$pdf->Output($file_name, 'I');
die;
}
}
示例13: actionPDF
public function actionPDF()
{
$session = new CHttpSession();
$session->open();
if (isset($session['orderVariations']) && is_array($session['orderVariations']) && count($session['orderVariations']) > 0) {
require_once Yii::getPathOfAlias('webroot.protected.extensions.pdf.tcpdf') . DIRECTORY_SEPARATOR . 'tcpdf.php';
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$aOrderVariations = $session['orderVariations'];
$html_output = '<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><table>';
$html_output .= '<tr><td colspan="3"></td></tr>';
$html_output .= '<tr><td colspan="3">' . Yii::t('strings', 'Order products:') . "</td></tr>";
$html_output .= '<tr><td colspan="3"></td></tr>';
foreach ($aOrderVariations as $variation_id) {
$Product2variation = Product2variation::model()->find('variation_id=' . $variation_id);
if (isset($Product2variation)) {
$product = ProductDescription::model()->find('product_id=' . $Product2variation['product_id'] . ' AND language_id=' . $this->language_id);
$Variation = Variation::model()->find('variation_id=' . $variation_id);
$VariationDescription = VariationDescription::model()->find('variation_id=' . $variation_id . ' AND language_id=' . $this->language_id);
$html_output .= '<tr><td colspan="3">' . $product['product_name'] . '</td></tr>';
$html_output .= '<tr><td><img src="' . Yii::app()->request->getBaseUrl(true) . '/uploads/images/' . $Variation['variation_image'] . '" alt="product_image" width="100" height="50"/></td>';
$html_output .= '<td>' . $VariationDescription['variation_name'] . '<br/>' . $VariationDescription['variation_description'] . "</td></tr>";
$html_output .= '<tr><td colspan="3"></td><td></td></tr>';
}
}
$html_output .= '</table></body></html>';
$pdf->SetHeaderData(PDF_HEADER_LOGO, '', '', '', array(0, 64, 255), array(169, 172, 182));
$pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
$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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray($l);
$pdf->setFontSubsetting(true);
$pdf->SetFont('dejavusans', '', 14, '', true);
$pdf->AddPage();
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html_output, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'L', $autopadding = true);
$pdf->Output('order.pdf', 'I');
}
}
示例14: TCPDF
* @author Nicola Asuni
* @since 2008-03-04
*/
// Include the main TCPDF library (search for installation path).
require_once 'tcpdf_include.php';
// 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('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
$pdf->SetHeaderData(false);
$pdf->setFooterData(false);
// 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);
// 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);
示例15: createPdf
/** Creates a PDF for the Message
*
*/
private function createPdf($user, $uid)
{
require_once PATH_INCLUDE . '/pdf/tcpdf/config/lang/ger.php';
require_once PATH_INCLUDE . '/pdf/tcpdf/tcpdf.php';
// 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('LeG Uelzen');
$pdf->SetKeywords('');
// set default header data
$pdf->SetHeaderData('../../../res/images/logo.jpg', 15, 'LeG Uelzen', "Abmeldung von: " . $user['forename'] . " " . $user['name'] . " (geb. am " . $user['birthday'] . ")\nKlasse: " . $user['class'], array(0, 0, 0), array(0, 0, 0));
$pdf->setFooterData($tc = array(0, 0, 0), $lc = array(0, 0, 0));
// 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);
// ---------------------------------------------------------
// 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('helvetica', '', 11, '', true);
// 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' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
// Set some content to print
$html = '<p align="center"><h2>Rückgabe der LeG-Card / Löschung der Benutzerdaten</h2></p><br>' . 'Hiermit wird bestätigt, dass die Schulbücher von ' . $user['forename'] . ' ' . $user['name'] . ' vollständig zurückgegeben wurden. <br/>
Hiermit wird bestätigt, dass sämtliche personenbezogenen Daten am ' . date("d.m.Y") . ' aus dem System gelöscht wurden.<br/>';
if ($user['credit'] == "0.00") {
$html .= 'Es liegt kein Restguthaben vor.<br/>';
} else {
$html .= 'Es liegt ein Restguthaben in Höhe von ' . $user['credit'] . ' € vor. Dieses muss beim Caterer abgeholt werden.<br/>';
}
$html .= 'Mit der Rückgabe der LeG-Card kann das Pfandgeld in Höhe von 3,50 € zzgl. 0,50 €, je nach Zustand der Hülle, ausbezahlt werden.<br/>
Dieses Schreiben wurde maschinell erstellt und ist ohne Unterschrift gültig.
<hr>
<p align="center"><h3>Auszahlung des Restguthabens</h3></p><br>
Restguthaben in Höhe von ' . $user['credit'] . ' € am ___.___.2013 ausgezahlt.<br><br>
<br> Unterschrift Caterer
<br>
<hr>
<p align="center"><h3>Abschnitt für den Caterer</h3></p><br>
Restguthaben in Höhe von ' . $user['credit'] . ' € am ___.___.2013 erhalten.<br><br>
<br><br>Unterschrift ' . $user['forename'] . ' ' . $user['name'] . ' (geb. am ' . $user['birthday'] . ')
<hr>
<p align="center"><h3>Pfanderstattung</h3></p><br>
Bitte geben Sie diesen Abschnitt im Gnissel-Büro im Lessing-Gymnasium ab.<br>
Bitte kreuzen Sie an, ob Sie den Pfandbetrag an die Schülergenossenschaft Gnissel des LeG Uelzen spenden möchten
oder eine Überweisung auf ein Bankkonto wünschen.<br>
[ ] Das Pfandgeld möchte ich an Gnissel spenden<br>
[ ] Ich möchte das Pfandgeld auf folgendes Konto überwiesen haben:<br>
Kontoinhaber: <br>
Kontonummer:<br>
BLZ: <br>
Kreditinstitut: <br><br>
Uelzen, den ___.___.2013
Unterschrift ' . $user['forename'] . ' ' . $user['name'] . ' (geb. am ' . $user['birthday'] . ')<br>
';
// Print text using writeHTMLCell()
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
// ---------------------------------------------------------
if (!is_dir('../include/pdf/tempPdf')) {
mkdir('../include/pdf/tempPdf');
}
// Close and output PDF document
// This method has several options, check the source code documentation for more information.
$pdf->Output('../include/pdf/tempPdf/deleted_' . $uid . '.pdf', 'F');
return true;
}