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


PHP FPDF::Rect方法代碼示例

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


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

示例1: post_id_upc_terms_handler

 public function post_id_upc_terms_handler()
 {
     $this->id = preg_split('/[^\\d]/', $this->id, 0, PREG_SPLIT_NO_EMPTY);
     $pdf = new FPDF('P', 'mm', 'Letter');
     $pdf->SetMargins(6.35, 6.35, 6.35);
     // quarter-inch margins
     $pdf->SetAutoPageBreak(false);
     $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
     $margins = $pdf->GetMargins();
     $margins['top'] = 0.0;
     $check_left_x = $margins['left'] > 3.175 ? $margins['right'] : 3.175 - $margins['left'];
     $real_check_top_y = 183.675 - $margins['top'];
     $check_right_x = 203.2 - $margins['left'];
     $real_check_bottom_y = 255.112 - $margins['top'];
     $line_height = 5;
     $envelope_window_tab = 15;
     $right_col1 = 130;
     $right_col2 = 170;
     $my_address = array('610 E 4th St', 'Duluth, MN 55805', 'Tel: 218.728.0884', 'www.wholefoods.coop');
     $check_date = date('F j, Y');
     $dbc = $this->connection;
     $dbc->setDefaultDB($this->config->get('OP_DB'));
     $signage = new COREPOS\Fannie\API\item\FannieSignage(array());
     foreach ($this->id as $card_no) {
         $pdf->AddPage();
         $account = \COREPOS\Fannie\API\member\MemberREST::get($card_no);
         $primary = array();
         foreach ($account['customers'] as $c) {
             if ($c['accountHolder']) {
                 $primary = $c;
                 break;
             }
         }
         $check_number = rand(100000, 999995);
         for ($i = 0; $i < 3; $i++) {
             $pdf->SetFont('Gill', '', 10);
             $check_top_y = $real_check_top_y - $i * 90;
             $check_bottom_y = $real_check_bottom_y - $i * 90;
             $pdf->SetXY($check_left_x, $check_top_y);
             $pdf->Ln($line_height * 4.25);
             foreach ($my_address as $line) {
                 $pdf->SetX($check_left_x + $envelope_window_tab + 20);
                 if ($line == 'www.wholefoods.coop') {
                     $pdf->SetFont('Gill', 'B', 9);
                 }
                 $pdf->Cell(0, $line_height, $line, 0, 1);
             }
             $pdf->SetFont('Gill', 'B', 10);
             $pdf->SetXY($check_left_x + $right_col1, $check_top_y);
             $pdf->Cell(30, $line_height, 'Check Number:', 0, 0, 'R');
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetTextColor(0xff, 0x58, 0);
             $pdf->SetX($check_left_x + $right_col2);
             $pdf->Cell(30, $line_height, $check_number, 0, 0, 'R');
             $pdf->SetFont('Gill', 'B', 10);
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetXY($check_left_x + $right_col1, $check_top_y + 1.5 * $line_height);
             $pdf->Cell(30, $line_height, 'Date:', 0, 0, 'R');
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetTextColor(0xff, 0x58, 0);
             $pdf->SetX($check_left_x + $right_col2);
             $pdf->Cell(30, $line_height, $check_date, 0, 0, 'R');
             $pdf->SetXY($check_left_x + $right_col1, $check_top_y + 3 * $line_height);
             $pdf->SetFont('Gill', 'B', 10);
             $pdf->SetTextColor(0, 0, 0);
             $pdf->Cell(30, $line_height, 'Amount:', 0, 0, 'R');
             $pdf->SetXY($check_left_x + $right_col1 + 30, $check_top_y + 3 * $line_height);
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetTextColor(0xff, 0x58, 0);
             $pdf->MultiCell(40, $line_height, str_repeat(' ', 2) . $this->terms, 0, 'R');
             $pdf->SetTextColor(0, 0, 0);
             $their_address = array($primary['firstName'] . ' ' . $primary['lastName']);
             $their_address[] = $account['addressFirstLine'];
             if ($account['addressSecondLine']) {
                 $their_address[] = $account['addressSecondLine'];
             }
             $their_address[] = $account['city'] . ', ' . $account['state'] . ' ' . $account['zip'];
             $pdf->SetXY($check_left_x + $envelope_window_tab, $check_top_y + 11 * $line_height);
             $pdf->SetFont('Gill', 'B', 10);
             foreach ($their_address as $line) {
                 $pdf->SetX($check_left_x + $envelope_window_tab);
                 $pdf->Cell(0, $line_height, $line, 0, 1);
             }
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetXY($check_left_x, $check_bottom_y + $line_height - 1);
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Gill', 'B', 10);
             $pdf->Cell(0, $line_height, 'Redeemable only at Whole Foods Co-op', 0, 0, 'C');
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetXY($check_left_x + 145, $check_top_y + 6 * $line_height + 1);
             $pdf->SetFont('Gill', '', 8);
             $pdf->MultiCell(50, $line_height - 2, 'Limit one per day. Cannot be applied to previous purchases. No cash value.');
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetFillColor(0xcc, 0xcc, 0xcc);
             $pdf->Rect($check_left_x + 84, $check_top_y + 28, 39, 15, 'F');
             $pdf->SetFillColor(0, 0, 0);
             $signage->drawBarcode(ltrim($this->upc, '0'), $pdf, $check_left_x + 87, $check_top_y + 30, array('height' => 11, 'fontsize' => 0));
             $pdf->Image('logo.rgb.noalpha.png', $check_left_x + $envelope_window_tab, $check_top_y + 20, 20);
             $pdf->SetFont('Gill', 'B', '31');
//.........這裏部分代碼省略.........
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:101,代碼來源:CheckCouponMailing.php

示例2: generate_attendees_PDF

 public final function generate_attendees_PDF($tickets_list)
 {
     $this->load_pdf_libraries();
     $pdf = new FPDF();
     $ecp = TribeEvents::instance();
     $pdf->AddFont('OpenSans', '', 'opensans.php');
     $pdf->AddFont('SteelFish', '', 'steelfish.php');
     $pdf->SetTitle('EventTicket');
     $pdf->SetAuthor('The Events Calendar');
     $pdf->SetCreator('The Events Calendar');
     $defaults = array('event_id' => 0, 'ticket_name' => '', 'holder_name' => '', 'order_id' => '', 'ticket_id' => '', 'security_code' => '');
     foreach ($tickets_list as $ticket) {
         $ticket = wp_parse_args($ticket, $defaults);
         $event = get_post($ticket['event_id']);
         $venue_id = tribe_get_venue_id($event->ID);
         $venue = !empty($venue_id) ? get_post($venue_id)->post_title : '';
         $address = tribe_get_address($event->ID);
         $zip = tribe_get_zip($event->ID);
         $state = tribe_get_stateprovince($event->ID);
         $city = tribe_get_city($event->ID);
         $pdf->AddPage();
         $pdf->SetDrawColor(28, 166, 205);
         $pdf->SetFillColor(28, 166, 205);
         $pdf->Rect(15, 10, 180, 34, 'F');
         $pdf->SetTextColor(255);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 15);
         $pdf->Write(5, __('EVENT NAME:', 'tribe-events-calendar'));
         $pdf->SetXY(30, 28);
         $pdf->SetFont('SteelFish', '', 53);
         $title = strtoupper(utf8_decode($event->post_title));
         $size = 53;
         while ($pdf->GetStringWidth($title) > 151) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $title);
         $pdf->SetTextColor(41);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 50);
         $pdf->Write(5, __('TICKET HOLDER:', 'tribe-events-calendar'));
         $pdf->SetXY(104, 50);
         $pdf->Write(5, __('LOCATION:', 'tribe-events-calendar'));
         $pdf->SetFont('SteelFish', '', 30);
         $pdf->SetXY(30, 59);
         $holder = strtoupper(utf8_decode($ticket['holder_name']));
         $size = 30;
         while ($pdf->GetStringWidth($holder) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $holder);
         $pdf->SetXY(104, 59);
         $venue = strtoupper(utf8_decode($venue));
         $size = 30;
         while ($pdf->GetStringWidth($venue) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $venue);
         $pdf->SetXY(104, 71);
         $address = strtoupper(utf8_decode($address));
         $size = 30;
         while ($pdf->GetStringWidth($address) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $address);
         $pdf->SetXY(104, 83);
         $address2 = array($city, $state, $zip);
         $address2 = array_filter($address2);
         $address2 = join(', ', $address2);
         $address2 = strtoupper(utf8_decode($address2));
         $size = 30;
         while ($pdf->GetStringWidth($address2) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $address2);
         $pdf->Line(15, 97, 195, 97);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 105);
         $pdf->Write(5, __('ORDER:', 'tribe-events-calendar'));
         $pdf->SetXY(80, 105);
         $pdf->Write(5, __('TICKET:', 'tribe-events-calendar'));
         $pdf->SetXY(120, 105);
         $pdf->Write(5, __('VERIFICATION:', 'tribe-events-calendar'));
         $pdf->SetFont('SteelFish', '', 53);
         $pdf->SetXY(30, 118);
         $pdf->Write(5, $ticket['order_id']);
         $pdf->SetXY(80, 118);
         $pdf->Write(5, $ticket['ticket_id']);
         $pdf->SetXY(120, 118);
         $pdf->Write(5, $ticket['security_code']);
         $pdf->Rect(15, 135, 180, 15, 'F');
         $pdf->SetTextColor(255);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 140);
         $pdf->Write(5, get_bloginfo('name'));
         $pdf->SetXY(104, 140);
