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


PHP TCPDF::SetFillColor方法代碼示例

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


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

示例1: testPdfOutput

 public function testPdfOutput()
 {
     // create new PDF document
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 017');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 017', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // set some language-dependent strings (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', '', 20);
     // add a page
     $pdf->AddPage();
     $pdf->Write(0, 'Example of independent Multicell() columns', '', 0, 'L', true, 0, false, false, 0);
     $pdf->Ln(5);
     $pdf->SetFont('times', '', 12);
     // create columns content
     // create columns content
     $left_column = '[LEFT COLUMN] left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column' . "\n";
     $right_column = '[RIGHT COLUMN] right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column' . "\n";
     // MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
     // set color for background
     $pdf->SetFillColor(255, 255, 200);
     // set color for text
     $pdf->SetTextColor(0, 63, 127);
     // write the first column
     $pdf->MultiCell(80, 0, $left_column, 1, 'J', 1, 0, '', '', true, 0, false, true, 0);
     // set color for background
     $pdf->SetFillColor(215, 235, 255);
     // set color for text
     $pdf->SetTextColor(127, 31, 0);
     // write the second column
     $pdf->MultiCell(80, 0, $right_column, 1, 'J', 1, 1, '', '', true, 0, false, true, 0);
     // reset pointer to the last page
     $pdf->lastPage();
     $this->comparePdfs($pdf);
 }
開發者ID:fooman,項目名稱:tcpdf,代碼行數:56,代碼來源:Example017Test.php

示例2: testPdfOutput

 public function testPdfOutput()
 {
     // create new PDF document
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 035');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 035', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // set some language-dependent strings (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('times', 'BI', 16);
     // add a page
     $pdf->AddPage();
     $pdf->Write(0, 'Example of SetLineStyle() method', '', 0, 'L', true, 0, false, false, 0);
     $pdf->Ln();
     $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 4, 'color' => array(255, 0, 0)));
     $pdf->SetFillColor(255, 255, 128);
     $pdf->SetTextColor(0, 0, 128);
     $text = "DUMMY";
     $pdf->Cell(0, 0, $text, 1, 1, 'L', 1, 0);
     $pdf->Ln();
     $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 255)));
     $pdf->SetFillColor(255, 255, 0);
     $pdf->SetTextColor(0, 0, 255);
     $pdf->MultiCell(60, 4, $text, 1, 'C', 1, 0);
     $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 255, 0)));
     $pdf->SetFillColor(0, 0, 255);
     $pdf->SetTextColor(255, 255, 0);
     $pdf->MultiCell(60, 4, $text, 'TB', 'C', 1, 0);
     $pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 255)));
     $pdf->SetFillColor(0, 255, 0);
     $pdf->SetTextColor(255, 0, 255);
     $pdf->MultiCell(60, 4, $text, 1, 'C', 1, 1);
     $this->comparePdfs($pdf);
 }
開發者ID:fooman,項目名稱:tcpdf,代碼行數:54,代碼來源:Example035Test.php

示例3: testPdfOutput

 public function testPdfOutput()
 {
     // create new PDF document
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 031');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 031', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // set some language-dependent strings (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', 'B', 20);
     // add a page
     $pdf->AddPage();
     $pdf->Write(0, 'Example of PieSector() method.');
     $xc = 105;
     $yc = 100;
     $r = 50;
     $pdf->SetFillColor(0, 0, 255);
     $pdf->PieSector($xc, $yc, $r, 20, 120, 'FD', false, 0, 2);
     $pdf->SetFillColor(0, 255, 0);
     $pdf->PieSector($xc, $yc, $r, 120, 250, 'FD', false, 0, 2);
     $pdf->SetFillColor(255, 0, 0);
     $pdf->PieSector($xc, $yc, $r, 250, 20, 'FD', false, 0, 2);
     // write labels
     $pdf->SetTextColor(255, 255, 255);
     $pdf->Text(105, 65, 'BLUE');
     $pdf->Text(60, 95, 'GREEN');
     $pdf->Text(120, 115, 'RED');
     $this->comparePdfs($pdf);
 }
開發者ID:fooman,項目名稱:tcpdf,代碼行數:49,代碼來源:Example031Test.php

示例4: testPdfOutput

    public function testPdfOutput()
    {
        // create new PDF document
        $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, false, 'ISO-8859-1', false);
        // Set document information dictionary in unicode mode
        $pdf->SetDocInfoUnicode(true);
        // set document information
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor('Nicola Asuni [€]');
        $pdf->SetTitle('TCPDF Example 019');
        $pdf->SetSubject('TCPDF Tutorial');
        $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
        // set default header data
        $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 019', PDF_HEADER_STRING);
        // set header and footer fonts
        $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
        $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
        // set default monospaced font
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
        // set margins
        $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
        $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
        $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
        // set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
        // set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        // set some language dependent data:
        $lg = array();
        $lg['a_meta_charset'] = 'ISO-8859-1';
        $lg['a_meta_dir'] = 'ltr';
        $lg['a_meta_language'] = 'en';
        $lg['w_page'] = 'page';
        // set some language-dependent strings (optional)
        $pdf->setLanguageArray($lg);
        // ---------------------------------------------------------
        // set font
        $pdf->SetFont('helvetica', '', 12);
        // add a page
        $pdf->AddPage();
        // set color for background
        $pdf->SetFillColor(200, 255, 200);
        $txt = 'An alternative configuration file is used on this example.
Check the definition of the K_TCPDF_EXTERNAL_CONFIG constant on the source code.';
        // print some text
        $pdf->MultiCell(0, 0, $txt . "\n", 1, 'J', 1, 1, '', '', true, 0, false, true, 0);
        $this->comparePdfs($pdf);
    }
開發者ID:fooman,項目名稱:tcpdf,代碼行數:48,代碼來源:Example019Test.php

示例5: initialize_pdf

 /**
  * Sets up a new PDF object with the necessary settings
  *
  * @return  FPDF            A new PDF object
  */
 protected function initialize_pdf()
 {
     global $CFG;
     require_once $CFG->dirroot . '/local/elisreports/lib/tcpdf/tcpdf.php';
     $newpdf = new TCPDF('L', 'in', 'letter');
     //prevent the library from automatically outputting
     //header or footer bars
     $newpdf->SetPrintHeader(false);
     $newpdf->SetPrintFooter(false);
     $newpdf->setMargins(self::marginx, self::marginy);
     $newpdf->SetFont('freesans', '', 9);
     $newpdf->AddPage();
     $newpdf->SetFont('freesans', '', 16);
     $newpdf->MultiCell(0, 0.2, $this->report->title, 0, 'C');
     $newpdf->Ln(0.2);
     $newpdf->SetFont('freesans', '', 8);
     $newpdf->SetFillColor(225, 225, 225);
     return $newpdf;
 }
