本文整理汇总了PHP中MYPDF类的典型用法代码示例。如果您正苦于以下问题:PHP MYPDF类的具体用法?PHP MYPDF怎么用?PHP MYPDF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MYPDF类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: utf8_encode
$this->pageHeader($alunno, $num_ritardi, $somma_ritardi);
}
$this->SetY($this->y_position);
$this->SetFont('', '', 9);
$this->SetX(30.0);
$this->Cell(20, 5, utf8_encode($giorno_str), 0, 0);
$this->Cell(20, 5, format_date($day['data'], SQL_DATE_STYLE, IT_DATE_STYLE, "/"), 0, 0);
$this->Cell(20, 5, " ore " . substr($day['ingresso'], 0, 5), 0, 0);
}
}
$x++;
}
}
}
// 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("Elenco ritardi di " . $alunno['cognome'] . " " . $alunno['nome']);
// 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);
示例2: number_format
$this->MultiCell(25, 4, number_format($Valor, 0), '', 'R', 1, 1, $x + 65, $y + 73.5, true, 0, false, true, 40, 'T');
$this->SetFont('helveticaB', '', 9);
//Tamaño y tipo de Fuente
//CUPON DERECHA
$InfoCodigoBarrasUno = "- Pago oportuno: {$FechaOportuno} - Valor a pagar: " . number_format($Valor, 0);
$InfoCodigoBarrasDos = "- Pago extemporaneo: {$FechaExtemporaneo} - Valor a pagar: " . number_format($ValorCodigoBarras2, 0);
$this->MultiCell(100, 5, $Nombre, 0, 'L', 1, 1, $x + 105, $y + 22, true, 0, false, true, 40, 'T');
$this->MultiCell(100, 5, $NumeroIdentificacion, 0, 'L', 1, 1, $x + 105, $y + 26, true, 0, false, true, 40, 'T');
$this->MultiCell(100, 5, $Grado, 0, 'L', 1, 1, $x + 195, $y + 22, true, 0, false, true, 40, 'T');
$this->MultiCell(100, 5, $Ano, 0, 'L', 1, 1, $x + 195, $y + 26, true, 0, false, true, 40, 'T');
$this->MultiCell(100, 5, $InfoCodigoBarrasUno, 0, 'L', 1, 1, $x + 95, $y + 32, true, 0, false, true, 40, 'T');
$this->MultiCell(100, 5, $InfoCodigoBarrasDos, 0, 'L', 1, 1, $x + 95, $y + 54, true, 0, false, true, 40, 'T');
$CodigoBarras1 = "http://localhost/portalconciliacion/barcodephp/html/image.php?filetype=PNG&dpi=300&scale=1&rotation=0&font_family=Arial.ttf&font_size=8&text=%28415%297701234001001~F1%288020%29{$Matricula}~F1%28390y%29{$Valor}~F1%2896{$FechaCodigoBarras1}&thickness=45&start=C&code=BCGgs1128";
$CodigoBarras2 = "http://localhost/portalconciliacion/barcodephp/html/image.php?filetype=PNG&dpi=300&scale=1&rotation=0&font_family=Arial.ttf&font_size=8&text=%28415%297701234001001~F1%288020%29{$Matricula}~F1%28390y%29{$ValorCodigoBarras2}~F1%2896{$FechaCodigoBarras2}&thickness=45&start=C&code=BCGgs1128";
$this->Image($CodigoBarras1, $x + '100', $y + '38', 0, 0, '', '', 'T', false, 300, '', false, false, 0, false, false, false);
$this->Image($CodigoBarras2, $x + '100', $y + '60', 0, 0, '', '', 'T', false, 300, '', false, false, 0, false, false, false);
$this->MultiCell(100, 10, 'No. ' . $Numero, 0, 'C', 1, 1, $x + 145, $y + 11, true, 0, false, true, 40, 'T');
$this->MultiCell(205, 10, 'Referencia. ' . $Matricula, 0, 'R', 1, 1, $x + 5, $y + 17, true, 0, false, true, 40, 'T');
$this->MultiCell(85, 10, 'Referencia. ' . $Matricula, 0, 'R', 1, 1, $x + 5, $y + 82, true, 0, false, true, 40, 'T');
$y = $y + 90;
}
$this->Ln(4);
ob_clean();
$fecha = date("d-m-Y", time());
$this->Output("cupon.pdf", "I");
}
}
// create new PDF document
$id = $_GET["id"];
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->pintarPdf($id);
示例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: Header
{
public function Header()
{
$this->SetFont('Helvetica', 'B', 8);
$this->SetLineWidth(0.5);
$this->Line(12, 280, 195, 280);
$this->Ln(0.5);
// Logo
$image_file = K_PATH_IMAGES . 'gem_hztl.jpg';
$this->Image($image_file, 10, 5, 50, '', 'JPG', '', 'L', false, 300, '', false, false, 0, false, false, false);
$image_file = K_PATH_IMAGES . 'logo_GEM_hztl.jpg';
$this->Image($image_file, 150, 5, 50, '', 'JPG', '', 'L', false, 300, '', 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 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);
示例5: foreach
$this->SetFont('');
// Data
$fill = 0;
foreach ($data as $row) {
$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);
示例6: Header
public function Header()
{
//get the current page break margin
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(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('Recaudacion');
$pdf->SetTitle('Programa de Servicio de Salud');
$pdf->SetSubject('Detalle programa paciente');
$pdf->SetKeywords('Paciente, PSS, Programa');
//$pdf->SetHeaderData('../../img/logo.jpg', PDF_HEADER_LOGO_WIDTH,'SERVICIO DE SALUD ARICA ','HOSPITAL REGIONAL DE ARICA Y PARINACOTA');
$pdf->setHeaderFont(array('helvetica', '', 6));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, 8, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, 15);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
示例7: MYPDF
{
//To make the function Footer() work properly
$this->AliasNbPages();
if (!isset($this->original_lMargin)) {
$this->original_lMargin = $this->lMargin;
}
if (!isset($this->original_rMargin)) {
$this->original_rMargin = $this->rMargin;
}
include "modules/SalesOrder/pdf_templates/footer.php";
}
}
$page_num = '1';
// create new PDF document
//$pdf = new PDF( 'P', 'mm', 'A4' );
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
// set font
$pdf->SetFont($default_font, " ", $default_font_size);
$pdf->setPrintHeader(0);
//header switched off permanently
// auto break on
//$pdf->SetAutoPageBreak(true);
// 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
$pdf->SetTitle($pdf_strings['FACTURE'] . ": " . $account_name);
$pdf->SetAuthor($owner_firstname . " " . $owner_lastname . ", " . $org_name);
示例8: Footer
$this->MultiCell(250, 6, 'Importe Prestamo', 0, 'C', false, 1, 80, 30, true, 0, true, true, 0, 'M', false);
$this->MultiCell(300, 6, 'Monto Redocumentación', 0, 'C', false, 1, 100, 30, true, 0, true, true, 0, 'M', false);
$this->MultiCell(420, 6, 'Sindicato', 0, 'C', false, 1, 80, 30, true, 0, true, true, 0, 'M', false);
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
}
public function Footer()
{
//$image_file = "img/pie.jpg";
//$this->Image($image_file, 7, 250, 198, 23, 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
}
}
// create new PDF document
$pdf = new MYPDF();
//set document information
$pdf->SetAuthor('DIRECCION DE PENSIONES');
$pdf->SetTitle('DEL MUNICIPIO DE OAXACA DE JUÁREZ OAX');
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(0, PDF_MARGIN_TOP, 0);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$resolution = array(216, 355);
$consultaTram = "SELECT idContrato, fecha, titular, nombre, importePrestamo, MontoRedocumentacion,sindicato,idSindicato FROM repAltasRedocumenta ORDER BY idSindicato ASC";
$consulta = mysql_query($consultaTram);
$pdf->AddPage('L', $resolution);
$pdf->SetFont('helvetica', '', 10);
示例9: generatePdfReport
//.........这里部分代码省略.........
}
if (!empty($entry->answer2)) {
if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
$responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->answer2;
} else {
$responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->answer2;
}
}
if (!empty($entry->free_text)) {
// do special types formatting //
if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_NAME) {
$names = explode('|', $entry->free_text);
if (!empty($names)) {
$entry->free_text = $names[0] . '. ' . $names[1] . ' ' . $names[2];
} else {
$entry->free_text = '';
}
} else {
if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_ADDRESS) {
$parts = explode('|||', $entry->free_text);
if (count($parts) == 7) {
$entry->free_text = '<address><strong>' . CJFunctions::escape($parts[0]) . '</strong><br>';
$entry->free_text .= CJFunctions::escape($parts[1]) . '<br>';
if (!empty($parts[2])) {
$entry->free_text .= CJFunctions::escape($parts[2]) . '<br>';
}
$entry->free_text .= CJFunctions::escape($parts[3]) . ', ' . CJFunctions::escape($parts[4]) . ', ' . CJFunctions::escape($parts[6]) . '<br>';
$entry->free_text .= !empty($countries[$parts[5]]) ? $countries[$parts[5]]->country_name : CJFunctions::escape($parts[5]);
} else {
$entry->free_text = '';
}
}
}
// do special types formatting //
if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
$responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->free_text;
} else {
$responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->free_text;
}
}
}
}
}
$response_rows = array();
foreach ($responses as $id => $response) {
$string = '<table class="table table-striped" width="100%">';
$string = $string . '<tr><th width="30%"><strong>Response ID:</strong></th><td width="70%">' . $id . '</td></tr>';
$string = $string . '<tr><th><strong>Response Date:</strong></th><td>' . $response->created . '</td></tr>';
$string = $string . '<tr><th><strong>User ID:</strong></th><td>' . $response->created_by . '</td></tr>';
$string = $string . '<tr><th><strong>Username:</strong></th><td>' . $response->username . '</td></tr>';
$string = $string . '<tr><th><strong>User Display Name:</strong></th><td>' . $response->name . '</td></tr>';
if ($include_email_in_reports == 1) {
$string = $string . '<tr><td><strong>Email:</strong></td><td>' . $response->email . '</td></tr>';
}
foreach ($pdfData->questions as $question) {
$string = $string . '<tr><td colspan="2"> <hr></td></tr>';
$string = $string . '<tr><th colspan="2"><h3>' . $question->title . '</h3></th></tr>';
if (!empty($question->description)) {
$string = $string . '<tr><td colspan="2">' . $question->description . '</td></tr>';
}
$string = $string . '<tr><td colspan="2"> </td></tr>';
$string = $string . '<tr><td colspan="2">' . $response->questions[$question->id]->answer . '</td></tr>';
}
$string = $string . '</table>';
array_push($response_rows, $string);
}
// create new PDF document
require_once JPATH_COMPONENT_SITE . '/helpers/tcpdf.php';
$pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set default header data
$pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH, $pdfData->title, '');
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('corejoomla.com');
$pdf->SetTitle('Survey Report');
$pdf->SetSubject('Survey Responses Report');
$pdf->SetKeywords('survey, report');
// 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 font
$pdf->SetFont('freesans');
foreach ($response_rows as $i => $response) {
$pdf->AddPage();
$pdf->writeHTML($response, true, false, true, false, '');
$pdf->lastPage();
}
$pdf->Output($fileName, $mode);
}
示例10: max
// set the new row position by case
if (max($page_end_1, $page_end_2) == $page_start) {
$ynew = max($y_end_1, $y_end_2);
} elseif ($page_end_1 == $page_end_2) {
$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);
// 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 margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
示例11: mysqli_free_result
$LocationVATRate = $row[16];
$AgencyVATRate = $row[17];
$AgencyRate = $row[18];
$BookingAddress = $row[19];
$BookingStreet = $row[20];
$BookingTown = $row[21];
$BookingCounty = $row[22];
$BookingPostcode = $row[23];
$BookingCountry = $row[24];
$BookingTel = $row[25];
$BookingMobile = $row[26];
$WorkingTitle = $row[27];
$ProjectType = $row[28];
mysqli_free_result($result);
// 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('UKFilmLocation.com');
$pdf->SetTitle('Booking Form for Ref : J' . $JobRef . '-' . $BookingID);
// 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);
//$pdf->setPrintHeader(false);
//$pdf->setPrintFooter(false);
$pdf->setAutoPageBreak(false, 0);
//$pdf->SetFooterMargin(18);
示例12: isset
$begin = isset($_GET['tanggal_so_begin']) ? strval($_GET['tanggal_so_begin']) : "";
$end = isset($_GET['tanggal_so_end']) ? strval($_GET['tanggal_so_end']) : "";
$stmt = "select penjualan.no_so, penjualan.tanggal_so, penjualan.no_seri_produk, penjualan.quantity, penjualan.no_nis_sales, penjualan.nama_customer, penjualan.telp_customer, produk.nama_produk, sales.nama_sales from penjualan, produk, sales where produk.no_seri = penjualan.no_seri_produk AND sales.nis = penjualan.no_nis_sales AND penjualan.cabang = '{$cabang}' AND status = 'approve' AND penjualan.tanggal_so BETWEEN '{$begin}' AND '{$end}' order by penjualan.no_nis_sales asc";
$stmt1 = "select * from cabang where kode = '{$cabang}'";
foreach (tampilData($stmt1) as $dataCabang) {
}
class MYPDF extends TCPDF
{
public function Footer()
{
$this->SetY(-15);
$this->SetFont('helvetica', 'I', 8);
$this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
$pdf = new MYPDF('L', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(30, 70, 20);
$pdf->setPrintHeader(false);
$pdf->SetAutoPageBreak(TRUE, 15);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->AddPage();
$image_file = K_PATH_IMAGES . 'luxindo.jpg';
$pdf->Image($image_file, 5, 0, 40, '', 'JPG', '', 'M', false, 300, '', false, false, 0, false, false, false);
$pdf->SetFont('helvetica', 'B', 17);
$pdf->setXY(45, 18, true);
$pdf->Cell(0, 13, 'PT. Luxindo Raya', 0, 2, 'L', 0, '', '', 'D', 'B');
$pdf->SetFont('helvetica', 'B', 10);
$pdf->setXY(45, 18, true);
$pdf->Cell(0, 0, 'LAPORAN PENJUALAN', 0, 2, 'L', 0, '', '');
$pdf->SetFont('helvetica', '', 9);
示例13: MYPDF
// Position at 15 mm from bottom
$this->SetY(-20);
// Set font
//$this->SetFont('helvetica', 'I', 8);
$image_file = base_url.'images/footer-new.jpg';
$this->Image($image_file, 15, '', '180', '20', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
// Page number
$this->SetFont('helvetica', 'B', 20);
//$this->Cell(0, 10, 'All Rights Reserved', 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
}
// 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('EziFuneral');
$pdf->SetTitle('TCPDF Example 003');
$pdf->SetSubject('At Need Plan');
$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(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));
示例14: Footer
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF
{
//Page footer
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Print page number
$this->Cell(0, 10, 'Page ' . $this->getGroupPageNoFormatted() . '/' . $this->getPageGroupAlias(), 0, 0, 'C');
}
}
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor("Nicola Asuni");
$pdf->SetTitle("TCPDF Example 023");
$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 margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
示例15: max
// set the new row position by case
if (max($page_end_1, $page_end_2) == $page_start) {
$ynew = max($y_end_1, $y_end_2);
} elseif ($page_end_1 == $page_end_2) {
$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);