//.........這裏部分代碼省略.........
開發者ID:mpaskew,項目名稱:isc-dev,代碼行數:101,代碼來源:tribe-tickets.php

示例3: while

 /**
  *
  * View detail of persuratan_suratmasuk
  *
  **/
 function action_persuratan_suratmasukcetakld($id)
 {
     $this->blankpage = true;
     $this->db_query("SELECT * FROM persuratan_ms_flowstat");
     while ($row = $this->db_fetch()) {
         $arr_ms_flowstat[$row['id']] = $row['name'];
     }
     $this->db_query("SELECT * FROM persuratan_ms_tipesurat");
     while ($row = $this->db_fetch()) {
         $arr_ms_tipesurat[$row['id']] = $row['name'];
     }
     $this->db_query("SELECT * FROM persuratan_ms_sifatsurat");
     while ($row = $this->db_fetch()) {
         $arr_ms_sifatsurat[$row['id']] = $row['name'];
     }
     $this->db_query("SELECT * FROM persuratan_ms_tujuanakhir");
     while ($row = $this->db_fetch()) {
         $arr_ms_tujuanakhir[$row['id']] = $row['name'];
     }
     $res = $this->db_query("SELECT * , DATE_FORMAT(tglagenda, '%d-%m-%Y') AS tglagenda, DATE_FORMAT(tglsuratintern, '%d-%m-%Y') AS tglsuratintern, DATE_FORMAT(tglkma, '%d-%m-%Y') AS tglkma, DATE_FORMAT(tglsuratpengirim, '%d-%m-%Y') AS tglsuratpengirim, DATE_FORMAT(tglpembukuan, '%d-%m-%Y') AS tglpembukuan, DATE_FORMAT(tglmasuktuadawas, '%d-%m-%Y') AS tglmasuktuadawas, DATE_FORMAT(tglkeluar, '%d-%m-%Y') AS tglkeluar FROM persuratan_suratmasuk \n            WHERE ms_tujuanakhir_id='{$id}' AND ms_flowstat_id = 101\n                {$this->groupfield} ORDER BY tglagenda DESC");
     $this->db_query("SELECT * , DATE_FORMAT(tglagenda, '%d-%m-%Y') AS tglagenda, DATE_FORMAT(tglsurat, '%d-%m-%Y') AS tglsurat FROM persuratan_suratmasuk WHERE ms_tujuanakhir_id='{$id}' AND ms_flowstat_id = 101 {$this->groupfield} ORDER BY tglagenda DESC, id DESC");
     if ($this->db_numrows() > 0) {
         //==============
         // Start create PDF
         //==============
         require 'fpdf/fpdf.php';
         $pdf = new FPDF('P', 'mm', array(215, 330));
         $pdf->SetAuthor('Agus Sudarmanto, S.Kom.');
         while ($row = $this->db_fetch()) {
             $pdf->AddPage();
             $pdf->SetFont('Arial', 'B', 16);
             $cellBox = 195;
             $pdf->Rect(10, 7, $cellBox, 25);
             $pdf->Rect(10, 38, $cellBox, 24);
             $pdf->Rect(150, 38, 55, 24);
             $pdf->Rect(10, 62, $cellBox, 50);
             $pdf->Rect(10, 118, $cellBox, 133);
             $pdf->Rect(150, 118, 55, 133);
             $pdf->Cell($cellBox, 7, 'MAHKAMAH AGUNG REPUBLIK INDONESIA', 0, 1, 'C');
             $pdf->Cell($cellBox, 7, 'SEKRETARIAT WAKIL KETUA MA BIDANG NON YUDISIAL', 0, 1, 'C');
             $pdf->SetFont('Arial', 'B', 12);
             $pdf->Cell($cellBox, 7, 'Lembar Disposisi', 0, 1, 'C');
             $pdf->Image('pdf/logo.png', 23, 10, 16);
             $pdf->SetFont('Arial', '', 10);
             $arr = array(array('Nomor Agenda', $row[noagenda]), array('Tanggal Agenda', $row[tglagenda]), array('Agno TU', $row[nosuratintern]), array('Tanggal TU', $row[tglsuratintern]), array('', ''), array('Nomor Surat', $row[nosuratpengirim]), array('Tanggal', $row[tglsuratpengirim]), array('Pengirim', $row[namapengirim]), array('Perihal', $row[perihal]));
             $pdf->SetY(40);
             for ($i = 0, $c = sizeof($arr); $i < $c; $i++) {
                 $pdf->SetX(13);
                 $pdf->Cell(31, 5, $arr[$i][0]);
                 $pdf->Cell(5, 5, !in_array($i, array(4, 9)) ? ':' : '');
                 $pdf->MultiCell($i < 5 ? 100 : 158, 5, $arr[$i][1], 0, 1);
             }
             $pdf->SetY(45);
             $arr = array(array('Jenis Surat', $arr_ms_sifatsurat[$row['ms_sifatsurat_id']]));
             for ($i = 0, $c = sizeof($arr); $i < $c; $i++) {
                 $pdf->SetX(155);
                 $pdf->Cell(20, 5, $arr[$i][0]);
                 $pdf->Cell(5, 5, ':');
                 if ($i == 0) {
                     $pdf->SetFont('', 'B');
                 }
                 $pdf->MultiCell(70, 5, $arr[$i][1], 0, 1);
                 if ($i == 0) {
                     $pdf->SetFont('', '');
                 }
             }
             $arr = array(array('Diteruskan kepada :'), array('KMA RI'), array('WKMA RI Bid. Yud'), array('WKMA RI Bid. Non Yud'), array('Para Tuaka'), array('Kabawas'), array('Lainnya'));
             $pdf->SetY(120);
             for ($i = 0, $c = sizeof($arr); $i < $c; $i++) {
                 $pdf->SetX($i == 0 ? 155 : 163);
                 $pdf->Cell(31, 7, $arr[$i][0], 0, 1);
             }
             $pdf->SetFont('Arial', '', 8);
             $pdf->SetY(251);
             for ($i = 0; $i < 6; $i++) {
                 $pdf->Rect(157, 128 + $i * 7, 4, 4);
             }
             $pdf->SetY(150);
             $pdf->SetX(130);
         }
         $pdf->Output();
         $res = $this->db_query("UPDATE persuratan_suratmasuk \n                SET ms_flowstat_id = 102\n                WHERE ms_tujuanakhir_id='{$id}' AND ms_flowstat_id = 101");
     }
 }