開發者ID:jamesmcq,項目名稱:elis,代碼行數:24,代碼來源:php_report_export_pdf.class.php

示例6: fontSet

 /**
  * Init the PDF Font
  *
  * @access public
  */
 public function fontSet()
 {
     $family = strtolower($this->value['font-family']);
     $b = $this->value['font-bold'] ? 'B' : '';
     $i = $this->value['font-italic'] ? 'I' : '';
     $u = $this->value['font-underline'] ? 'U' : '';
     $d = $this->value['font-linethrough'] ? 'D' : '';
     $o = $this->value['font-overline'] ? 'O' : '';
     // font style
     $style = $b . $i;
     if ($this->_defaultFont) {
         if ($family == 'arial') {
             $family = 'helvetica';
         } elseif ($family == 'symbol' || $family == 'zapfdingbats') {
             $style = '';
         }
         $fontkey = $family . $style;
         if (!$this->_pdf->isLoadedFont($fontkey)) {
             $family = $this->_defaultFont;
         }
     }
     if ($family == 'arial') {
         $family = 'helvetica';
     } elseif ($family == 'symbol' || $family == 'zapfdingbats') {
         $style = '';
     }
     // complete style
     $style .= $u . $d . $o;
     // size : mm => pt
     $size = $this->value['font-size'];
     $size = 72 * $size / 25.4;
     // apply the font
     $this->_pdf->SetFont($family, $style, $this->value['mini-size'] * $size);
     $this->_pdf->SetTextColorArray($this->value['color']);
     if ($this->value['background']['color']) {
         $this->_pdf->SetFillColorArray($this->value['background']['color']);
     } else {
         $this->_pdf->SetFillColor(255);
     }
 }
開發者ID:p21sistemas,項目名稱:PdfTools,代碼行數:45,代碼來源:parsingCss.class.php

示例7: generateFacilityInventoryReport

