当前位置: 首页>>代码示例>>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;未经允许,请勿转载。