当前位置: 首页>>代码示例>>PHP>>正文


PHP PDF::setFont方法代码示例

本文整理汇总了PHP中PDF::setFont方法的典型用法代码示例。如果您正苦于以下问题:PHP PDF::setFont方法的具体用法?PHP PDF::setFont怎么用?PHP PDF::setFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PDF的用法示例。


在下文中一共展示了PDF::setFont方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Material Stock Overview List';
     $pdf->AddPage('L');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $header = array('No', 'ID', 'Material Name', 'Sloc', 'Qty', 'UOM', 'Prod Trans Type', 'Ref Source');
     $model = new Productstock('search');
     $dataprovider = $model->search();
     $dataprovider->pagination = false;
     $data = $dataprovider->getData();
     $cols = $dataprovider->getKeys();
     $dataku = array(count($data));
     //var_dump($dataku);
     $w = array(10, 15, 70, 30, 30, 30, 40, 30);
     $pdf->SetTableHeader();
     //Header
     for ($i = 0; $i < count($header); $i++) {
         $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetTableData();
     //Data
     $fill = false;
     $i = 0;
     foreach ($data as $datas) {
         $i = $i + 1;
         $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[1], 6, $datas['productstockid'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[2], 6, Product::model()->findbypk($datas['productid'])->productname, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[3], 6, Sloc::model()->findbypk($datas['slocid'])->sloccode, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[4], 6, $datas['qty'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[5], 6, Unitofmeasure::model()->findbypk($datas['unitofmeasureid'])->uomcode, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[6], 6, Prodtranstype::model()->findbypk($datas['prodtranstypeid'])->description, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[7], 6, $datas['refsource'], 'LR', 0, 'L', $fill);
         $pdf->Ln();
         $fill = !$fill;
     }
     $pdf->Cell(array_sum($w), 0, '', 'T');
     // me-render ke browser
     $pdf->Output('productstock.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:46,代码来源:ProductstockController.php

示例2: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Material Group List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $connection = Yii::app()->db;
     $sql = "select a.materialgroupcode, a.description,\r\n      b.materialgroupcode as parentgroupcode,c.materialtypecode as materialtype\r\n      from materialgroup a\r\n      left join materialgroup b on b.materialgroupid = a.parentmatgroupid \r\n      left join materialtype c on c.materialtypeid = a.materialtypeid";
     $command = $connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $pdf->setaligns(array('C', 'C', 'C', 'C'));
     $pdf->setwidths(array(30, 50, 30, 30));
     $pdf->Row(array('Code', 'Material Type', 'Description', 'Parent Group Code'));
     $pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $pdf->row(array($row1['materialgroupcode'], $row1['description'], $row1['materialtype'], $row1['parentgroupcode']));
     }
     // me-render ke browser
     $pdf->Output('materialgroup.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:24,代码来源:MaterialgroupController.php

示例3: PDF

    {
    }
}
$pdf = new PDF('P', 'mm', 'A4');
$pdf->setTitle('Invoice');
$pdf->SetAuthor('JULIE GRACE');
$pdf->SetCreator('k-Auto Generated PDF');
$pdf->SetDisplayMode('real');
$pdf->left_margin = 10;
$pdf->top_margin = 20;
$pdf->page_width = 210;
$pdf->page_height = 297;
$pdf->font_size = 11;
$pdf->line_height = 6;
$pdf->AddPage();
$pdf->setFont('Arial', '', $pdf->font_size);
//PAGING SETTING
$firstpagecount = 41;
$nextpagecount = 54;
//HEADER RIGHT
$head_width = 70;
$xpos = $pdf->left_margin + 110;
$ypos = $pdf->top_margin;
$line_height = 9;
$pdf->setFont('Arial', 'B', '13');
$pdf->SetXY($xpos, $ypos);
$pdf->MultiCell($head_width, $line_height, 'Invoice', 1);
//HEADER LEFT
$head_width = 100;
$xpos = $pdf->left_margin;
$ypos = $pdf->top_margin;
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:invoices-returns.php

示例4: array

 }
 if ($order_counter % $pdf->label_per_page == 0) {
     $pdf->AddPage();
 }
 $order_counter++;
 $xpos_starter = ($labelxpos - 1) * $pdf->label_width + $labelxpad;
 $ypos_starter = ($labelypos - 1) * $pdf->label_height + $labelypad;
 $logo_xpos = $xpos_starter + 52;
 $logo_ypos = $ypos_starter;
 $pdf->Image(FPDF_IMGPATH . 'jng-logo.png', $logo_xpos, $logo_ypos, 43, 5.33);
 //WxH 64.5 x 8
 $xpos = $xpos_starter;
 $ypos = $ypos_starter - 2;
 //NUMBERING
 $pdf->SetXY($xpos, $ypos);
 $pdf->setFont('Arial', 'B', '18');
 $pdf->Cell(10, 10, $order_counter);
 //SP FLAG
 if ($order['prefix_code'] != '') {
     $pdf->SetXY($xpos + 76, $ypos + 5);
     $pdf->setFont('Arial', '', '10');
     $pdf->Cell(20, 10, $order['prefix_code'], '0', '0', 'R');
 }
 //ORDER DETAIL
 $pdf->setFont('Arial', '', '12');
 $lineheight = 5;
 $ypos = $ypos_starter + 10;
 $pdf->SetXY($xpos, $ypos);
 $labels = array();
 $labels[] = 'Kunde';
 //Customer
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:package-labels.php

示例5:

 $pdf->Cell(0, 0, utf8_decode("Edificio A-2    "), 0, 1, 'R');
 $pdf->Ln(0.41);
 $pdf->Cell(0, 0, utf8_decode("Ciudad Universitaria    "), 0, 1, 'R');
 $pdf->Ln(0.41);
 $pdf->Cell(0, 0, utf8_decode("Tegucigalpa, Honduras    "), 0, 1, 'R');
 $pdf->ln(3.5);
 $pdf->SetFont('Cambria', 'BI', 16);
 $pdf->Cell(0, 0, utf8_decode("CONSTANCIA DE HIMNO"), 0, 1, 'C');
 $pdf->Ln(2.9);
 $pdf->SetFont('Cambria', 'I', 16);
 $pdf->SetLeftMargin(2.2);
 $pdf->SetRightMargin(2.2);
 $pdf->newFlowingBlock(17.0, 1.0, 0, 'J');
 $pdf->SetFont('Cambria', 'I', 16);
 $pdf->WriteFlowingBlock(utf8_decode('El Suscrito, Secretario de la Facultad de Ciencias Jurídicas de la Universidad Nacional ' . 'Autónoma de Honduras, '));
 $pdf->setFont('Cambria', 'BI', 16);
 $pdf->WriteFlowingBlock(utf8_decode('HACE CONSTAR: '));
 $pdf->setFont('Cambria', 'I', 16);
 $pdf->WriteFlowingBlock(utf8_decode('Que '));
 $pdf->setFont('Cambria', 'BI', 16);
 $pdf->WriteFlowingBlock(utf8_decode($nombreTemporal));
 $pdf->setFont('Cambria', 'I', 16);
 $pdf->WriteFlowingBlock(utf8_decode(' con Número de Cuenta '));
 $pdf->setFont('Cambria', 'BI', 16);
 $pdf->WriteFlowingBlock(utf8_decode($numCuentaTemporal));
 $pdf->setFont('Cambria', 'I', 16);
 $pdf->WriteFlowingBlock(utf8_decode(' y Tarjeta de Identidad '));
 $pdf->setFont('Cambria', 'BI', 16);
 $pdf->WriteFlowingBlock(utf8_decode($numIdentidadTemporal));
 $pdf->setFont('Cambria', 'I', 16);
 $pdf->WriteFlowingBlock(utf8_decode(', ha realizado Examen del Himno Nacional de la República de Honduras, habiendo obtenido una ' . 'calificación de  '));
开发者ID:Joshuabenitez,项目名称:Proyecto-industria,代码行数:31,代码来源:ConstanciaHimno.php

示例6: PDF

$value_width = 80;
$product_per_col = 8;
$product_per_page = $product_per_col * 2;
foreach ($supplier_list as $sup_id => $sl) {
    $pdf = new PDF('P', 'mm', 'A4');
    $pdf->setTitle('J&G Elements Picking List');
    $pdf->SetAuthor('JULIE GRACE');
    $pdf->SetCreator('k-Auto Generated PDF');
    $pdf->SetDisplayMode('real');
    $pdf->SetAutoPageBreak(false, 1);
    $counter = 0;
    foreach ($sl as $e) {
        $pdf->currentSupplier = $suppliers[$sup_id];
        if ($counter % $product_per_page == 0) {
            $pdf->AddPage();
            $pdf->setFont('Arial', '', '10');
            $ypos = $margin_top;
        }
        if ($counter % $product_per_col == 0) {
            $ypos = $margin_top;
        }
        $ypos += $spacing;
        if ($counter % $product_per_page >= $product_per_col) {
            $xpos = $margin_left + 100;
        } else {
            $xpos = $margin_left;
        }
        $box_pad = 2;
        $img_path = DIR_WS_IMAGES . 'imagecache/';
        $img_file = basename(webImageSource($e['image'], '', '80', '80'));
        $img = $img_path . $img_file;
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:elements-picking-list-sourcing.php

示例7: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Purchasing Group List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $header = array('No', 'ID', 'Purchasing Organization', 'Purchasing Group Code', 'Description');
     $model = new Purchasinggroup('searchwstatus');
     $dataprovider = $model->searchwstatus();
     $dataprovider->pagination = false;
     $data = $dataprovider->getData();
     $cols = $dataprovider->getKeys();
     $dataku = array(count($data));
     //var_dump($dataku);
     $w = array(10, 15, 50, 40, 70);
     $pdf->SetTableHeader();
     //Header
     for ($i = 0; $i < count($header); $i++) {
         $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetTableData();
     //Data
     $fill = false;
     $i = 0;
     foreach ($data as $datas) {
         $i = $i + 1;
         $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[1], 6, $datas['purchasinggroupid'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[2], 6, Purchasingorg::model()->findbypk($datas['purchasingorgid'])->purchasingorgcode, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[3], 6, $datas['purchasinggroupcode'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[4], 6, $datas['description'], 'LR', 0, 'L', $fill);
         $pdf->Ln();
         $fill = !$fill;
     }
     $pdf->Cell(array_sum($w), 0, '', 'T');
     // me-render ke browser
     $pdf->Output('purchasinggroup.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:43,代码来源:PurchasinggroupController.php

示例8: generateReports

/**
 * 
 * @global array $DIAMOND_BRAND_IDS
 * @global string $server
 * @global jng_sp $class_sp
 * @global products_minierp $class_pm
 * @global logger $logger
 * @global string $icon_diamond
 * @global string $icon_gold_585_w
 * @global string $icon_gold_585_g
 * @param string $timestamp
 * @param int $jng_sp_id
 * @return boolean
 */
function generateReports($timestamp, $jng_sp_id)
{
    global $DIAMOND_BRAND_IDS, $server, $class_sp, $class_pm, $logger, $icon_diamond, $icon_gold_585_w, $icon_gold_585_g;
    $log_date = strtotime($timestamp);
    $sp_detail = $jng_sp_id > 0 ? $class_sp->retrieveDetail($jng_sp_id) : array('package_prefix' => 'JG.DE');
    $filter_sold = 1;
    $filter_age = 56;
    $logger->write("GENERATING REPORT {$sp_detail['package_prefix']}");
    /*
     * Query get new products which:
     * 1) age <= 8 weeks (56 days)
     * 2) total sold >= 1
     */
    $q = "SELECT p.products_id, p.products_model, p.products_image, p.products_price, p.material_expenses, p.stars ";
    $q .= " , ptc.categories_id AS catid, cd.categories_name";
    $q .= " , IFNULL(plps.sold_monthly_1, 0) AS sold_monthly_1, IFNULL(plps.sold_monthly_2, 0) AS sold_monthly_2";
    if ($jng_sp_id > 0) {
        $q .= " , ((jc.total_returned / jc.total_sold) * 100) AS returned_rate, jc.active_age";
    } else {
        $q .= " , 'N/A' AS returned_rate, DATEDIFF(NOW(), p.products_date_added) AS active_age";
    }
    $q .= " FROM products p";
    if ($jng_sp_id > 0) {
        $q .= " INNER JOIN jng_sp_catalog jc ON jc.jng_sp_id = {$jng_sp_id} AND jc.products_id = p.products_id";
    } else {
        $q .= " INNER JOIN orders_products op ON op.products_id = p.products_id";
    }
    $q .= " LEFT JOIN products_log_per_sp plps ON plps.products_id = p.products_id AND plps.jng_sp_id = {$jng_sp_id}";
    $q .= " LEFT JOIN products_to_categories ptc ON ptc.products_id = p.products_id";
    $q .= " LEFT JOIN categories_description cd ON cd.categories_id = ptc.categories_id AND cd.language_id = 1";
    $q .= " WHERE";
    if ($jng_sp_id > 0) {
        $q .= " jc.active_age <= {$filter_age}";
        $q .= " AND jc.active_status = 1";
        $q .= " AND total_sold >= {$filter_sold}";
    } else {
        //$q .= " p.products_date_added >= '2013-01-01 00:00:00'";
        $q .= " DATEDIFF(NOW(), p.products_date_added) <= {$filter_age}";
        $q .= " AND p.products_status = 1";
        $q .= " AND op.status NOT IN (10, 12)";
        $q .= " GROUP BY p.products_id";
        $q .= " HAVING SUM(op.products_quantity) >= {$filter_sold}";
    }
    //$q .= " LIMIT 5";
    $dbq = tep_db_query($q);
    $products = array();
    while ($row = tep_db_fetch_array($dbq)) {
        $row['margin'] = $class_pm->calculateMargin($row['products_price'], $row['material_expenses'], 1);
        $products[$row['catid']][$row['products_id']] = $row;
    }
    if (count($products) == 0) {
        $logger->write("NO DATA RETRIEVED");
        return false;
    }
    //Start Creating PDF Reports
    $margin = 20;
    $ypos = 10;
    $col_width = 48;
    $col_height = 77;
    $line_height = 5;
    $cell_text_width = $col_width - 3;
    $no = 0;
    $row = 1;
    $icon_w = 4;
    $icon_h = 4;
    $first_page = true;
    $pdf = new PDF('P', 'mm', 'A4');
    $pdf->setTitle('New Comer Report');
    $pdf->SetAuthor('JULIE GRACE');
    $pdf->SetCreator('Manobo PDF Generator');
    $pdf->SetDisplayMode('real');
    $pdf->SetAutoPageBreak(true, 25);
    $pdf->AliasNbPages();
    $pdf->AddPage('L');
    $pdf->setXY($margin, $ypos);
    $pdf->setFont('Arial', 'B', '14');
    $pdf->cell(240, 5, 'SALES REPORT NEWCOMER PRODUCT ' . $sp_detail['package_prefix'] . ' (' . date('d.m.Y', $log_date) . ')', 0, 0, 'C');
    $pdf->setFont('Arial', '', '10');
    $ypos += 15;
    $pdf->setXY($margin, $ypos);
    $catids = load_config('products-categories-sorting');
    foreach ($catids as $catid) {
        $xpos = $margin;
        if (is_array($products[$catid])) {
            foreach ($products[$catid] as $pid => $p) {
                $obj_product = new product($pid);
//.........这里部分代码省略.........
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:101,代码来源:sales-report-newcomer-product.php

示例9: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Employee Informal List';
     $pdf->AddPage('P');
     $sql1 = "select splettername, description, validperiod\r\n      from splettertype a";
     $pdf->setFont('Arial', 'B', 8);
     $connection = Yii::app()->db;
     $command1 = $connection->createCommand($sql1);
     $dataReader1 = $command1->queryAll();
     $pdf->text(10, 40, 'Course / Trainig / skill List');
     $pdf->SetY(45);
     $pdf->setaligns(array('C', 'C', 'C'));
     $pdf->setwidths(array(50, 40, 30));
     $pdf->Row(array('SP Letter Name', 'Description', 'Period'));
     $pdf->setaligns(array('L', 'L', 'L'));
     foreach ($dataReader1 as $row1) {
         $pdf->row(array($row1['splettername'], $row1['description'], $row1['validperiod']));
     }
     // me-render ke browser
     $pdf->Output('splettertype.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:23,代码来源:SplettertypeController.php

示例10: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Storage Location List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $connection = Yii::app()->db;
     $sql = "select b.plantcode, a.sloccode, a.description\r\n      from sloc a\r\n      left join plant b on b.plantid = a.plantid";
     $command = $connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $pdf->setaligns(array('C', 'C', 'C', 'C'));
     $pdf->setwidths(array(30, 30, 70));
     $pdf->Row(array('Plant', 'Sloc Code', 'Description'));
     $pdf->setaligns(array('L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $pdf->row(array($row1['plantcode'], $row1['sloccode'], $row1['description']));
     }
     // me-render ke browser
     $pdf->Output('sloc.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:24,代码来源:SlocController.php

示例11: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Schedule Master List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $connection = Yii::app()->db;
     $sql = "select a.employeestatusname, a.taxvalue\r\n      from employeestatus a";
     $command = $connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $pdf->setaligns(array('C', 'C', 'C', 'C'));
     $pdf->setwidths(array(50, 30, 30, 30));
     $pdf->Row(array('Employee Status', 'Tax Value'));
     $pdf->setaligns(array('L', 'R', 'C', 'C'));
     foreach ($dataReader as $row1) {
         $pdf->row(array($row1['employeestatusname'], $row1['taxvalue']));
     }
     // me-render ke browser
     $pdf->Output('employeestatus.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:24,代码来源:EmployeestatusController.php

示例12: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Asset List';
     $pdf->AddPage('L');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $connection = Yii::app()->db;
     $sql = "select b.productname,c.sloccode,a.expiredate,a.serialno,a.qty,d.uomcode,a.buydate,\r\n      a.buyprice,e.currencyname,a.picproduct,a.location,a.locationdate\r\n      from productdetail a\r\n      left join product b on b.productid = a.productid\r\n      left join sloc c on c.slocid = a.slocid\r\n      left join unitofmeasure d on d.unitofmeasureid = a.unitofmeasureid\r\n      left join currency e on e.currencyid = a.currencyid";
     $command = $connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
     $pdf->setwidths(array(50, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20));
     $pdf->Row(array('Material Name', 'Sloc', 'Expire Date', 'Serial No', 'Qty', 'UOM Code', 'Buy Date', 'Buy Price', 'Currency', 'PIC Product', 'Location', 'Loc Date'));
     $pdf->setaligns(array('L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $pdf->row(array($row1['productname'], $row1['sloccode'], $row1['expiredate'], $row1['serialno'], $row1['qty'], $row1['uomcode'], $row1['buydate'], $row1['buyprice'], $row1['currencyname'], $row1['picproduct'], $row1['location'], $row1['locationdate']));
     }
     // me-render ke browser
     $pdf->Output('productdetail.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:24,代码来源:ProductdetailController.php

示例13: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Absence Status List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $header = array('No', 'ID', 'Short Status', 'Long Status', 'Priority');
     $model = new Absstatus('searchwstatus');
     $dataprovider = $model->searchwstatus();
     $dataprovider->pagination = false;
     $data = $dataprovider->getData();
     $cols = $dataprovider->getKeys();
     $dataku = array(count($data));
     //var_dump($dataku);
     $w = array(20, 25, 30, 40, 50);
     $pdf->SetTableHeader();
     //Header
     for ($i = 0; $i < count($header); $i++) {
         $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetTableData();
     //Data
     $fill = false;
     $i = 0;
     foreach ($data as $datas) {
         $i = $i + 1;
         $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[1], 6, $datas['absstatusid'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[2], 6, $datas['shortstat'], 'LR', 0, 'C', $fill);
         $pdf->Cell($w[3], 6, $datas['longstat'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[4], 6, $datas['priority'], 'LR', 0, 'C', $fill);
         $pdf->Ln();
         $fill = !$fill;
     }
     $pdf->Cell(array_sum($w), 0, '', 'T');
     // me-render ke browser
     $pdf->Output('absencestatus.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:43,代码来源:SubdistrictController.php

示例14: actionDownload

 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Kelurahan List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $header = array('No', 'ID', 'Subdistrict', 'Kelurahan');
     $model = new Kelurahan('searchwstatus');
     $dataprovider = $model->searchwstatus();
     $dataprovider->pagination = false;
     $data = $dataprovider->getData();
     $cols = $dataprovider->getKeys();
     $dataku = array(count($data));
     //var_dump($dataku);
     $w = array(20, 25, 50, 50);
     $pdf->SetTableHeader();
     //Header
     for ($i = 0; $i < count($header); $i++) {
         $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetTableData();
     //Data
     $fill = false;
     $i = 0;
     foreach ($data as $datas) {
         $i = $i + 1;
         $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[1], 6, $datas['kelurahanid'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[2], 6, Subdistrict::model()->findbypk($datas['subdistrictid'])->subdistrictname, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[3], 6, $datas['kelurahanname'], 'LR', 0, 'L', $fill);
         $pdf->Ln();
         $fill = !$fill;
     }
     $pdf->Cell(array_sum($w), 0, '', 'T');
     // me-render ke browser
     $pdf->Output('kelurahan.pdf', 'D');
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:42,代码来源:KelurahanController.php

示例15: PutLink

    }
    function PutLink($URL, $txt)
    {
        // Put a hyperlink
        $this->setTextColor(0, 0, 255);
        $this->setStyle('U', true);
        $this->write(5, $txt, $URL);
        $this->setStyle('U', false);
        $this->setTextColor(0);
    }
}
$html = 'You can now easily print text mixing different styles: **bold**, <i>italic</i>,
<u>underlined</u>, or **<i><u>all at once</u></i>**!You can also insert links on
text, such as <a href="http://www.fpdf.org">www.fpdf.org</a>, or on an image: click on the logo.';
$pdf = new PDF();
// First page
$pdf->addPage();
$pdf->setFont('Arial', '', 20);
$pdf->write(5, "To find out what's new in this tutorial, click ");
$pdf->setFont('', 'U');
$link = $pdf->addLink();
$pdf->write(5, 'here', $link);
$pdf->setFont('');
// Second page
$pdf->addPage();
$pdf->setLink($link);
$pdf->image('logo.png', 10, 12, 30, 0, '', 'http://www.fpdf.org');
$pdf->setLeftMargin(45);
$pdf->setFontSize(14);
$pdf->writeHTML($html);
$pdf->output();
开发者ID:feryardiant,项目名称:fpdf,代码行数:31,代码来源:tuto6.php


注:本文中的PDF::setFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。