本文整理汇总了PHP中MYPDF::SetTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP MYPDF::SetTitle方法的具体用法?PHP MYPDF::SetTitle怎么用?PHP MYPDF::SetTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MYPDF
的用法示例。
在下文中一共展示了MYPDF::SetTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadPage
function loadPage()
{
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->titulo = $this->getPlan();
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Red de Universidades Anahuac');
$pdf->SetTitle('Plan Estrategico');
$pdf->SetSubject($this->getPlan());
$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);
// 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 font
$pdf->SetFont('helvetica', 'N', 11);
// add a page
$pdf->AddPage();
$pdf->SetY(5);
$html = "\n<!-- EXAMPLE OF CSS STYLE -->\n<style> \n\ttd{\n\tborder:1px solid #666;\n\t}\n\t\n\ttd.title{\n\tbackground:#E5E5E5;\n\tpadding:10px;\n\t}\n \n</style> <br />";
$html .= $this->Model->getLineas();
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
//Close and output PDF document
$pdf->Output('plan_operativo.pdf', 'I');
}
示例2: implode
// set footer fonts
//$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set pdf information
if ($invoice_status == 'Credit Invoice') {
$doc_name = 'CREDIT';
} else {
$doc_name = 'FACTURE';
}
if ($purpose == 'printsn') {
$doc_name = 'SALESNOTE';
}
$pdf->SetTitle($pdf_strings[$doc_name] . ": " . $account_name);
$pdf->SetAuthor($owner_firstname . " " . $owner_lastname . ", " . $org_name);
$pdf->SetSubject($account_name);
$pdf->SetCreator('PDF Creator from www.crm-now.com');
//list product names as keywords
$productlisting = implode(", ", $product_name);
$pdf->SetKeywords($productlisting);
//Disable automatic page break
$pdf->SetAutoPageBreak(true, PDF_MARGIN_FOOTER);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
//initialize document
$pdf->AliasNbPages();
//in reference to body.php -> if a new page must be added if the space available for summary is too small
示例3: pdfGen
function pdfGen($group_name, $mode = NULL, $start_date, $end_date, $stats, $l, $title, $path_www)
{
global $centreon_path;
// 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 Reports Module");
$pdf->SetAuthor(getGeneralOptInfo("pdfreports_report_author"));
//$pdf->SetAuthor('Fully Automated Nagios');
$pdfTitle = $title . " " . $group_name;
//$pdfTitle = "Rapport de supervision du hostgroup ".$group_name;
$pdf->SetTitle($pdfTitle);
//$pdf->SetSubject('TCPDF Tutorial');
//$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// define default header data
$header = $title . " " . $group_name;
//$header = "Rapport de supervision du hostgroup ".$group_name;
//$ip = $_SERVER['HOSTNAME'];
$startDate = date("d/m/Y", $start_date);
$time = time();
$endDate = date("d/m/Y", $time);
$string = _("From") . " " . strftime("%A", $start_date) . " " . $startDate . " " . _("to") . " " . strftime("%A", $time) . " " . $endDate . "\n";
// set default header data
$pdf->SetHeaderData('../../../img/headers/' . getGeneralOptInfo("pdfreports_report_header_logo"), PDF_HEADER_LOGO_WIDTH, $header, $string);
// 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 font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage();
//Column titles
$header = array('Status', 'Time', 'Total Time', 'Mean Time', 'Alert');
// Pie chart Generation
$piechart_img = pieGen($stats, $mode);
//Data loading
$data = $pdf->LoadData($stats);
// print colored table
//$pdf->ColoredTable($header, $data,$chart_img);
if ($mode == "hgs") {
// Hostgroup
$pdf->ColoredTable($header, $data, $piechart_img, $path_www);
} else {
if ($mode == "sgs") {
// Servicegroup
$pdf->ServicesColoredTable($header, $data, $piechart_img, $path_www);
}
}
// ---------------------------------------------------------
//génération d'un nom de pdf
$endDay = date("d", $time);
$endYear = date("Y", $time);
$endMonth = date("m", $time);
$pdfDirName = getGeneralOptInfo("pdfreports_path_gen") . $endYear . $endMonth . $endDay . "/";
$pdfFileName = $pdfDirName . $endYear . "-" . $endMonth . "-" . $endDay . "_" . $group_name . ".pdf";
if (!is_dir($pdfDirName)) {
mkdir($pdfDirName);
}
//Close and output PDF document
$pdf->Output($pdfFileName, 'F');
return $pdfFileName;
}
示例4: MYPDF
$this->Cell($w[0], 6, $row[0], 'LR', 0, 'L', $fill);
$this->Cell($w[1], 6, $row[1], 'LR', 0, 'L', $fill);
$this->Cell($w[2], 6, number_format($row[2]), 'LR', 0, 'R', $fill);
$this->Cell($w[3], 6, number_format($row[3]), 'LR', 0, 'R', $fill);
$this->Ln();
$fill = !$fill;
}
$this->Cell(array_sum($w), 0, '', 'T');
}
}
// 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('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 011');
$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 . ' 011', PDF_HEADER_STRING);
// 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);
示例5: MYPDF
$this->Cell($w[0], 6, $this->inizio_ore[$i + 1], 'LR', 0, 'C', $fill);
$this->Cell($w[1], 6, $materie[$orario_classe->getMateria($classe, "Gio", $i + 1)][0] != "Scegli" ? $materie[$orario_classe->getMateria($classe, "Gio", $i + 1)][0] : "--", 'LR', 0, 'C', $fill);
$this->Cell($w[2], 6, $materie[$orario_classe->getMateria($classe, "Ven", $i + 1)][0] != "Scegli" ? $materie[$orario_classe->getMateria($classe, "Ven", $i + 1)][0] : "--", 'LR', 0, 'C', $fill);
$this->Cell($w[3], 6, $materie[$orario_classe->getMateria($classe, "Sab", $i + 1)][0] != "Scegli" ? $materie[$orario_classe->getMateria($classe, "Sab", $i + 1)][0] : "--", 'LR', 0, 'C', $fill);
$this->Ln();
$fill = !$fill;
}
$this->Cell(array_sum($w), 0, '', 'T');
}
}
// 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($author);
$pdf->SetTitle($_SESSION['__classe__']->to_string());
// set default header data
$pdf->SetHeaderData("", 0, "Scuola Media Statale \"Arborea - Lamarmora\" - secondaria di primo grado", "Via Isonzo, 5 - Iglesias (CI)");
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', 8.0));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', 8.0));
// 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);
示例6: MYPDF
$this->SetAutoPageBreak(false, 0);
// set bacground image
$img_file = K_PATH_IMAGES . 'tsfondo.jpg';
$this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
}
}
// 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('Julian Andres Alvaran Valencia');
$pdf->SetTitle('Cotizacion TS');
$pdf->SetSubject('Cotizacion');
$pdf->SetKeywords('Techno Soluciones, PDF, cotizacion, CCTV, Alarmas, Computadores');
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(0);
$pdf->SetFooterMargin(0);
// remove default footer
$pdf->setPrintFooter(false);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
示例7: max
$ynew = max($y_end_1, $y_end_2);
} elseif ($page_end_1 > $page_end_2) {
$ynew = $y_end_1;
} else {
$ynew = $y_end_2;
}
$this->setPage(max($page_end_1, $page_end_2));
$this->SetXY($this->GetX(), $ynew);
}
}
// 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('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 020');
$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);
// 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);
示例8: Footer
// footer
public function Footer()
{
$this->setY(-12);
$this->SetFont('freesans', '', 6, '', true);
$this->Cell(0, 3, mb_strtoupper(api_text("module-diary_export-page"), 'UTF-8') . " " . $this->getAliasNumPage() . " " . mb_strtoupper(api_text("module-diary_export-pageOf"), 'UTF-8') . " " . $this->getAliasNbPages(), 0, 0, 'L', 0);
$this->Cell(0, 3, mb_strtoupper(api_text("module-diary_export-footer"), 'UTF-8') . " " . $training->datetraining, 0, 0, 'R', 0);
//$this->Cell(0,3,mb_strtoupper(api_text("module-diary_export-footer"),'UTF-8')." ".$GLOBALS['module-diary']->number,0,0,'R',0);
}
}
// create new pdf document
$pdf = new MYPDF('L', 'mm', 'A4', true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetAuthor(api_account($training->addIdAccount)->name);
$pdf->SetTitle("Dettaglio allenamenti svolti");
//$pdf->SetSubject("Training nr. ".$training->number." - ".api_timestampFormat($request->timestamp,api_text("date")));
// header and footer
$pdf->setPrintHeader(true);
$pdf->setPrintFooter(true);
// set margins
$pdf->SetMargins(10, 30, 10);
$pdf->SetHeaderMargin(30);
$pdf->SetFooterMargin(10);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 15);
// set font
$pdf->SetFont('freesans', '', 12, '', true);
// add a page
$pdf->AddPage();
// page styles
示例9: substr
$semester = $course->get_semester()->get_name();
// returns e.g. WS0910
$semester = substr($semester, 0, -2) . "/" . substr($semester, -2);
$semester = str_replace("WS", gettext("winter") . " ", $semester);
$semester = str_replace("SS", gettext("summer") . " ", $semester);
$day = $examObject->getDateDay($examTerm);
$month = $examObject->getDateMonth($examTerm);
$year = $examObject->getDateYear($examTerm);
$date = sprintf("%02d.%02d.%04d", $day, $month, $year);
$key = session_id();
// 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('KoaLA');
$pdf->SetTitle($exam_name);
$pdf->SetSubject(gettext("exam results"));
$pdf->SetKeywords(gettext("exam results") . ", " . $exam_name);
// header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(true);
// 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(FALSE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
//$pdf->setLanguageArray($l);
示例10: strftime
$pdf_filter[] = $kga['lang']['export_extension']['cleared_open'];
break;
case 1:
$pdf_filter[] = $kga['lang']['export_extension']['cleared_cleared'];
break;
}
switch ($filter_refundable) {
case 0:
$pdf_filter[] = $kga['lang']['export_extension']['refundable_refundable'];
break;
case 1:
$pdf_filter[] = $kga['lang']['export_extension']['refundable_not_refundable'];
break;
}
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetTitle($pdf_title);
$pdf->setPrintHeader(false);
$pdf->AddPage();
$pdf->setFont('helvetica');
if (isset($_REQUEST['create_bookmarks'])) {
$pdf->Bookmark($pdf_title, 0, 0);
}
//$pdf->ImageEps('kimai-logo.ai', 0, 10, 60, 0, "http://www.kimai.org", true, 'T', 'R'); // include company logo
$pdf->WriteHtml('<h1>' . $pdf_title . '</h1>');
$pdf->ln();
$pdf->WriteHtml('<b>' . $kga['lang']['export_extension']['time_period'] . ':</b> ' . strftime($kga['date_format']['2'], $in) . ' - ' . strftime($kga['date_format']['2'], $out));
if (isset($pdf_filter)) {
$pdf->ln();
$pdf->WriteHtml('<b>' . $kga['lang']['export_extension']['tab_filter'] . ':</b> ' . implode(' | ', $pdf_filter));
}
if (!empty($_REQUEST['document_comment'])) {
示例11: pathinfo
global $leftside_consultant_img;
global $rightside_client_img;
$arr_leftside_consultant_img = pathinfo($leftside_consultant_img);
$ext_leftside_consultant_img = $arr_leftside_consultant_img['extension'];
$arr_rightside_client_img = pathinfo($rightside_client_img);
$ext_rightside_client_img = $arr_rightside_client_img['extension'];
$this->Image($leftside_consultant_img, 10, 10, 15, '', $ext_leftside_consultant_img, '', 'T', false, 350, '', false, false, 0, false, false, false);
$this->Image($rightside_client_img, 10, 10, 15, '', $ext_rightside_client_img, '', 'T', false, 350, 'R', false, false, 0, false, false, false);
}
}
// 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('S1 System');
$pdf->SetTitle('Advanced Inspection');
$pdf->SetSubject('Advanced Inspection');
// set default header data
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, "Advanced Inspection", 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);
示例12: MYPDF
<tr>
<td align="center">Sistema de facturación brindado por <a href="www.emizor.com">www.emizor.com</a></td>
</tr>
<tr>
<td width="578" align="center">Pág ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages() . '</td>
</tr>
</table>';
$this->writeHTMLCell($w = 0, $h = 0, $x = '', $y = 155, $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'left', $autopadding = true);
$this->Image('@' . $imgdata, '7', '72', 4, 12, '', 'www.emizor.com', 'T', false, 300, '', false, false, 0, false, false, false);
$this->Image('@' . $imgdata2, '145', '156', 5, 8, '', 'www.emizor.com', 'T', false, 300, '', false, false, 0, false, false, false);
}
}
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('ipxserver');
$pdf->SetTitle('Factura');
$pdf->SetSubject('Primera Factura');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set margins
$pdf->SetMargins(15, 20, 15);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// borra la linea de arriba en el area del header
$pdf->setPrintHeader(false);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set some language-dependent strings (optional)
if (@file_exists('/includes/tcpdf/examples/lang/spa.php')) {
require_once '/includes/tcpdf/examples/lang/spa.php';
$pdf->setLanguageArray($l);
}
示例13: explode
$teamid[$length] = $row['team_id'];
$memname[$length] = $row['member_name'];
$memcid[$length] = $row['member_cid'];
$memname[$length] = explode(";", $memname[$length]);
$memcid[$length] = explode(";", $memcid[$length]);
$participant[$length] = count($memname);
$marks[$length] = $row['marks'];
$rank[$length] = $row['rank'];
$length++;
}
// create a PDF object
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document (meta) information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Rohit Jangid');
$pdf->SetTitle('Cognizance 2014 Event Report Sheet');
// add a page
$pdf->AddPage();
$pdf->CreateTextBox($deptc, 100, 10, 80, 10, 10, 'I', 'R');
$pdf->CreateTextBox($event, 100, 15, 80, 10, 10, 'I', 'R');
//listing marks
$i = 0;
$currx = 3;
$curry = 55;
while ($i < $length) {
if ($i % 5 == 1 && $i != 1) {
$pdf->AddPage();
$pdf->CreateTextBox($deptc, 100, 10, 80, 10, 10, 'I', 'R');
$pdf->CreateTextBox($event, 100, 15, 80, 10, 10, 'I', 'R');
$currx = 3;
$curry = 55;
示例14: checkStoreInvoice
function checkStoreInvoice($orderDetails = 0)
{
JRequest::setVar('task', 'checkStoreInvoice');
$force = true;
// @ini_set( 'max_execution_time', 5 );
$path = VmConfig::get('forSale_path', 0);
if ($path === 0) {
vmError('No path set to store invoices');
return false;
} else {
$path .= 'invoices' . DS;
if (!file_exists($path)) {
vmError('Path wrong to store invoices, folder invoices does not exist ' . $path);
return false;
} else {
if (!is_writable($path)) {
vmError('Cannot store pdf, directory not writeable ' . $path);
return false;
}
}
}
$orderModel = VmModel::getModel('orders');
$invoiceNumberDate = array();
if (!$orderModel->createInvoiceNumber($orderDetails['details']['BT'], $invoiceNumberDate)) {
return 0;
}
if (!empty($invoiceNumberDate[0])) {
$invoiceNumber = $invoiceNumberDate[0];
} else {
$invoiceNumber = FALSE;
}
if (!$invoiceNumber or empty($invoiceNumber)) {
vmError('Cant create pdf, createInvoiceNumber failed');
return 0;
}
if (shopFunctions::InvoiceNumberReserved($invoiceNumber)) {
return 0;
}
$path .= 'vminvoice_' . $invoiceNumber . '.pdf';
if (file_exists($path) and !$force) {
return $path;
}
// $app = JFactory::getApplication('site');
//We come from the be, so we need to load the FE langauge
$jlang = JFactory::getLanguage();
$jlang->load('com_virtuemart', JPATH_SITE, 'en-GB', true);
$jlang->load('com_virtuemart', JPATH_SITE, $jlang->getDefault(), true);
$jlang->load('com_virtuemart', JPATH_SITE, null, true);
$this->addViewPath(JPATH_VM_SITE . DS . 'views');
$format = 'html';
$viewName = 'invoice';
$view = $this->getView($viewName, $format);
$view->addTemplatePath(JPATH_VM_SITE . DS . 'views' . DS . 'invoice' . DS . 'tmpl');
$view->invoiceNumber = $invoiceNumberDate[0];
$view->invoiceDate = $invoiceNumberDate[1];
$view->orderDetails = $orderDetails;
$view->uselayout = 'invoice';
ob_start();
$view->display();
$html = ob_get_contents();
ob_end_clean();
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator('Invoice by VirtueMart 2, used library tcpdf');
$pdf->SetAuthor($view->vendor->vendor_name);
$pdf->SetTitle(JText::_('COM_VIRTUEMART_INVOICE_TITLE'));
$pdf->SetSubject(JText::sprintf('COM_VIRTUEMART_INVOICE_SUBJ', $view->vendor->vendor_store_name));
$pdf->SetKeywords('Invoice by VirtueMart 2');
//virtuemart.cloudaccess.net/index.php?option=com_virtuemart&view=invoice&layout=details&virtuemart_order_id=18&order_number=6e074d9b&order_pass=p_9cb9e2&task=checkStoreInvoice
if (empty($view->vendor->images[0])) {
vmError('Vendor image given path empty ');
} else {
if (empty($view->vendor->images[0]->file_url_folder) or empty($view->vendor->images[0]->file_name) or empty($view->vendor->images[0]->file_extension)) {
vmError('Vendor image given image is not complete ' . $view->vendor->images[0]->file_url_folder . $view->vendor->images[0]->file_name . '.' . $view->vendor->images[0]->file_extension);
vmdebug('Vendor image given image is not complete, the given media', $view->vendor->images[0]);
} else {
if (!empty($view->vendor->images[0]->file_extension) and strtolower($view->vendor->images[0]->file_extension) == 'png') {
vmError('Warning extension of the image is a png, tpcdf has problems with that in the header, choose a jpg or gif');
} else {
$imagePath = DS . str_replace('/', DS, $view->vendor->images[0]->file_url_folder . $view->vendor->images[0]->file_name . '.' . $view->vendor->images[0]->file_extension);
if (!file_exists(JPATH_ROOT . $imagePath)) {
vmError('Vendor image missing ' . $imagePath);
} else {
$pdf->SetHeaderData($imagePath, 60, $view->vendor->vendor_store_name, $view->vendorAddress);
}
}
}
}
// set header and footer fonts
$pdf->setHeaderFont(array('helvetica', '', 8));
$pdf->setFooterFont(array('helvetica', '', 10));
// 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);
//.........这里部分代码省略.........
示例15: MYPDF
<tr>
<td align="center">Sistema de facturación brindado por <a href="www.emizor.com">www.emizor.com</a></td>
</tr>
<tr>
<td width="578" align="center">Pág ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages() . '</td>
</tr>
</table>';
$this->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'left', $autopadding = true);
$this->Image('@' . $logoEmizor, '7', '128', 4, 12, '', 'www.emizor.com', 'T', false, 300, '', false, false, 0, false, false, false);
$this->Image('@' . $emizorAvion, '145', '265', 5, 8, '', 'www.emizor.com', 'T', false, 300, '', false, false, 0, false, false, false);
}
}
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('ipxserver');
$pdf->SetTitle('Nota de Entrega');
$pdf->SetSubject('Primera Nota');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set margins
$pdf->SetMargins(15, 20, 15);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// borra la linea de arriba en el area del header
$pdf->setPrintHeader(false);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set some language-dependent strings (optional)
if (@file_exists('/includes/tcpdf/examples/lang/spa.php')) {
require_once '/includes/tcpdf/examples/lang/spa.php';
$pdf->setLanguageArray($l);
}