開發者ID:kit9,項目名稱:surat,代碼行數:89,代碼來源:base.php

示例4: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('P', 'mm', 'Letter');
     $pdf->SetMargins(0, 3.175, 0);
     $pdf->SetAutoPageBreak(false);
     define('FPDF_FONTPATH', dirname(__FILE__) . '/noauto/fonts/');
     $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
     $pdf->AddFont('GillBook', '', 'GillSansMTPro-Book.php');
     $pdf->SetFont('Gill', '', 16);
     $data = $this->loadItems();
     $count = 0;
     $sign = 0;
     $width = 53.975;
     $height = 68.95999999999999;
     $top = 20;
     $left = 5.175;
     $effective_width = $width - 2 * $left;
     $pdf->SetDrawColor(0, 0, 0);
     $pdf->SetLineWidth(0.2);
     foreach ($data as $item) {
         if ($count % 16 == 0) {
             $pdf->AddPage();
             // draw tick marks for cutting
             $pdf->Line(2, $height + 1.5, 6, $height + 1.5);
             $pdf->Line(2, 2 * $height + 1.5, 6, 2 * $height + 1.5);
             $pdf->Line(2, 3 * $height + 1.5, 6, 3 * $height + 1.5);
             $pdf->Line($width, 2, $width, 6);
             $pdf->Line(2 * $width, 2, 2 * $width, 6);
             $pdf->Line(3 * $width, 2, 3 * $width, 6);
             $pdf->Line($width, 4 * $height - 4, $width, 4 * $height);
             $pdf->Line(2 * $width, 4 * $height - 4, 2 * $width, 4 * $height);
             $pdf->Line(3 * $width, 4 * $height - 4, 3 * $width, 4 * $height);
             $pdf->Line(4 * $width - 6, $height + 1.5, 4 * $width - 2, $height + 1.5);
             $pdf->Line(4 * $width - 6, 2 * $height + 1.5, 4 * $width - 2, 2 * $height + 1.5);
             $pdf->Line(4 * $width - 6, 3 * $height + 1.5, 4 * $width - 2, 3 * $height + 1.5);
             $sign = 0;
         }
         $row = floor($sign / 4);
         $column = $sign % 4;
         $price = $item['normal_price'];
         if ($item['scale']) {
             if (substr($price, 0, 1) != '$') {
                 $price = sprintf('$%.2f', $price);
             }
             $price .= ' /lb.';
         } elseif (isset($item['signMultiplier'])) {
             $price = $this->formatPrice($item['normal_price'], $item['signMultiplier']);
         } else {
             $price = $this->formatPrice($item['normal_price']);
         }
         $pdf->Image(dirname(__FILE__) . '/cd_head_16.png', $left - 2 + $width * $column, $top - 17 + $row * $height, $width - 6);
         $pdf->SetXY($left + $width * $column, $top + $row * $height - 2);
         $pdf->SetFont('Gill', 'B', $this->SMALL_FONT);
         $font_shrink = 0;
         while (true) {
             $pdf->SetX($left + $width * $column);
             $y = $pdf->GetY();
             $pdf->MultiCell($effective_width, 6, strtoupper($item['brand']), 0, 'C');
             if ($pdf->GetY() - $y > 6) {
                 $pdf->SetFillColor(0xff, 0xff, 0xff);
                 $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F');
                 $font_shrink++;
                 if ($font_shrink >= $this->SMALL_FONT) {
                     break;
                 }
                 $pdf->SetFontSize($this->MED_FONT - $font_shrink);
                 $pdf->SetXY($left + $width * $column, $y);
             } else {
                 break;
             }
         }
         $pdf->SetX($left + $width * $column);
         $pdf->SetFont('Gill', '', $this->MED_FONT);
         $font_shrink = 0;
         while (true) {
             $pdf->SetX($left + $width * $column);
             $y = $pdf->GetY();
             $pdf->MultiCell($effective_width, 6, $item['description'], 0, 'C');
             if ($pdf->GetY() - $y > 12) {
                 $pdf->SetFillColor(0xff, 0xff, 0xff);
                 $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F');
                 $font_shrink++;
                 if ($font_shrink >= $this->MED_FONT) {
                     break;
                 }
                 $pdf->SetFontSize($this->MED_FONT - $font_shrink);
                 $pdf->SetXY($left + $width * $column, $y);
             } else {
                 if ($pdf->GetY() - $y < 12) {
                     $words = explode(' ', $item['description']);
                     $multi = '';
                     for ($i = 0; $i < floor(count($words) / 2); $i++) {
                         $multi .= $words[$i] . ' ';
                     }
                     $multi = trim($multi) . "\n";
                     for ($i = floor(count($words) / 2); $i < count($words); $i++) {
                         $multi .= $words[$i] . ' ';
                     }
                     $item['description'] = trim($multi);
//.........這裏部分代碼省略.........
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:101,代碼來源:CoopDeals16UpDarkP.php

示例5: pdf_export_dots


//.........這裏部分代碼省略.........
    }
    $count_clusters = count($clusters);
    for ($i = 0; $i < $count_clusters; $i++) {
        $dots = $clusters[$i];
        $_legend = array();
        $j = 0;
        foreach ($dots as $dot) {
            $_legend[$dot['id']] = $legend[$dot['id']];
            $j++;
            if ($j >= $count_legend_items) {
                break;
            }
        }
        usort($_legend, "sort_by_lat");
        $pdf->AddPage();
        $pdf->Image($maps[$i], 0, 0, 0, 0, 'PNG');
        $pdf->SetFont('Helvetica', '', 10);
        $x = $h + $margin;
        $y = $margin;
        foreach ($_legend as $dot) {
            $text = "{$dot['id']} / pg. {$dot['page']}";
            $pdf->SetXY($x, $y);
            $pdf->Cell(0, $row_h, $text);
            $loc = new MMaps_Location($dot['latitude'], $dot['longitude']);
            $pt = $map->locationPoint($loc);
            $x1 = $x - $margin / 8;
            $y1 = $y + $row_h / 2;
            $x2 = $pt->x / $dpi;
            $y2 = $pt->y / $dpi;
            $pdf->Line($x1, $y1, $x2, $y2);
            $y += $row_h * 1.1;
        }
    }
    # Now the rows (of dots)
    foreach ($pages as $page) {
        $pdf->AddPage();
        $x = $margin;
        $y = $margin;
        $z = 0;
        foreach ($page as $data) {
            $style = $data['bold'] ? 'B' : '';
            $pdf->SetFont('Helvetica', $style, 10);
            $x_offset = $col_width * 0.1;
            $y_offset = $data['height'] * 0.1;
            $max_width = $col_width - $x_offset * 3;
            $bg = $z % 2 ? 255 : 235;
            $z++;
            foreach ($data['row'] as $value) {
                $value = trim($value);
                $width = $pdf->GetStringWidth($value);
                $pdf->SetFillColor($bg);
                $pdf->Rect($x, $y, $col_width, $data['height'], 'F');
                # Don't bother with MultiCell - it is behaving
                # badly (20110120/straup)
                if ($width < $max_width) {
                    $pdf->SetXY($x + $x_offset, $y + $y_offset);
                    $pdf->Cell(0, $row_h, $value);
                } else {
                    $_x = $x;
                    $_y = $y;
                    $lines = array();
                    $buffer = '';
                    foreach (str_split($value) as $char) {
                        if ($buffer == '' && $char == ' ') {
                            continue;
                        }
                        $buffer .= $char;
                        $width = $pdf->GetStringWidth($buffer);
                        if ($width >= $max_width) {
                            $lines[] = $buffer;
                            $buffer = '';
                        }
                    }
                    if (strlen($buffer)) {
                        $lines[] = $buffer;
                        $buffer = '';
                    }
                    foreach ($lines as $ln) {
                        $pdf->SetXY($_x + $x_offset, $_y + $y_offset);
                        $pdf->Cell(0, $row_h, $ln);
                        $_y += $row_h * 0.8;
                    }
                }
                $x += $col_width;
            }
            $x = $margin;
            $y += $data['height'];
        }
    }
    # Go!
    $pdf->Close();
    $pdf->Output($more['path'], 'F');
    $pdf = null;
    foreach ($maps as $map_img) {
        if (!unlink($map_img)) {
            error_log("[EXPORT] (pdf) unlink {$map_img} : {$ok}");
        }
    }
    return $more['path'];
}
開發者ID:netcon-source,項目名稱:dotspotting,代碼行數:101,代碼來源:lib_pdf.php

示例6: date

$pdf->Cell(0, 0, utf8_decode("Edificio A-2"), 0, 1, 'R');
$pdf->Ln(4.1);
$pdf->Cell(0, 0, utf8_decode("Ciudad Universitaria"), 0, 1, 'R');
$pdf->Ln(4.1);
$pdf->Cell(0, 0, utf8_decode("Tegucigalpa, Honduras"), 0, 1, 'R');
$pdf->SetRightMargin(10);
$pdf->SetLeftMargin(10);
$pdf->Cell(18, 10, '', 0);
//$pdf->Ln(20);
//$pdf->SetFont('Arial', 'U', 14);
//$pdf->Cell(30, 8, ' ', 0,0,"C");
//$pdf->Cell(130, 8, ' Reporte de Estudiantes', 0,0,"C");
$pdf->ln(20);
$pdf->SetFont('Cambria', 'BI', 16);
$pdf->Cell(0, 0, utf8_decode("Reporte de Estudiantes"), 0, 1, 'C');
$pdf->Rect(5, 55, 206, 200, 'D');
$pdf->SetFont('Arial', '', 12);
$pdf->Ln(15);
$pdf->Cell(115, 15, 'Fecha: ' . date('Y-m-d'), 0);
$pdf->Ln(7);
$pdf->Ln(5);
$pdf->SetFont('Arial', 'B', 8);
$pdf->Cell(25, 8, 'Cuenta', 1, 0, "C");
$pdf->Cell(30, 8, 'Identidad', 1, 0, "C");
$pdf->Cell(45, 8, 'Estudiante', 1, 0, "C");
$pdf->Cell(40, 8, 'Correo', 1, 0, "C");
$pdf->Cell(10, 8, 'Indice', 1, 0, "C");
$pdf->Cell(33, 8, utf8_decode('Mención Horifica'), 1, 0, "C");
$pdf->Cell(10, 8, 'Cant', 1, 0, "C");
$pdf->Ln(8);
$pdf->SetFont('Arial', '', 8);
開發者ID:Joshuabenitez,項目名稱:Proyecto-industria,代碼行數:31,代碼來源:reporte_estudiante.php

示例7: rect

 function rect($x1, $y1, $width, $height, $filled = FALSE, $rounded = 0)
 {
     if ($rounded > 0) {
         $this->rect_rounded($this->flash_y_offset + $y1, $this->flash_x_offset + $x1, $width, $height, $rounded, $filled ? "F" : "");
     } else {
         parent::Rect($this->flash_y_offset + $y1, $this->flash_x_offset + $x1, $width, $height, $filled ? "F" : "");
     }
     // end if
 }
開發者ID:joelphilippage,項目名稱:Library,代碼行數:9,代碼來源:pdf_maker.php

示例8:

$pdf->setTextColor(255, 255, 255);
$pdf->Cell(50, 6, utf8_decode('N° DE QUEJAS Y/O RECLAMOS'), 1, 0, 'C', TRUE);
$pdf->SetXY(20, 32);
$pdf->Cell(50, 6, '', 1, 0, 'C', FALSE);
$pdf->setTextColor(0, 0, 0);
$pdf->SetFont('Arial', 'B', 8);
$pdf->Text(60, 50, utf8_decode('COMPROBANTE DE RECEPCIÓN DE QUEJA Y/O RECLAMO'));
$pdf->SetXY(20, 52);
$pdf->SetFont('Arial', 'B', 8);
$pdf->setTextColor(255, 255, 255);
$pdf->Cell(50, 6, utf8_decode('FECHA DE PRESENTACIÓN'), 1, 0, 'C', TRUE);
$pdf->Cell(35, 6, '', 1, 0, 'C', FALSE);
$pdf->Cell(50, 6, utf8_decode('HORA DE PRESENTACIÓN'), 1, 0, 'C', TRUE);
$pdf->Cell(35, 6, '', 1, 0, 'C', FALSE);
$pdf->setTextColor(255, 255, 255);
$pdf->Rect(20, 60, 110, 30, 'FD');
$pdf->Rect(20, 90, 110, 30, 'FILL');
$pdf->Rect(20, 120, 110, 30, 'FILL');
$pdf->Rect(130, 60, 60, 90, 'FILL');
$pdf->Text(55, 75, utf8_decode('FUNCIONARIO(A) RECEPTOR'));
$pdf->setTextColor(0, 0, 0);
$pdf->SetFont('Arial', '', 8);
$pdf->Text(23, 105, utf8_decode('APELLIDOS Y NOMBRES:'));
$pdf->SetFont('Arial', 'B', 8);
$pdf->Text(70, 148, utf8_decode('FIRMA'));
$pdf->Text(155, 105, utf8_decode('SELLO'));
$pdf->Rect(20, 152, 170, 30, 'FILL');
$pdf->Text(22, 158, utf8_decode('NOTA IMPORTANTE:'));
$pdf->SetXY(22, 160);
$pdf->SetFont('Arial', '', 8);
$pdf->SetRightMargin(20.0);
開發者ID:vanckruz,項目名稱:draftReports,代碼行數:31,代碼來源:comprobante_recepcion_queja.php

示例9: FPDF

$hUnderlineOffset = 7.15;
$wSpace = 5;
$hTwoLinesOffset = 5.5;
//***************
//** PDF Build **
//***************
require_once "resources/includePath.inc";
require 'fpdf17/fpdf.php';
$pdf = new FPDF();
//default to mm units
$pdf->AddFont('Porcelain', '', 'Porcelain.php');
$pdf->AddFont('DemiTasse', '', 'DemiTasse.php');
$pdf->AddPage('P', 'Letter');
//** Draw Page Outline Box **
$pdf->SetDrawColor(230, 230, 230);
$pdf->Rect($xMarginLeft, $yMarginTop, $xMarginRight - $xMarginLeft, $yMarginBottom - $yMarginTop);
//*************************
//** Write Page Elements **
//*************************
//** Images **
$imgScaleBorder = 97;
$imgScaleWatermark = 75;
$imgSpacingBorder = 1.5;
$pdf->Image('resources/certificates/border_L.png', $xMarginLeft + $imgSpacingBorder, $yMarginTop + $imgSpacingBorder, $imgScaleBorder);
$pdf->Image('resources/certificates/watermark_light.png', ($wTextArea - $imgScaleWatermark) / 2 + $xLeftTextMargin, $yMarginTop + 7, $imgScaleWatermark);
$pdf->Image('resources/certificates/border_R.png', $xMarginRight - $imgSpacingBorder - $imgScaleBorder, $yMarginBottom - $imgSpacingBorder - $imgScaleBorder, $imgScaleBorder);
//** Title **
$yLine = $yMarginTop + 16;
$pdf->SetFont('Porcelain', '', 42);
$pdf->SetY($yLine);
$pdf->Cell(0, 10, $textTitle, 0, 1, 'C');
開發者ID:reideast,項目名稱:PHP_Wedding,代碼行數:31,代碼來源:WeddingCertificate.php

示例10: FPDF

    $query2->execute();*/
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', '', 18);
$pdf->Image($maindir . 'assets/img/lucen-aspicio.png', 50, 30, 200, 200, 'PNG');
$pdf->Image($maindir . 'assets/img/logo_unah.png', 10, 5, 18, 30, 'PNG');
$pdf->Image($maindir . 'assets/img/logo-cienciasjuridicas.png', 170, 8, 25, 25, 'PNG');
$pdf->Cell(22, 10, '', 0);
$pdf->SetFont('Arial', '', 18);
$pdf->Cell(5, 10, '', 0);
$pdf->Cell(70, 10, utf8_decode('Universidad Nacional Autónoma de Honduras'), 0);
$pdf->Ln(15);
$pdf->SetFont('Arial', 'U', 14);
$pdf->Cell(25, 8, '', 0, 0, "C");
$pdf->Cell(130, 8, ' Control de Permisos Personales', 0, 0, "C");
$pdf->Rect(6, 37, 200, 95, 'D');
$pdf->SetFont('Arial', '', 12);
$pdf->Ln(10);
$nombreCompleto = "{$result['Primer_nombre']} {$result['Segundo_nombre']} {$result['Primer_apellido']} {$result['Segundo_Apellido']}";
$pdf->Cell(100, 15, 'Nombre: ' . $nombreCompleto, 0, 0, "");
$pdf->Cell(40, 15, 'No.De Empleado: ' . $result['No_Empleado'], 0, 0, "");
$pdf->Ln(7);
$pdf->Cell(150, 15, utf8_decode('Unidad Académica: ') . $result['nombre_departamento'], 0);
$pdf->Ln(7);
$pdf->Cell(140, 15, 'Solicitud de permiso por motivo de: ' . $result['mtd'], 0, 0, "");
$pdf->Ln(7);
$pdf->Cell(140, 15, 'Edificio de Registro de Asistencia: ' . $result['descripcion'], 0, 0, "");
$pdf->Ln(7);
$pdf->Cell(125, 15, utf8_decode('Duración en dias: ') . $result['dias_permiso'], 0, 0, "");
$pdf->Ln(7);
$pdf->Cell(40, 15, 'Fecha: ' . $result['fecha'], 0, 0, "");
開發者ID:Joshuabenitez,項目名稱:Proyecto-industria,代碼行數:31,代碼來源:crear_pdfpermiso.php

示例11: FPDF

<?php

require 'fpdf.php';
$nom = "Marc Prats";
$pdf = new FPDF('L', 'mm', 'A4');
$pdf->AddPage();
$pdf->SetFillColor(255, 0, 0);
for ($x = 0; $x < 8; $x++) {
    for ($y = 0; $y < 12; $y++) {
        $pdf->Rect(5 + $x * 36, 14 + $y * 16, 34, 12, 'F');
    }
}
$pdf->SetFillColor(255, 255, 255);
//$pdf->SetFillColor(0,0,0);
for ($x = 0; $x < 8; $x++) {
    for ($y = 0; $y < 12; $y++) {
        $pdf->Rect(6 + $x * 36, 15 + $y * 16, 32, 10, 'F');
    }
}
// $pdf->SetFont('Arial','B',16);
// $pdf->Cell(40,10,$nom);
// $pdf->Cell(40,10,$nom);
// $pdf->Cell(40,10,$nom);
// $pdf->Cell(40,10,$nom);
// $pdf->Cell(40,10,$nom);
// $pdf->Ln(20);
// $pdf->Cell(40,10,$nom);
// $pdf->Cell(40,10,$nom);
// $pdf->Cell(40,10,$nom);
// $pdf->Cell(40,10,$nom);
// $pdf->Cell(40,10,$nom);
開發者ID:jordiprats,項目名稱:pedificador,代碼行數:31,代碼來源:patro.php

示例12:

//Fecha - Modificación
$pdf->Line(75, 220.5, 140, 220.5);
//Firma de Autorización
/*********************** Firmas del Documento ***************************/
$pdf->Line(13, 234.5, 69, 234.5);
//Solicitante (241.5)
$pdf->Line(147, 234.5, 203, 234.5);
//Comisión Autorizada por
$pdf->Line(13, 249.5, 69, 249.5);
//Registro Departamento de Recursos Financieros (261.5)
$pdf->Line(147, 249.5, 203, 249.5);
//Subjefe Administrativo
/*********************** FIN LINEAS *******************************/
/*********************** INICIO RECTÁNGULOS ***********************/
//Rectángulo  izq sup der inf
$pdf->Rect(147, 48.5, 3, 3);
//Cuadro1 Presupuesto Estatal [*]
$pdf->Rect(173, 48.5, 3, 3);
//Cuadro2 Presupuesto Federal [*]
$pdf->Rect(44, 96, 3, 3);
//Cuadro1 Pago Efectivo       [*]
$pdf->Rect(43.5, 112, 3, 3);
//Cuadro2 pago Tarjeta     [*]
$pdf->Rect(34, 180.5, 3, 3);
//Cuadro 1 Viático               Tipo de Ampliación     [*]
$pdf->Rect(74, 180.5, 3, 3);
//Cuadro 2 Viat-24hrs     Tipo de Ampliación     [*]
$pdf->Rect(104, 180.5, 3, 3);
//Cuadro 3 Gasolina       Tipo de Ampliación     [*]
$pdf->Rect(134, 180.5, 3, 3);
//Cuadro 4 Peaje          Tipo de Ampliación     [*]
開發者ID:rioyi,項目名稱:admin_estadistica,代碼行數:31,代碼來源:mensual.php

示例13: ucwords

     $productTop = $productTop + $down;
     $endDateTop = $endDateTop + $down;
 }
 /**
  * instantiate variables for printing on barcode from 
  * $testQ query result set
  */
 $product = ucwords(strtolower($row['description']));
 $brand = ucwords(strtolower($row['brand']));
 $nprice = '$' . number_format($row['nprice'], 2);
 $sprice = '$' . number_format($row['sprice'], 2);
 /**
  * begin creating tag
  */
 $pdf->SetLineWidth(0.2);
 $pdf->Rect($x, $y, $w, $h - 4);
 $pdf->Image('peoples_sale_1up.jpg', $x, $y, $w, $h - 4);
 $pdf->SetFont('Arial', '', 11);
 $pdf->SetXY($x, $brandTop);
 $pdf->Cell($w, 8, $brand, 0, 0, 'C');
 // $pdf->SetLineWidth(.4);
 // $pdf->Line($lineStartX, $lineStartY, $lineStopX, $lineStopY);
 $pdf->SetFont('Arial', 'B', 42);
 $pdf->SetXY($priceLeft, $spriceTop);
 // $pdf->Cell($w-25.4,4,'Sale Price',0,0,'L');
 // $pdf->SetXY($priceLeft,$spriceTop);
 $pdf->Cell($w - 25.4, 4, $sprice, 0, 0, 'C');
 $pdf->SetFont('Arial', '', 14);
 $pdf->SetXY($priceLeft, $npriceTop);
 $pdf->Cell($w - 25.4, 4, 'Regular Price  ' . $nprice, 0, 0, 'C');
 // $pdf->SetXY($priceLeft,$npriceTop);
開發者ID:joelbrock,項目名稱:fannie,代碼行數:31,代碼來源:saletags.php

示例14: campo

		
		$totalded = 0;
		$linea = 65;
		while($ren = mysql_fetch_array($res))
		{
			if($ren["tipo"] == "D")
			{
				$pdf->Text(107, $linea, $ren["cve_concepto"] . " " . $ren["concepto"]);
				$pdf->Text(173, $linea, campo(number_format($ren["importe"], 2, ".", ","), 20, 2));
				$totalded += $ren["importe"];
				$linea += 3;
			}
		}
		
		$pdf->SetDrawColor(0,0,0);
		$pdf->Rect(4, 60, 100, 30);
		$pdf->Rect(104, 60, 100, 30);
		
		$pdf->Text(5, 95, "TOTAL DE PERCEPCIONES:");
		$pdf->Text(72, 95, campo(number_format($totalper, 2, ".", ","), 20, 2));
		$pdf->Text(107, 95, "TOTAL DE DEDUCCIONES:");
		$pdf->Text(173, 95, campo(number_format($totalded, 2, ".", ","), 20, 2));
		
		$pdf->Text(107, 100, "NETO A PAGAR:");
		$pdf->Text(173, 100, campo(number_format($totalper - $totalded, 2, ".", ","), 20, 2));
		
		$pdf->SetFont('Arial','',7);
		
		$pdf->Text(107, 108, "Recibí la cantidad indicada que cubre a la fecha todas las percepciones que tengo");
		$pdf->Text(107, 111, "derecho sin que se me adeude cantidad alguna.");
		$pdf->Rect(104, 104, 100, 9);
開發者ID:acronoxine,項目名稱:movimientosSFA_V1,代碼行數:30,代碼來源:pdfrecibos_pre.php

示例15: Rect

 function Rect($x, $y, $w, $h, $style = '', $border_style = null, $fill_color = null)
 {
     if (!(false === strpos($style, 'F')) && $fill_color) {
         list($r, $g, $b) = $fill_color;
         $this->SetFillColor($r, $g, $b);
     }
     switch ($style) {
         case 'F':
             $border_style = null;
             parent::Rect($x, $y, $w, $h, $style);
             break;
         case 'DF':
         case 'FD':
             if (!$border_style || isset($border_style['all'])) {
                 if (isset($border_style['all'])) {
                     $this->SetLineStyle($border_style['all']);
                     $border_style = null;
                 }
             } else {
                 $style = 'F';
             }
             parent::Rect($x, $y, $w, $h, $style);
             break;
         default:
             if (!$border_style || isset($border_style['all'])) {
                 if (isset($border_style['all']) && $border_style['all']) {
                     $this->SetLineStyle($border_style['all']);
                     $border_style = null;
                 }
                 parent::Rect($x, $y, $w, $h, $style);
             }
             break;
     }
     if ($border_style) {
         if (isset($border_style['L']) && $border_style['L']) {
             $this->Line($x, $y, $x, $y + $h, $border_style['L']);
         }
         if (isset($border_style['T']) && $border_style['T']) {
             $this->Line($x, $y, $x + $w, $y, $border_style['T']);
         }
         if (isset($border_style['R']) && $border_style['R']) {
             $this->Line($x + $w, $y, $x + $w, $y + $h, $border_style['R']);
         }
         if (isset($border_style['B']) && $border_style['B']) {
             $this->Line($x, $y + $h, $x + $w, $y + $h, $border_style['B']);
         }
     }
 }
開發者ID:StockersSRL,項目名稱:Lucas,代碼行數:48,代碼來源:draw.php


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