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


PHP Pdf::GetY方法代码示例

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


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

示例1: ubet

 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 public function ubet()
 {
     $this->load->library('pdf');
     $pdf = new Pdf('L', 'mm', 'A4', true, 'UTF-8', false);
     //$pdf->setPrintHeader(false);
     //$pdf->setPrintFooter(false);
     $pdf->SetPrintFooter(false);
     //$pdf->SetAutoPageBreak(true, 9);
     $pdf->SetFont('dejavusans', '', 10);
     //$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     $pdf->AddPage();
     $pdf->SetFillColor(255, 255, 127);
     //$pdf->SetFont('helvetica', 'B', 12);
     //$pdf->getPageDimensions();
     //$hasBorder = false; //flag for fringe case
     $sql = "select customerName,contactLastName,contactFirstName from customers";
     $sqlq = $this->db->query($sql);
     $sqla = $sqlq->result_array();
     //print_r($sqla); //exit();
     $page = 0;
     foreach ($sqla as $row) {
         $maxnocells = 0;
         $cellcount = 0;
         //write text first
         $startX = $pdf->GetX();
         $startY = $pdf->GetY();
         //draw cells and record maximum cellcount
         //cell height is 6 and width is 80
         $cellcount = $pdf->MultiCell(30, 6, $row['customerName'], 0, 'L', 0, 0);
         if ($cellcount > $maxnocells) {
             $maxnocells = $cellcount;
         }
         $cellcount = $pdf->MultiCell(80, 6, $row['contactLastName'], 0, 'L', 0, 0);
         if ($cellcount > $maxnocells) {
             $maxnocells = $cellcount;
         }
         $cellcount = $pdf->MultiCell(80, 6, $row['contactFirstName'], 0, 'L', 0, 0);
         if ($cellcount > $maxnocells) {
             $maxnocells = $cellcount;
         }
         $page++;
         $pdf->SetXY($startX, $startY);
         //if($page>20){
         //$pdf->AddPage();
         //$page=0;
         //}
         //now do borders and fill
         //cell height is 6 times the max number of cells
         $pdf->MultiCell(30, $maxnocells * 6, '', 1, 'L', 0, 0);
         $pdf->MultiCell(80, $maxnocells * 6, '', 1, 'L', 0, 0);
         $pdf->MultiCell(80, $maxnocells * 6, '', 1, 'L', 0, 0);
         $pdf->Ln();
     }
     //$pdf->Cell(240,0,'','T');  //last bottom border
     $pdf->Output('example_005.pdf', 'I');
 }
开发者ID:sururbadrus,项目名称:testing,代码行数:71,代码来源:Welcome.php

示例2: array

 } else {
     $profile_label = mb_convert_encoding($profile_label, 'ISO-8859-1', 'HTML-ENTITIES');
     $profile_data = mb_convert_encoding($profile_data, 'ISO-8859-1', 'HTML-ENTITIES');
     $pdf->SetFont('Helvetica', '', 9);
 }
 $pdf->Cell(30, 6, $profile_label . ":", 1, 0, 'L');
 $pdf->Cell(98, 6, $profile_data, 1, 0, 'L');
 //$pdf->Cell(70,6,"Owner: $query_uid",1,1,'L');
 $pdf->Cell(30, 6, $generated . ":", 1, 0, 'L');
 $pdf->Cell(32, 6, "{$gendate}", 1, 1, 'L');
 //$pdf->Cell(0, 6, "Subnet Description: $sub_desc", 1, 0, 'L');
 #    $pdf->Ln();
 $pdf->SetFont('Helvetica', '', 10);
 //get current possition so we can put the pie chart to the side
 $valX = $pdf->GetX();
 $valY = $pdf->GetY();
 $riskarray = array();
 //array of risks for pie chart
 $colorarray = array();
 //array of colors for pie chart
 //$query = "SELECT DISTINCT hostIP, hostname FROM vuln_nessus_results t1
 //    where report_id='$report_id' $query_host $query_critical order BY hostIP";
 $perms_where = Session::get_ctx_where() != "" ? " AND t1.ctx in (" . Session::get_ctx_where() . ")" : "";
 $query = "SELECT DISTINCT t1.hostip as hostIP, HEX(t1.ctx) as ctx\n             FROM vuln_nessus_results t1\n             where\n             t1.report_id in ({$report_id}) \n             {$query_host}\n             {$query_critical} \n             and falsepositive='N'\n             {$perms_where}\n             order BY hostIP";
 $result = $dbconn->execute($query);
 //initialise variable for number of hosts while loop
 $hosts = array();
 while ($row = $result->fields) {
     if (Session::hostAllowed_by_ip_ctx($dbconn, $row['hostIP'], $row['ctx'])) {
         $host_id = key(Asset_host::get_id_by_ips($dbconn, $row['hostIP'], $row['ctx']));
         if (valid_hex32($host_id)) {
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:respdf.php


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