function generateFacilityInventoryReport($conn)
{
    global $gTEXT;
    require_once 'tcpdf/tcpdf.php';
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    $pdf->setFontSubsetting(false);
    $pdf->AddPage();
    $pdf->SetFillColor(255, 255, 255);
    //=====================================================Facility Inventory Table=======================================================
    $MonthId = $_REQUEST['MonthId'];
    $YearId = $_REQUEST['YearId'];
    $mosTypeId = $_REQUEST['MosTypeId'];
    $countryId = $_REQUEST['CountryId'];
    $fLevelId = $_REQUEST['FLevelId'];
    $FacilityId = $_REQUEST['FacilityId'];
    $ItemGroupId = $_REQUEST['ItemGroupId'];
    $regionId = $_REQUEST['RegionId'];
    $districtId = $_REQUEST['DistrictId'];
    $ownerTypeId = $_REQUEST['OwnerTypeId'];
    $region = $_REQUEST['Region'];
    $district = $_REQUEST['District'];
    $ownerType = $_REQUEST['OwnerType'];
    $year = $_REQUEST['Year'];
    $CountryName = $_REQUEST['CountryName'];
    $monthName = $_REQUEST['MonthName'];
    $ItemGroupName = $_REQUEST['ItemGroupName'];
    $FacilityName = $_REQUEST['FacilityName'];
    $lan = $_REQUEST['lan'];
    if ($lan == 'en-GB') {
        $SITETITLE = SITETITLEENG;
    } else {
        $SITETITLE = SITETITLEFRN;
    }
    $column_name = array();
    $sQuery1 = "SELECT\n\t\t\t    MosTypeId\n\t\t\t    , MosTypeName\n\t\t\t    , ColorCode\n\t\t\tFROM\n\t\t\t    t_mostype_facility\n\t\t\tWHERE CountryId = {$countryId} AND FLevelId = {$fLevelId}  AND (MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0)\n\t\t\tORDER BY MosTypeId;";
    $rResult1 = mysql_query($sQuery1);
    $output1 = array();
    $col = '';
    while ($row1 = mysql_fetch_array($rResult1)) {
        $output1[] = $row1;
        array_push($column_name, $row1['MosTypeName']);
    }
    $col .= '<tr><th width="180" align="left"><b>' . $gTEXT['Product Name'] . '</b></th>';
    $col .= '<th width="60" align="left"><b>' . $gTEXT['Closing Balance'] . '</b></th>';
    $col .= '<th width="45" align="left"><b>' . $gTEXT['AMC'] . '</b></th>';
    $col .= '<th width="40" align="left"><b>' . $gTEXT['MOS'] . '</b></th>';
    $f = 0;
    for ($f = 0; $f < count($output1); $f++) {
        $col .= '<th width="70" align="right"><b>' . $column_name[$f] . '</b></th>';
    }
    $col .= '</tr>';
    /*
    	$sQuery = "SELECT p.MosTypeId, ItemName, MOS FROM (SELECT
    				    a.ItemNo
    				    , b.ItemName
    				    , a.MOS
    				,(SELECT MosTypeId FROM t_mostype_facility x WHERE CountryId = $countryId AND FLevelId = $fLevelId  AND (MosTypeId = $mosTypeId OR $mosTypeId = 0) AND a.MOS >= x.MinMos AND a.MOS < x.MaxMos) MosTypeId
    				FROM t_cfm_stockstatus a, t_itemlist b,  t_cfm_masterstockstatus c
    				WHERE a.itemno = b.itemno AND a.MOS IS NOT NULL AND a.MonthId = " . $_REQUEST['MonthId'] . " AND a.Year = '" . $_REQUEST['YearId'] . "' AND a.CountryId = " . $_REQUEST['CountryId'] . " AND a.FacilityId = " . $_REQUEST['FacilityId'] . " AND a.ItemGroupId = " . $_REQUEST['ItemGroupId'] . " AND a.CFMStockId = c.CFMStockId" . " AND c.StatusId = 5 " . ") p
    				WHERE (p.MosTypeId = $mosTypeId OR $mosTypeId = 0) 
    				ORDER BY ItemName";
    */
    if ($ownerTypeId == 1 || $ownerTypeId == 2) {
        $sQuery = "SELECT p.MosTypeId, ItemName, MOS ,ClStock,AMC FROM (SELECT\n\t\t\t\t    a.ItemNo, b.ItemName, a.MOS ,a.ClStock,a.AMC\n\t\t\t\t,(SELECT MosTypeId FROM t_mostype_facility x WHERE CountryId = {$countryId} \n                AND FLevelId = {$fLevelId}  AND (MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0) \n                AND a.MOS >= x.MinMos AND a.MOS < x.MaxMos ) MosTypeId\n\t\t\t\tFROM t_cfm_stockstatus a, t_itemlist b,  t_cfm_masterstockstatus c, t_facility g\n\t\t\t\tWHERE a.itemno = b.itemno AND a.MOS IS NOT NULL AND a.MonthId = " . $MonthId . " \n                AND a.Year = '" . $YearId . "' AND a.CountryId = " . $countryId . " \n                AND a.FacilityId = " . $FacilityId . " AND a.ItemGroupId = " . $ItemGroupId . "\n                AND a.CFMStockId = c.CFMStockId" . " AND c.StatusId = 5 " . "\n                AND a.FacilityId=g.FacilityId \n                AND g.OwnerTypeId = {$ownerTypeId} \n                AND  (g.RegionId = {$regionId} OR {$regionId} = 0)\n                AND (g.DistrictId = {$districtId} OR {$districtId} = 0)\n                 ) p\n                \n\t\t\t\tWHERE (p.MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0) \n\t\t\t\tORDER BY ItemName";
    } else {
        $sQuery = "SELECT p.MosTypeId, ItemName, MOS ,ClStock,AMC FROM (SELECT\n\t\t\t\t    a.ItemNo, b.ItemName, a.MOS ,a.ClStock,a.AMC\n\t\t\t\t,(SELECT MosTypeId FROM t_mostype_facility x WHERE CountryId = {$countryId} \n                AND FLevelId = {$fLevelId}  AND (MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0) \n                AND a.MOS >= x.MinMos AND a.MOS < x.MaxMos ) MosTypeId\n\t\t\t\tFROM t_cfm_stockstatus a, t_itemlist b,  t_cfm_masterstockstatus c, t_facility g\n\t\t\t\tWHERE a.itemno = b.itemno AND a.MOS IS NOT NULL AND a.MonthId = " . $MonthId . " \n                AND a.Year = '" . $YearId . "' AND a.CountryId = " . $countryId . " \n                AND a.FacilityId = " . $FacilityId . " AND a.ItemGroupId = " . $ItemGroupId . "\n                AND a.CFMStockId = c.CFMStockId" . " AND c.StatusId = 5 " . "\n                AND a.FacilityId=g.FacilityId\n                AND g.AgentType = {$ownerTypeId} \n                AND  (g.RegionId = {$regionId} OR {$regionId} = 0)\n                AND (g.DistrictId = {$districtId} OR {$districtId} = 0) ) p\n                \n\t\t\t\tWHERE (p.MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0) \n\t\t\t\tORDER BY ItemName";
    }
    //echo $sQuery;
    mysql_query("SET character_set_results=utf8");
    $rResult = mysql_query($sQuery);
    $aData = array();
    $total = mysql_num_rows($rResult);
    if ($total > 0) {
        while ($row = mysql_fetch_array($rResult)) {
            $tmpRow = array();
            /*	foreach ($output1 as $rowMosType) {
            			if ($rowMosType['MosTypeId'] == $row['MosTypeId']) {
            				//$tmpRow[] = '<span class="glyphicon glyphicon-ok-circle" style="color:' . $rowMosType['ColorCode'] . ';font-size:2em;"></span>';
            				$tmpRow[] = '<i class="fa fa-check-circle fa-lg" style="color:' . $rowMosType['ColorCode'] . ';font-size:2.5em;"></i>';
            
            			} else
            				$tmpRow[] = '';
            		}
            		array_unshift($tmpRow, $row['ItemName'], number_format($row['MOS'], 1));
            		$aData[] = $tmpRow;*/
            $col .= '<tr style="page-break-inside:avoid;">
			           <td>' . $row['ItemName'] . '</td>
					   <td>' . $row['ClStock'] . '</td>
					   <td>' . $row['AMC'] . '</td>
//.........這裏部分代碼省略.........
開發者ID:sankam-nikolya,項目名稱:lptt,代碼行數:101,代碼來源:r_facility_inventory_control_pdf.php

示例8: testPdfOutput

 public function testPdfOutput()
 {
     // create new PDF document
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 022');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 022', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // set some language-dependent strings (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     // check also the following methods:
     // SetDrawColorArray()
     // SetFillColorArray()
     // SetTextColorArray()
     // set font
     $pdf->SetFont('helvetica', 'B', 18);
     // add a page
     $pdf->AddPage();
     $pdf->Write(0, 'Example of CMYK, RGB and Grayscale colours', '', 0, 'L', true, 0, false, false, 0);
     // define style for border
     $border_style = array('all' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'phase' => 0));
     // --- CMYK ------------------------------------------------
     $pdf->SetDrawColor(50, 0, 0, 0);
     $pdf->SetFillColor(100, 0, 0, 0);
     $pdf->SetTextColor(100, 0, 0, 0);
     $pdf->Rect(30, 60, 30, 30, 'DF', $border_style);
     $pdf->Text(30, 92, 'Cyan');
     $pdf->SetDrawColor(0, 50, 0, 0);
     $pdf->SetFillColor(0, 100, 0, 0);
     $pdf->SetTextColor(0, 100, 0, 0);
     $pdf->Rect(70, 60, 30, 30, 'DF', $border_style);
     $pdf->Text(70, 92, 'Magenta');
     $pdf->SetDrawColor(0, 0, 50, 0);
     $pdf->SetFillColor(0, 0, 100, 0);
     $pdf->SetTextColor(0, 0, 100, 0);
     $pdf->Rect(110, 60, 30, 30, 'DF', $border_style);
     $pdf->Text(110, 92, 'Yellow');
     $pdf->SetDrawColor(0, 0, 0, 50);
     $pdf->SetFillColor(0, 0, 0, 100);
     $pdf->SetTextColor(0, 0, 0, 100);
     $pdf->Rect(150, 60, 30, 30, 'DF', $border_style);
     $pdf->Text(150, 92, 'Black');
     // --- RGB -------------------------------------------------
     $pdf->SetDrawColor(255, 127, 127);
     $pdf->SetFillColor(255, 0, 0);
     $pdf->SetTextColor(255, 0, 0);
     $pdf->Rect(30, 110, 30, 30, 'DF', $border_style);
     $pdf->Text(30, 142, 'Red');
     $pdf->SetDrawColor(127, 255, 127);
     $pdf->SetFillColor(0, 255, 0);
     $pdf->SetTextColor(0, 255, 0);
     $pdf->Rect(70, 110, 30, 30, 'DF', $border_style);
     $pdf->Text(70, 142, 'Green');
     $pdf->SetDrawColor(127, 127, 255);
     $pdf->SetFillColor(0, 0, 255);
     $pdf->SetTextColor(0, 0, 255);
     $pdf->Rect(110, 110, 30, 30, 'DF', $border_style);
     $pdf->Text(110, 142, 'Blue');
     // --- GRAY ------------------------------------------------
     $pdf->SetDrawColor(191);
     $pdf->SetFillColor(127);
     $pdf->SetTextColor(127);
     $pdf->Rect(30, 160, 30, 30, 'DF', $border_style);
     $pdf->Text(30, 192, 'Gray');
     $this->comparePdfs($pdf);
 }
開發者ID:fooman,項目名稱:tcpdf,代碼行數:84,代碼來源:Example022Test.php

示例9: showPdf

function showPdf($idReg = "")
{
    global $db;
    // Oficina
    $sesIdOficina = $_SESSION[sesIdOficina];
    $oficina = getValueTable("oficina", "OFICINA", "id_oficina", $sesIdOficina);
    // create new PDF document
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'LETTER', false, 'ISO-8859-1', false);
    // set document information
    $pdf->SetCreator(PDF_CREATOR);
    $pdf->SetAuthor('Nicola Asuni');
    $pdf->SetTitle('TCPDF Example 009');
    $pdf->SetSubject('TCPDF Tutorial');
    $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // set default header data
    //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 009', PDF_HEADER_STRING);
    // set header and footer fonts
    //$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    // set default monospaced font
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    //set margins
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    //$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    // $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    // $pdf->SetFooterMargin(3);
    $pdf->setPageOrientation('P', '', 1);
    //set auto page breaks
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    //set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    //set some language-dependent strings
    //$pdf->setLanguageArray($l);
    // set some language dependent data:
    $lg = array();
    $lg['a_meta_charset'] = 'ISO-8859-1';
    $lg['a_meta_dir'] = 'ltr';
    $lg['a_meta_language'] = 'en';
    $lg['w_page'] = 'page';
    //set some language-dependent strings
    $pdf->setLanguageArray($lg);
    // -------------------------------
    // CONSULTA DE DATOS
    // -------------------------------
    $sql = "select * from PENSION where id_pension='{$idReg}'";
    $db->query($sql);
    while ($db->next_record()) {
        $noRecibo = $db->f(id_pension);
        $entFec = $db->f(ent_fec);
        $salFec = $db->f(sal_fec);
        $idConte = $db->f(id_contenedor);
        $conte = getValueTable("numero", "CONTENEDOR", "id_contenedor", $idConte);
        $idEq = getValueTable("id_equipo", "CONTENEDOR", "id_contenedor", $idConte);
        $equipo = getValueTable("equipo", "EQUIPO", "id_equipo", $idEq);
        $concepto = $db->f(concepto);
        $operador = $db->f(operador);
        $placas = $db->f(placas);
        $monto = $db->f(monto);
        $montoLetra = traducirCifra($monto);
        $idOficina = $db->f(id_oficina);
        $transporte = $db->f(transporte);
        $metPago = $db->f(met_pago);
    }
    // ---------------------------------------------------------
    // DATOS DEL RECIBO
    // ---------------------------------------------------------
    $datoRecibo = "\n\n    <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">    \n    <tr>\n    <td colspan=\"4\" valign=\"middle\"><b>DEPOSITO DE CONTENEDORES TMA</b></td>\n    <td>\n    <table cellspacing=\"1\" cellpadding=\"2\" border=\"0\" align=\"center\">    \n    <tr>\n    <td bgcolor=\"black\"><b><font color=\"white\">FOLIO</font></b></td>\n    </tr>\n    <tr>\n    <td><font color=\"red\"><b>No. {$noRecibo}</b></font></td>\n    </tr>\n    </table>\n    </td>\n    </tr>    \n    <tr>\n    <td><b>ENTRADA</b></td>\n    <td><b>SALIDA</b></td>                \n    <td><b>TRANSPORTE</b></td>\n    <td><b>CONTENEDOR</b></td>\n    <td><b>TIPO</b></td>\n    </tr>\n    <tr>\n    <td>{$entFec}</td>        \n    <td>{$salFec}</td>\n    <td>{$transporte}</td>\n    <td>{$conte}</td>\n    <td>{$equipo}</td>\n    </tr>    \n    <tr>            \n    <td colspan=\"2\"><b>OPERADOR</b></td>        \n    <td><b>PLACAS</b></td>            \n    <td colspan=\"2\"><b>OBSERVACIONES</b></td>        \n    </tr>             \n    <tr>                \n    <td colspan=\"2\">{$operador}</td>\n    <td>{$placas}</td> \n    <td colspan=\"2\">{$nota}</td>               \n    </tr>\n    </table>\n    <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">\n    <tr>\n    <td ><b>FIRMA OPERADOR</b></td>\n    <td ><b>FIRMA DEL DEPOSITO</b></td>\n    <td>\n    <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">\n    <tr>\n    <td align=\"right\"><b>{$concepto} \$</b></td>\n    <td align=\"right\">{$monto}</td>\n    </tr>                                \n    <tr>\n    <td align=\"right\"><b>SUBTOTAL \$</b></td>\n    <td align=\"right\">{$monto}</td>\n    </tr>                                \n    <tr>\n    <td align=\"right\"><b>TOTAL \$</b></td>\n    <td align=\"right\">{$monto}</td>\n    </tr>                                \n    </table>\n    </td>\n    </tr>\n    <tr>\n    <td colspan=\"3\" align=\"center\">\n    RECIBIMOS DE <u>{$operador}</u> LA CANTIDAD DE {$montoLetra} PESOS M.N. 00/100<br> \n    <b>Metodo de pago :</b> {$metPago}<br>\n    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>\n    EMISION DE FACTURA DENTRO DE LOS 5 DIAS POSTERIORES A LA REALIZACIÓN DE SU SERVICIO<br>\n    PASADO ESTE TIEMPO NO HABRÁ EMISIÓN DE FACTURAS.<br>\n    Solicitarla al correo: facturacionpatios@demo.com.mx<br>\n    </td>\n    </tr>\n    </table> \n\n    <br><br><br><br><br><br>\n    <center>---------------------------------- RECIBO PARA VIGILANCIA ---------------------------------- </center>            \n    <br><br><br><br><br>\n\n    <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">    \n    <tr>\n    <td colspan=\"4\" valign=\"middle\"><b>DEPOSITO DE CONTENEDORES</b></td>\n    <td>\n    <table cellspacing=\"1\" cellpadding=\"2\" border=\"0\" align=\"center\">    \n    <tr>\n    <td bgcolor=\"black\"><b><font color=\"white\">FOLIO</font></b></td>\n    </tr>\n    <tr>\n    <td><font color=\"red\"><b>No. {$noRecibo}</b></font></td>\n    </tr>\n    </table>\n    </td>\n    </tr>    \n    <tr>\n    <td><b>ENTRADA</b></td>\n    <td><b>SALIDA</b></td>                \n    <td><b>TRANSPORTE</b></td>\n    <td><b>CONTENEDOR</b></td>\n    <td><b>TIPO</b></td>\n    </tr>\n    <tr>\n    <td>{$entFec}</td>        \n    <td>{$salFec}</td>\n    <td>{$transporte}</td>\n    <td>{$conte}</td>\n    <td>{$equipo}</td>\n    </tr>    \n    <tr>            \n    <td colspan=\"2\"><b>OPERADOR</b></td>        \n    <td><b>PLACAS</b></td>            \n    <td colspan=\"2\"><b>OBSERVACIONES</b></td>        \n    </tr>             \n    <tr>                \n    <td colspan=\"2\">{$operador}</td>\n    <td>{$placas}</td> \n    <td colspan=\"2\">{$nota}</td>               \n    </tr>\n    </table>\n    <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">\n    <tr>\n    <td ><b>FIRMA OPERADOR</b></td>\n    <td ><b>FIRMA DEL DEPOSITO</b></td>\n    <td>\n    <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">\n    <tr>\n    <td align=\"right\"><b>{$concepto} \$</b></td>\n    <td align=\"right\">{$monto}</td>\n    </tr>                                \n    <tr>\n    <td align=\"right\"><b>SUBTOTAL \$</b></td>\n    <td align=\"right\">{$monto}</td>\n    </tr>                                \n    <tr>\n    <td align=\"right\"><b>TOTAL \$</b></td>\n    <td align=\"right\">{$monto}</td>\n    </tr>                                \n    </table>\n    </td>\n    </tr>\n    <tr>\n    <td colspan=\"3\" align=\"center\">\n    RECIBIMOS DE <u>{$operador}</u> LA CANTIDAD DE {$montoLetra} PESOS M.N. 00/100 <br>\n    <b>Metodo de pago :</b> {$metPago}<br>\n    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>\n    EMISION DE FACTURA DENTRO DE LOS 5 DIAS POSTERIORES A LA REALIZACIÓN DE SU SERVICIO<br>\n    PASADO ESTE TIEMPO NO HABRÁ EMISIÓN DE FACTURAS.<br>\n    Solicitarla al correo: facturacionpatios@demo.com.mx<br>\n    </td>\n    </tr>\n    </table> \n\n    ";
    // -------------------------------------------------------------------
    $pdf->AddPage();
    // Logo
    $pdf->setJPEGQuality(100);
    $pdf->Image('../images/logo_color.jpg', 13, 4, 25, 25, '', '', '', false);
    //$pdf->Image('../images/nome.jpg', 15, 140, 185, 96,'','','',false);
    // set cell padding
    //$pdf->setCellPaddings(1, 1, 1, 1);
    // set cell margins
    //$pdf->setCellMargins(1, 1, 1, 1);
    // Encabezado
    $pdf->SetFillColor(197, 197, 197);
    if ($idOficina == 1) {
        $txt = "ALMARTCON S.A. DE C.V.\n\"El Trébol\"";
        $pdf->SetFont('helvetica', '', 14);
        $pdf->MultiCell(65, 4, $txt, 0, 'L', 0, 0, 40, 10, true);
        $txt = "Direccion, Guatemala \\Tel. 505-2350-0976 Cel. 505-8635-0708";
        $pdf->SetFont('helvetica', '', 7);
        $pdf->MultiCell(60, 4, $txt, 0, 'C', 0, 0, 105, 10, true);
    }
    /*    elseif( $idOficina==2 ){
            $txt = "ALMARTCON S.A DE C.V.\n\"El Arbol\"";
            $pdf->SetFont('helvetica', '', 14);
            $pdf->MultiCell(65, 4,$txt, 0, 'L',0, 0, 40, 10,true);            
            $txt="Av. Refinería Azcapotzalco S/N \nEsq. Ferrocarriles Nacionales.\nMéxico D.F.";
            $pdf->SetFont('helvetica', '', 7);
            $pdf->MultiCell(60, 4,$txt, 0, 'C',0, 0, 105, 10,true);
        }
        elseif( $idOficina==3 ){
            $txt = "TRANSPORTES MALEJA S.A DE C.V.\n\"El Pino\"";
            $pdf->SetFont('helvetica', '', 14);
            $pdf->MultiCell(65, 4,$txt, 0, 'L',0, 0, 40, 10,true);            
            $txt="Carretera Querétaro San Luis Potosí Km.28\nCol.Buenavista Santa Rosa Jauregui\nQueretaro, QRO.";
//.........這裏部分代碼省略.........
開發者ID:nesmaster,項目名稱:anakosta,代碼行數:101,代碼來源:penPdf.php

示例10: Cell

$pdf->SetFont('helvetica', '', 10);
$pdf->setCellHeightRatio(1.25);
$pdf->MultiCell(0, 0, $legend, 0, 'L', false, 1, 125, 160, true, 0, false, true, 0, 'T', false);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// CELL BORDERS
// add a page
$pdf->AddPage();
$pdf->SetFont('helvetica', 'B', 20);
$pdf->Write(0, 'Example of borders for Cell()', '', 0, 'L', true, 0, false, false, 0);
$pdf->SetFont('helvetica', '', 11);
// set border width
$pdf->SetLineWidth(0.508);
// set color for cell border
$pdf->SetDrawColor(0, 128, 255);
// set filling color
$pdf->SetFillColor(255, 255, 128);
// set cell height ratio
$pdf->setCellHeightRatio(3);
$pdf->Cell(30, 0, '1', 1, 1, 'C', 1, '', 0, false, 'T', 'C');
$pdf->Ln(2);
$pdf->Cell(30, 0, 'LTRB', 'LTRB', 1, 'C', 1, '', 0, false, 'T', 'C');
$pdf->Ln(2);
$pdf->Cell(30, 0, 'LTR', 'LTR', 1, 'C', 1, '', 0, false, 'T', 'C');
$pdf->Ln(2);
$pdf->Cell(30, 0, 'TRB', 'TRB', 1, 'C', 1, '', 0, false, 'T', 'C');
$pdf->Ln(2);
$pdf->Cell(30, 0, 'LRB', 'LRB', 1, 'C', 1, '', 0, false, 'T', 'C');
$pdf->Ln(2);
$pdf->Cell(30, 0, 'LTB', 'LTB', 1, 'C', 1, '', 0, false, 'T', 'C');
$pdf->Ln(2);
$pdf->Cell(30, 0, 'LT', 'LT', 1, 'C', 1, '', 0, false, 'T', 'C');
開發者ID:hcvcastro,項目名稱:pxp,代碼行數:31,代碼來源:example_057.php

示例11: if

$pdf->setJPEGQuality(75);

// Image method signature:
// Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)

// set font
$pdf->SetFont(mydeffont, '', 11, '', true);

// set cell padding
$pdf->setCellPaddings(0, 0, 0, 0.5); //$left='', $top='', $right='', $bottom='')

// set cell margins
$pdf->setCellMargins(0, 0, 0, 0);

// set color for background
$pdf->SetFillColor(255, 255, 255);

// 1. Parameter: sesuaikan dg parameter di Page Selection Bar >> Edit
$cid=gets('token');
$lap_cetak=gets('lap_cetak',0);
$lap_tglcetak=gets('lap_tglcetak',0);
$lap_sum=gets('lap_sum',0);

// 2. Queries: samakan dg Query >> Edit
$t=mysql_query("SELECT * FROM pus_stockhist WHERE replid='$cid'");
$data_so=mysql_fetch_array($t);
$tbl="joshso.".$data_so['tabel'];
if($lap_cetak==0) $fl="";
else if($lap_cetak==1) $fl=" WHERE ".$tbl.".cek='Y'";
else if($lap_cetak==2) $fl=" WHERE ".$tbl.".cek='N'";
else if($lap_cetak==3) $fl=" WHERE ".$tbl.".cek='N' AND ".$tbl.".note<>''";
開發者ID:nickohappy7,項目名稱:sister,代碼行數:31,代碼來源:stocktake.php

示例12: pdf

function pdf($html = null, $logo = null, $nombre = null, $estadistica, $itiniere, $transporte)
{
    //$html= utf8_decode($html);
    //    $html="OOOJHKJHKJH JLH KJH KH KJH";
    ob_clean();
    // create new PDF document
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, array(210, 272), true, 'UTF-8', false);
    //    $pdf = new TCPDF('P', 'IN', array (8.5,11),true, 'UTF-8', false);
    // set document information
    //$pdf->SetCreator(PDF_CREATOR);
    //$pdf->SetAuthor('Nicola Asuni');
    //$pdf->SetTitle('TCPDF Example 001');
    //$pdf->SetSubject('TCPDF Tutorial');
    //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // set default header data
    //$pdf->SetHeaderData($logo, '20', PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
    if (!empty($logo)) {
        $pdf->SetHeaderData($logo, '20', '', '      PLAN ESTRATEGICO DE SEGURIDAD VÍAL       ' . date('d/m/Y'), array(0, 64, 128), array(0, 64, 128));
    }
    $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
    // set header and footer fonts
    //    $pdf->SetMargins(23, 35, 13);
    $pdf->SetMargins(32, 35, 20);
    $pdf->SetHeaderMargin(14);
    $pdf->SetFooterMargin(21);
    $pdf->SetAutoPageBreak(TRUE, 20);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    //$pdf->setLanguageArray($l);
    $pdf->setFontSubsetting(false);
    $pdf->SetFont('dejavusans', '', 10, '', true);
    //$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', '6'));
    $pdf->AddPage();
    $pdf->writeHTML($html, true, false, true, false, '');
    //    $pdf->AddPage();
    $pdf->SetFillColor(0, 0, 0);
    $pdf->Write(10, '                                                                  ARL');
    //    echo $estadistica[0]->arlnula;die;
    //   GRAFICA No 1
    $xc = $estadistica[0]->arlnula;
    $yc = $estadistica[0]->arlsi;
    $r = $estadistica[0]->arlno;
    //echo "<pre>";
    //    var_dump($estadistica);die();
    $total = $xc + $yc + $r;
    $r1 = $xc * 360 / $total;
    $r2 = $yc * 360 / $total;
    $r3 = $r * 360 / $total;
    $r1 = round($r1);
    $r2 = round($r2);
    $r3 = round($r3);
    $xc1 = 105;
    $yc1 = 120;
    $r11 = 50;
    $pdf->SetFillColor(0, 0, 255);
    $pdf->PieSector($xc1, $yc1, $r11, 0, $r1, 'FD', false, 0, 2);
    $pdf->SetFillColor(0, 255, 0);
    $pdf->PieSector($xc1, $yc1, $r11, $r1, $r2 + $r1, 'FD', false, 0, 2);
    $pdf->SetFillColor(255, 0, 0);
    $pdf->PieSector($xc1, $yc1, $r11, $r2 + $r1, 0, 'FD', false, 0, 2);
    $pdf->SetTextColor(0, 0, 255);
    $pdf->Text(150, 150, 'NO CONTESTADAS: ' . $xc);
    $pdf->SetTextColor(0, 255, 0);
    $pdf->Text(150, 155, 'SI: ' . $yc);
    $pdf->SetTextColor(255, 0, 0);
    $pdf->Text(150, 160, 'NO: ' . $r);
    $pdf->AddPage();
    //----------------------------------------------------------------
    //   GRAFICA No 2
    $pdf->SetTextColor(0, 0, 0);
    $pdf->Write(10, '                                                             PENSION');
    $xc = $estadistica[0]->pensionnula;
    $yc = $estadistica[0]->pensionsi;
    $r = $estadistica[0]->pensionno;
    $total = $xc + $yc + $r;
    $r1 = $xc * 360 / $total;
    $r2 = $yc * 360 / $total;
    $r3 = $r * 360 / $total;
    $r1 = round($r1);
    $r2 = round($r2);
    $r3 = round($r3);
    $xc1 = 105;
    $yc1 = 100;
    $r11 = 50;
    $pdf->SetFillColor(0, 0, 255);
    $pdf->PieSector($xc1, $yc1, $r11, 0, $r1, 'FD', false, 0, 2);
    $pdf->SetFillColor(0, 255, 0);
    $pdf->PieSector($xc1, $yc1, $r11, $r1, $r2 + $r1, 'FD', false, 0, 2);
    $pdf->SetFillColor(255, 0, 0);
    $pdf->PieSector($xc1, $yc1, $r11, $r2 + $r1, 0, 'FD', false, 0, 2);
    $pdf->SetTextColor(0, 0, 255);
    $pdf->Text(150, 150, 'NO CONTESTADAS: ' . $xc);
    $pdf->SetTextColor(0, 255, 0);
    $pdf->Text(150, 155, 'SI: ' . $yc);
    $pdf->SetTextColor(255, 0, 0);
    $pdf->Text(150, 160, 'NO: ' . $r);
    $pdf->AddPage();
    //----------------------------------------------------------------
    //   GRAFICA No 3
    $pdf->SetTextColor(0, 0, 0);
//.........這裏部分代碼省略.........
開發者ID:giovanny751,項目名稱:sst,代碼行數:101,代碼來源:miscellaneous_helper.php

示例13: writeDetalles

 function writeDetalles(DataSource $dataSource, TCPDF $pdf, $tipo)
 {
     $blackAll = array('LTRB' => array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
     $widthMarginLeft = 1;
     $width1 = 20;
     $width2 = 85;
     $pdf->Ln();
     $pdf->SetFontSize(7.5);
     $pdf->SetFont('', 'B');
     $height = 5;
     $pdf->SetFillColor(255, 255, 255, true);
     $pdf->setTextColor(0, 0, 0);
     if ($tipo == 'adjudicado') {
         $pdf->Cell($width2 - $width1 * 2, $height, 'Item', $blackAll, 0, 'l', true, '', 1, false, 'T', 'C');
     } else {
         $pdf->Cell($width2, $height, 'Item', $blackAll, 0, 'l', true, '', 1, false, 'T', 'C');
     }
     $pdf->Cell($width1, $height, 'Cantidad Ref.', $blackAll, 0, 'L', true, '', 1, false, 'T', 'C');
     if ($tipo != 'borrador') {
         $pdf->Cell($width1, $height, 'Precio Unitario Ref.', $blackAll, 0, 'C', true, '', 1, false, 'T', 'C');
     }
     $pdf->Cell($width1, $height, 'Cantidad Ofert.', $blackAll, 0, 'L', true, '', 1, false, 'T', 'C');
     $pdf->Cell($width1, $height, 'Precio Unitario Ofert.', $blackAll, 0, 'C', true, '', 1, false, 'T', 'C');
     $pdf->Cell($width1, $height, 'Total Ofert.', $blackAll, 0, 'C', true, '', 1, false, 'T', 'C');
     if ($tipo == 'adjudicado') {
         $pdf->Cell($width1, $height, 'Cantidad Adj.', $blackAll, 0, 'l', true, '', 1, false, 'T', 'C');
         $pdf->Cell($width1, $height, 'Total', $blackAll, 0, 'l', true, '', 1, false, 'T', 'C');
     }
     $pdf->Ln();
     $pdf->SetFontSize(6.5);
     foreach ($dataSource->getDataset() as $row) {
         $pdf->SetFont('', '');
         $xAntesMultiCell = $pdf->getX();
         $yAntesMultiCell = $pdf->getY();
         //$totalItem
         if ($tipo == 'borrador') {
             $pdf->MultiCell($width2, $height, $row['desc_solicitud_det'] . "\r\n" . '  - ' . $row['descripcion_sol'], 1, 'L', false, 1);
             $yDespuesMultiCell = $pdf->getY();
             $height = $yDespuesMultiCell - $yAntesMultiCell;
             $pdf->setXY($xAntesMultiCell + $width2, $yAntesMultiCell);
             $pdf->Cell($width1, $height, $row['cantidad_sol'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
             $pdf->Cell($width1, $height, '', 1, 0, 'R', false, '', 1, false, 'T', 'C');
             $pdf->Cell($width1, $height, '', 1, 0, 'R', false, '', 1, false, 'T', 'C');
             $pdf->Cell($width1, $height, '', 1, 0, 'R', false, '', 1, false, 'T', 'C');
         } else {
             if ($tipo == 'cotizado') {
                 $pdf->MultiCell($width2, $height, $row['desc_solicitud_det'] . "\r\n" . '  - ' . $row['descripcion_sol'], 1, 'L', false, 1);
                 $yDespuesMultiCell = $pdf->getY();
                 $height = $yDespuesMultiCell - $yAntesMultiCell;
                 $pdf->setXY($xAntesMultiCell + $width2, $yAntesMultiCell);
                 $pdf->Cell($width1, $height, $row['cantidad_sol'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $pdf->Cell($width1, $height, number_format($row['precio_unitario_sol'], 2), 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $pdf->Cell($width1, $height, $row['cantidad_coti'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $pdf->Cell($width1, $height, number_format($row['precio_unitario'], 2), 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $totalItem = number_format($row['cantidad_coti'] * $row['precio_unitario'], 2);
                 $pdf->Cell($width1, $height, $totalItem, 1, 0, 'R', false, '', 1, false, 'T', 'C');
             } else {
                 $pdf->MultiCell($width2 - $width1 * 2, $height, $row['desc_solicitud_det'] . "\r\n" . '  - ' . $row['descripcion_sol'], 1, 'L', false, 1);
                 $yDespuesMultiCell = $pdf->getY();
                 $height = $yDespuesMultiCell - $yAntesMultiCell;
                 $pdf->setXY($xAntesMultiCell + $width2 - $width1 * 2, $yAntesMultiCell);
                 $pdf->Cell($width1, $height, $row['cantidad_sol'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $pdf->Cell($width1, $height, number_format($row['precio_unitario_sol'], 2), 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $pdf->Cell($width1, $height, $row['cantidad_coti'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $pdf->Cell($width1, $height, number_format($row['precio_unitario'], 2), 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $totalItem = number_format($row['cantidad_coti'] * $row['precio_unitario'], 2);
                 $pdf->Cell($width1, $height, $totalItem, 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $pdf->Cell($width1, $height, $row['cantidad_adju'], 1, 0, 'R', false, '', 1, false, 'T', 'C');
                 $totalAdj = number_format($row['cantidad_adju'] * $row['precio_unitario'], 2);
                 $pdf->Cell($width1, $height, $totalAdj, 1, 0, 'R', false, '', 1, false, 'T', 'C');
             }
         }
         $pdf->Ln();
     }
 }
開發者ID:rensi4rn,項目名稱:ADQUI_BOA,代碼行數:75,代碼來源:RCotizacion.php

示例14: showPdf

function showPdf($idReg = "")
{
    global $db;
    // -------------------------------
    // CONSULTA DE DATOS
    // -------------------------------
    $sql = "select * from ENTRADA where id_entrada='{$idReg}'";
    $db->query($sql);
    while ($db->next_record()) {
        $entSal = $db->f('ent_sal');
        //$idCliente = $db->f('id_cliente');
        //$cliente = getValueTable("cliente","CLIENTE","id_cliente",$idCliente);
        $cliente = $db->f('consig');
        $idConte = $db->f('id_contenedor');
        $conte = getValueTable("numero", "CONTENEDOR", "id_contenedor", $idConte);
        if (preg_match("/(\\w{4})(\\d{7})/", $conte, $parts)) {
            $conteL = $parts[1];
            $conteN = $parts[2];
        }
        $idEq = getValueTable("id_equipo", "CONTENEDOR", "id_contenedor", $idConte);
        $equipo = getValueTable("equipo", "EQUIPO", "id_equipo", $idEq);
        $bkg = $db->f('bkg');
        $clase = $db->f('clase');
        $damage = $db->f('damage');
        $sello = $db->f('sello');
        $nota = $db->f('nota');
        //$idTrans = $db->f('id_transporte');
        //$transp = getValueTable("transporte","TRANSPORTE","id_transporte",$idTrans);
        $transp = $db->f('transportista');
        $conteP1 = substr($conte, 0, 4);
        $conteP2 = substr($conte, 4, 10);
        if (preg_match("/(\\d+)(\\d)\$/", $conteP2, $parts)) {
            $conteP2 = $parts[1] . "-" . $parts[2];
        }
        $idNav = $db->f('id_naviera');
        $naviera = getValueTable("naviera", "NAVIERA", "id_naviera", $idNav);
        $placas = $db->f('placas');
        // $idOperador = $db->f('id_operador');
        //$operador = getValueTable("operador","OPERADOR","id_operador",$idOperador);
        $operador = $db->f('operador');
        if ($entSal == "E") {
            $entCapFec = $db->f('cap_fec');
            $entTrans = $transp;
            $entOpera = $operador;
            $entPlacas = $placas;
            $entClase = "CLASE : {$clase}";
            $entDamage = $damage;
            $entSello = $sello;
            $entNota = $nota;
        }
        if ($entSal == "S") {
            $salCapFec = $db->f('cap_fec');
            $salTrans = $transp;
            $salOpera = $operador;
            $salPlacas = $placas;
            $salClase = "CLASE : {$clase}";
            $salDamage = $damage;
            $salSello = $sello;
            $salNota = $nota;
        }
    }
    // create new PDF document
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'LETTER', true, 'ISO-8859-1', false);
    // set document information
    $pdf->SetCreator(PDF_CREATOR);
    $pdf->SetAuthor('Nicola Asuni');
    $pdf->SetTitle('TCPDF Example 009');
    $pdf->SetSubject('TCPDF Tutorial');
    $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // set default header data
    //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 009', PDF_HEADER_STRING);
    // set header and footer fonts
    //$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    // set default monospaced font
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    //set margins
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    //$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    // $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    // $pdf->SetFooterMargin(3);
    $pdf->setPageOrientation('P', '', 1);
    //set auto page breaks
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    //set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    //set some language-dependent strings
    $pdf->setLanguageArray($l);
    // -------------------------------------------------------------------
    $pdf->AddPage();
    // Logo
    $pdf->setJPEGQuality(100);
    $pdf->Image('../images/logo_color.jpg', 13, 4, 25, 25, '', '', '', false);
    $pdf->Image('../images/nome.jpg', 15, 140, 185, 96, '', '', '', false);
    // set cell padding
    //$pdf->setCellPaddings(1, 1, 1, 1);
    // set cell margins
    //$pdf->setCellMargins(1, 1, 1, 1);
    $pdf->SetFillColor(197, 197, 197);
    // set font
//.........這裏部分代碼省略.........
開發者ID:nesmaster,項目名稱:anakosta,代碼行數:101,代碼來源:eirPdf2.php

示例15:

$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', '', 10);
// add a page
$pdf->AddPage();
// set color for filler
$pdf->SetFillColor(255, 255, 0);
// Multicell test
$pdf->MultiCell(40, 5, 'A test multicell line 1 test multicell line 2 test multicell line 3', 1, 'L', 1, 0, '', '', true);
$pdf->MultiCell(40, 5, 'B test multicell line 1 test multicell line 2 test multicell line 3', 1, 'R', 0, 1, '', '', true);
$pdf->MultiCell(40, 5, 'C test multicell line 1 test multicell line 2 test multicell line 3', 1, 'C', 0, 0, '', '', true);
$pdf->MultiCell(40, 5, 'D test multicell line 1 test multicell line 2 test multicell line 3' . "\n", 1, 'J', 1, 2, '', '', true);
$pdf->MultiCell(40, 5, 'E test multicell line 1 test multicell line 2 test multicell line 3', 1, 'L', 0, 1, '', '', true);
$pdf->SetFillColor(255, 200, 200);
$pdf->MultiCell(40, 5, 'F test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line' . "\n", 1, 'J', 1, 1, '', '', true);
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_005.pdf', 'I');
//============================================================+
// END OF FILE
開發者ID:JVS-IS,項目名稱:ICONITO-EcoleNumerique,代碼行數:31,代碼來源:example_005.php


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