當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MYPDF::GetStringWidth方法代碼示例

本文整理匯總了PHP中MYPDF::GetStringWidth方法的典型用法代碼示例。如果您正苦於以下問題:PHP MYPDF::GetStringWidth方法的具體用法?PHP MYPDF::GetStringWidth怎麽用?PHP MYPDF::GetStringWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MYPDF的用法示例。


在下文中一共展示了MYPDF::GetStringWidth方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: MYPDF

<?php

$pdf = new MYPDF();
//$pdf->setMargins(20,20,20);
$pdf->AliasNbPages();
$pdf->AddPage('L', 'A4');
$pdf->AddFont('PT_Serif-Web-Bold', '', 'PT_Serif-Web-Bold.php');
$pdf->SetFont('PT_Serif-Web-Bold', '', 32);
$pdf->image('./images/lippo.jpg', 25, 4, 50, 30);
$pdf->Text(290 / 2 - $pdf->GetStringWidth('Lumiere Club') / 2, 15, 'Lumiere Club');
$pdf->SetFont('PT_Serif-Web-Bold', '', 30);
$pdf->Text(290 / 2 - $pdf->GetStringWidth('Lippo Mall Kemang') / 2, 26, 'Lippo Mall Kemang');
$pdf->SetFont('Times', '', 12);
$pdf->Text(290 / 2 - $pdf->GetStringWidth('Jl. Pangeran Antasari 36 Jakarta Selatan - 12150') / 2, 33, 'Jl. Pangeran Antasari 36 Jakarta Selatan - 12150');
//$pdf->setDrawColor(105,102,102);
$pdf->Line(10, 36, 290 - 5, 36);
$pdf->SetFont('Arial', '', 22);
$pdf->Text(290 / 2 - $pdf->GetStringWidth('Report Data Upgrade Membership') / 2, 45, 'Report Data Upgrade Membership');
$awal = date('d F Y', strtotime($tgl1));
$akhir = date('d F Y', strtotime($tgl2));
$periode = "{$awal} to {$akhir}";
$pdf->SetFont('Arial', '', 14);
$pdf->Text(290 / 2 - $pdf->GetStringWidth($periode) / 2, 54, $periode);
//$pdf->Line(10, 10, 210-10, 10);
$pdf->SetXY(10, 60);
$pdf->SetFont('Helvetica', '', 12);
$content = UpgradeMembership::model()->with(array('member', 'user'))->findAll(array('condition' => 'upgrade_date BETWEEN :date1 AND :date2', 'params' => array(':date1' => $tgl1, ':date2' => $tgl2)));
if ($content == null) {
    $pdf->SetFont('Helvetica', '', 48);
    $pdf->Text(290 / 2 - $pdf->GetStringWidth("No Data Found") / 2, 84, "No Data Found");
    $pdf->Output();
開發者ID:nicovicz,項目名稱:reward-point,代碼行數:31,代碼來源:_report.php

示例2: foreach

 // get customer name from first row of first project
 $customer_name = $customer[$project_ids[0]][0]['customerName'];
 $pdf->ln();
 $pdf->WriteHtml("<h2>{$customer_name}</h2>");
 foreach ($project_ids as $project_id) {
     // process each project in second dimension
     $project_name = $customer[$project_id][0]['projectName'];
     $pdf->ln();
     $pdf->WriteHtml("<h4>{$project_name}</h4>");
     $max_money_width = 0;
     $max_time_width = 0;
     // calculate maximum width for time and money
     // and add to summary array
     foreach ($customer[$project_id] as $row) {
         // maximum width calculation
         $max_money_width = max($max_money_width, $pdf->GetStringWidth($pdf->money($row['wage'])));
         $time_width = 0;
         if (isset($columns['date'])) {
             $time_width += $pdf->GetStringWidth(strftime($dateformat, $row['time_in']));
         }
         if (isset($columns['from']) && isset($columns['to'])) {
             $time_width += max($pdf->GetStringWidth(strftime($timeformat, $row['time_in'])), $pdf->GetStringWidth(strftime($timeformat, $row['time_out'])));
         } else {
             if (isset($columns['from'])) {
                 $time_width += $pdf->GetStringWidth(strftime($timeformat, $row['time_in']));
             } else {
                 $time_width += $pdf->GetStringWidth(strftime($timeformat, $row['time_out']));
             }
         }
         $max_time_width = max($max_time_width, $time_width);
     }
開發者ID:jo91,項目名稱:kimai,代碼行數:31,代碼來源:export_pdf2.php

示例3: array

    }
    $pdf->ln();
    $pdf->WriteHtml('<h3>' . $kga['lang']['export_extension']['summary'] . '</h3>');
    $pdf->ln();
    $pdf->printSummary(array($kga['lang']['activity'], $kga['lang']['export_extension']['duration'], $kga['lang']['export_extension']['costs']), $orderedExportData);
    $pdf->AddPage();
}
// Write to the PDF document which, if any, customer filters were applied.
$customers = array();
foreach ($filterCustomers as $customerID) {
    $customer_info = $database->customer_get_data($customerID);
    $customers[] = $customer_info['name'];
}
if (count($customers) > 0) {
    $label = $kga['lang']['customer'] . ': ';
    $labelWidth = $pdf->GetStringWidth($label);
    $pdf->cell($labelWidth, 6, $label);
    $pdf->cell($labelWidth, 6, implode(', ', $customers));
    $pdf->ln();
}
// Write to the PDF document which, if any, project filters were applied.
$projects = array();
foreach ($filterProjects as $projectID) {
    $project_info = $database->project_get_data($projectID);
    $projects[] = $project_info['name'];
}
if (count($projects) > 0) {
    $label = $kga['lang']['project'] . ': ';
    $labelWidth = $pdf->GetStringWidth($label);
    $pdf->cell($labelWidth, 6, $label);
    $pdf->cell($labelWidth, 6, implode(', ', $projects));
開發者ID:lentschi,項目名稱:kimai,代碼行數:31,代碼來源:export_pdf.php


注:本文中的MYPDF::GetStringWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。