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


PHP TCPDF::SetLineWidth方法代码示例

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


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

示例1: rectangle

 /**
  * Draws a rectangle at x1,y1 with width w and height h
  *
  * See {@link Style::munge_colour()} for the format of the colour array.
  * See {@link Cpdf::setLineStyle()} for a description of the $style
  * parameter (aka dash)
  *
  * @param float $x1
  * @param float $y1
  * @param float $w
  * @param float $h
  * @param array $color
  * @param float $width
  * @param array $style
  */
 function rectangle($x1, $y1, $w, $h, $color, $width, $style = null)
 {
     if (is_null($this->_last_line_width) || $width != $this->_last_line_width) {
         $this->_pdf->SetLineWidth($width);
         $this->_last_line_width = $width;
     }
     $this->_set_stroke_colour($color);
     // FIXME: ugh, need to handle styles here
     $this->_pdf->rect($x1, $y1, $w, $h);
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:25,代码来源:tcpdf_adapter.cls.php

示例2: __construct

 public function __construct()
 {
     //		$orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false, $pdfa=false
     $pdf = new \TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->SetDefaultMonospacedFont('courier');
     $pdf->SetMargins(10, 10, 7, true);
     $pdf->SetAutoPageBreak(true, 5);
     $pdf->setImageScale(1);
     $pdf->SetFont('freeserif', '', 12, '', false);
     $pdf->SetLineWidth(0.05);
     $this->pdf = $pdf;
     $this->cell = new cell($this->pdf);
 }
开发者ID:binaryk,项目名称:terenuripedia,代码行数:15,代码来源:topdf.php

示例3: dirname

// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 20);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of alignment options for Cell()', '', 0, 'L', true, 0, false, false, 0);
$pdf->SetFont('helvetica', '', 11);
// set border width
$pdf->SetLineWidth(0.7);
// set color for cell border
$pdf->SetDrawColor(0, 128, 255);
$pdf->setCellHeightRatio(3);
$pdf->SetXY(15, 60);
// text on center
$pdf->Cell(30, 0, 'Top-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'T', 'C');
$pdf->Cell(30, 0, 'Center-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'C');
$pdf->Cell(30, 0, 'Bottom-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'B', 'C');
$pdf->Cell(30, 0, 'Ascent-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'A', 'C');
$pdf->Cell(30, 0, 'Baseline-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'L', 'C');
$pdf->Cell(30, 0, 'Descent-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'D', 'C');
$pdf->SetXY(15, 90);
// text on top
$pdf->Cell(30, 0, 'Top-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'T', 'T');
$pdf->Cell(30, 0, 'Center-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'T');
开发者ID:hcvcastro,项目名称:pxp,代码行数:31,代码来源:example_057.php

示例4:

//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
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', "B", 12);
// add a page
$pdf->AddPage();
$pdf->SetLineWidth(1);
$pdf->SetDrawColor(50, 0, 0, 0);
$pdf->SetFillColor(100, 0, 0, 0);
$pdf->SetTextColor(100, 0, 0, 0);
$pdf->Rect(30, 60, 20, 20, 'DF');
$pdf->Text(30, 85, 'Cyan');
$pdf->SetDrawColor(0, 50, 0, 0);
$pdf->SetFillColor(0, 100, 0, 0);
$pdf->SetTextColor(0, 100, 0, 0);
$pdf->Rect(60, 60, 20, 20, 'DF');
$pdf->Text(60, 85, 'Magenta');
$pdf->SetDrawColor(0, 0, 50, 0);
$pdf->SetFillColor(0, 0, 100, 0);
$pdf->SetTextColor(0, 0, 100, 0);
$pdf->Rect(90, 60, 20, 20, 'DF');
$pdf->Text(90, 85, 'Yellow');
开发者ID:EricQi,项目名称:vozmob,代码行数:31,代码来源:example_022.php

示例5:

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'BI', 8);
// add a page
$pdf->AddPage();
/*
 * setAlpha() gives transparency support. You can set the 
 * alpha channel from 0 (fully transparent) to 1 (fully 
 * opaque). It applies to all elements (text, drawings, 
 * images).
 */
$pdf->SetLineWidth(1.5);
// draw opaque red square
$pdf->SetFillColor(255, 0, 0);
$pdf->Rect(30, 60, 40, 40, 'DF');
// set alpha to semi-transparency
$pdf->SetAlpha(0.5);
// draw green square
$pdf->SetFillColor(0, 255, 0);
$pdf->Rect(40, 70, 40, 40, 'DF');
// draw jpeg image
$pdf->Image('../images/image_demo.jpg', 50, 80, 40, 40, '', 'http://www.tcpdf.org', '', true, 72);
// restore full opacity
$pdf->SetAlpha(1);
// print name
$pdf->Text(55, 85, 'TRANSPARENCY');
// ---------------------------------------------------------
开发者ID:Ayaan123,项目名称:alumnisangam,代码行数:31,代码来源:example_025.php

示例6: 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 025');
     $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 . ' 025', 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', '', 12);
     // add a page
     $pdf->AddPage();
     $txt = 'You can set the transparency of PDF objects using the setAlpha() method.';
     $pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0);
     /*
      * setAlpha() gives transparency support. You can set the
      * alpha channel from 0 (fully transparent) to 1 (fully
      * opaque). It applies to all elements (text, drawings,
      * images).
      */
     $pdf->SetLineWidth(2);
     // draw opaque red square
     $pdf->SetFillColor(255, 0, 0);
     $pdf->SetDrawColor(127, 0, 0);
     $pdf->Rect(30, 40, 60, 60, 'DF');
     // set alpha to semi-transparency
     $pdf->SetAlpha(0.5);
     // draw green square
     $pdf->SetFillColor(0, 255, 0);
     $pdf->SetDrawColor(0, 127, 0);
     $pdf->Rect(50, 60, 60, 60, 'DF');
     // draw blue square
     $pdf->SetFillColor(0, 0, 255);
     $pdf->SetDrawColor(0, 0, 127);
     $pdf->Rect(70, 80, 60, 60, 'DF');
     // draw jpeg image
     $pdf->Image('tests/images/image_demo.jpg', 90, 100, 60, 60, '', 'http://www.tcpdf.org', '', true, 72);
     // restore full opacity
     $pdf->SetAlpha(1);
     $this->comparePdfs($pdf);
 }
开发者ID:fooman,项目名称:tcpdf,代码行数:61,代码来源:Example025Test.php

示例7: rekapitulasi_lahan_kecamatan_pdf

    public function rekapitulasi_lahan_kecamatan_pdf($tahun, $periode)
    {
        /// 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('Dinas PU CKTR Sidoarjo');
        $pdf->SetTitle('Rekapitulasi_Lahan_Perkecamatan_Triwulan' . $periode . '_' . $tahun);
        $pdf->SetSubject('TCPDF');
        $pdf->SetKeywords('TCPDF, PDF');
        $pdf->SetHeaderData('sidoardjo.png', 20, 'PEMERINTAH KABUPATEN SIDOARDJO', 'DINAS PEKERJAAN UMUM CIPTA KARYA DAN TATA RUANG', 'REKAPITULASI DATA LAHAN PERUMAHAH / PEMUKIMAN');
        $pdf->setFooterData('Triwulan ' . $periode . ' Tahun ' . $tahun);
        $pdf->setBarcode(date('Y-m-d H:i:s'));
        // 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)
        if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
            require_once dirname(__FILE__) . '/lang/eng.php';
            $pdf->setLanguageArray($l);
        }
        // ---------------------------------------------------------
        // set font
        $pdf->SetFont('helvetica', 'B', 20);
        // add a page
        $pdf->AddPage('L', 'A3');
        //  $pdf->Write(0, 'PEMBANGUNAN PERUMAHAN / PEMUKIMAN', '', 0, 'C', true, 0, false, false, 0);
        //  $pdf->Write(0, 'REKAPITULASI DATA LAHAN PERUMAHAH / PEMUKIMAN', '', 0, 'C', true, 0, false, false, 0);
        $pdf->SetFont('helvetica', '', 11);
        // $pdf->Write(0, 'Tahun :'  .$tahun, '', 0, 'L', true, 0, false, false, 0);
        //  $pdf->Write(0, 'Periode : Triwulan' .$periode, '', 0, 'L', true, 0, false, false, 0);
        $pdf->SetLineWidth(5);
        $pdf->SetDrawColor(0, 128, 255);
        $pdf->SetFillColor(255, 255, 128);
        // -----------------------------------------------------------------------------
        // -----------------------------------------------------------------------------
        $k['JML_IJIN_LOKASI'] = $k['LUAS'] = $k['RENCANA_TAPAK'] = $k['PEMBEBASAN'] = $k['TERBANGUN'] = $k['BELUM_TERBANGUN'] = $k['DIALOKASIKAN'] = $k['PEMBEBASAN'] = $k['DIMATANGKAN'] = $k['AKTIF_DLM_PEMBANGUNAN'] = $k['AKTIF_BERHENTI'] = $k['AKTIF_SDH_SELESAI'] = $k['TIDAK_AKTIF'] = 0;
        $tb = "";
        $this->load->model('m_report');
        $nilai = $this->m_report->jumlah_kecamatan();
        foreach ($nilai as $nil) {
            $jmlkec = $nil['JUMLAH'];
            $data['jumlah'] = $nil['JUMLAH'];
        }
        for ($j = 1; $j <= $jmlkec; $j++) {
            $data['lah_kec'][$j] = $this->m_report->tabel_lahan_kecamatan_all($j, $tahun, $periode);
            $data['aktifpemb'][$j] = $this->m_report->aktif_dalam_pembangunan($j, $tahun, $periode);
            $data['aktifber'][$j] = $this->m_report->aktif_berhenti($j, $tahun, $periode);
            $data['aktifsel'][$j] = $this->m_report->aktif_sdh_selesai($j, $tahun, $periode);
            $data['tdkaktif'][$j] = $this->m_report->tidak_aktif($j, $tahun, $periode);
        }
        for ($c = 1; $c < $jmlkec; $c++) {
            foreach ($data['lah_kec'][$c] as $i) {
                $tb .= "<tr>\n              <td width=\"28px\">" . $c . "</td>\n              <td width=\"100px\">" . $i['NAMA_KECAMATAN'] . "</td>              \n              <td width=\"87px\">" . $i['JML_IJIN_LOKASI'] . " </td>\n              <td width=\"87px\">" . $i['LUAS'] . " </td>\n              <td width=\"87px\">" . $i['RENCANA_TAPAK'] . " </td>\n              <td width=\"90px\">" . $i['PEMBEBASAN'] . " </td>\n              <td width=\"87px\">" . $i['TERBANGUN'] . " </td>\n              <td width=\"87px\">" . $i['BELUM_TERBANGUN'] . " </td>\n              <td width=\"90px\">" . $i['DIALOKASIKAN'] . " </td>\n              <td width=\"90px\">" . $i['PEMBEBASAN'] . " </td>\n              <td width=\"87px\">" . $i['DIMATANGKAN'] . " </td>";
                $k['JML_IJIN_LOKASI'] += $i['JML_IJIN_LOKASI'];
                $k['LUAS'] += $i['LUAS'];
                $k['RENCANA_TAPAK'] += $i['RENCANA_TAPAK'];
                $k['PEMBEBASAN'] += $i['PEMBEBASAN'];
                $k['TERBANGUN'] += $i['TERBANGUN'];
                $k['BELUM_TERBANGUN'] += $i['BELUM_TERBANGUN'];
                $k['DIALOKASIKAN'] += $i['DIALOKASIKAN'];
                $k['PEMBEBASAN'] += $i['PEMBEBASAN'];
                $k['DIMATANGKAN'] += $i['DIMATANGKAN'];
            }
            foreach ($data['aktifpemb'][$c] as $i) {
                $tb .= "<td width=\"87px\">" . $i['AKTIF_DLM_PEMBANGUNAN'] . "</td>";
                $k['AKTIF_DLM_PEMBANGUNAN'] += $i['AKTIF_DLM_PEMBANGUNAN'];
            }
            foreach ($data['aktifber'][$c] as $i) {
                $tb .= "<td width=\"87px\">" . $i['AKTIF_BERHENTI'] . " </td>";
                $k['AKTIF_BERHENTI'] += $i['AKTIF_BERHENTI'];
            }
            foreach ($data['aktifsel'][$c] as $i) {
                $tb .= "<td width=\"87px\">" . $i['AKTIF_SDH_SELESAI'] . " </td>";
                $k['AKTIF_SDH_SELESAI'] += $i['AKTIF_SDH_SELESAI'];
            }
            foreach ($data['tdkaktif'][$c] as $i) {
                $tb .= "<td width=\"87px\">" . $i['TIDAK_AKTIF'] . " </td>                            \n              </tr> ";
                $k['TIDAK_AKTIF'] += $i['TIDAK_AKTIF'];
            }
        }
        $tb1 = "";
        $tb1 .= "<tr>\n             \n              <td width=\"130px\">JUMLAH</td>\n              <td width=\"87px\">" . $k['JML_IJIN_LOKASI'] . " </td>\n              <td width=\"87px\">" . $k['LUAS'] . " </td>\n              <td width=\"87px\">" . $k['RENCANA_TAPAK'] . " </td>\n              <td width=\"90px\">" . $k['PEMBEBASAN'] . " </td>\n              <td width=\"87px\">" . $k['TERBANGUN'] . " </td>\n              <td width=\"87px\">" . $k['BELUM_TERBANGUN'] . " </td>\n              <td width=\"90px\">" . $k['DIALOKASIKAN'] . " </td>\n              <td width=\"90px\">" . $k['PEMBEBASAN'] . " </td>\n              <td width=\"87px\">" . $k['DIMATANGKAN'] . " </td>\n              <td width=\"87px\">" . $k['AKTIF_DLM_PEMBANGUNAN'] . " </td>\n              <td width=\"87px\">" . $k['AKTIF_BERHENTI'] . " </td>\n              <td width=\"87px\">" . $k['AKTIF_SDH_SELESAI'] . " </td>\n              <td width=\"87px\">" . $k['TIDAK_AKTIF'] . " </td>\n              \n            </tr> ";
        $tbl = <<<EOD
      <table border="1" cellpadding="2" cellspacing="2">
      <thead>
       <tr style="background-color:#FFFF00;color:#0000FF;">
        <td width="28px" align="center"><b>NO</b></td>
        <td width="100px" align="center"><b>Kecamatan</b></td>
        <td width="87px " align="center"> <b>Perusahaan</b></td>
//.........这里部分代码省略.........
开发者ID:hafiznuzal,项目名称:perumahansidoarjo,代码行数:101,代码来源:create_pdf.php

示例8: printTableAsPdf

 public function printTableAsPdf()
 {
     global $CFG;
     define('K_PATH_CACHE', $CFG->dataroot . '/temp/');
     require_once gcr::webDir . 'lib/tcpdf/config/lang/eng.php';
     require_once gcr::webDir . 'lib/tcpdf/tcpdf.php';
     $app = $this->user->getApp();
     // create new PDF document
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator($app->getFullName());
     $pdf->SetAuthor($app->getFullName());
     $pdf->SetTitle('Student Transcript');
     $pdf->SetSubject($this->user->getFullNameString());
     $pdf->SetKeywords('transcript, course, grade');
     $address = $app->getAddressObject();
     $person2 = $app->getPerson2Object();
     $header_string = $person2->getFullName() . "\n";
     $header_string .= $address->getStreet1() . "\n";
     if ($address->getStreet2() != '') {
         $header_string .= $address->getStreet2() . "\n";
     }
     $header_string .= $address->getCity() . ', ' . $address->getState() . ' ' . $address->getZipcode() . "\n";
     $header_string .= $person2->getPhone1() . "\n";
     $header_string .= $person2->getPhone2() . "\n";
     $header_string .= $person2->getEmail();
     // set default header data
     $pdf->SetHeaderData('../../../../../../..' . $app->getLogoFilePath(), 30, trim(trim($app->getFullName())) . ' Student Transcript', 'Student: ' . trim($this->user->getFullNameString()) . ', ' . $this->user->getObject()->email . "\nDate: " . date('m/d/Y', time()));
     // 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
     $pdf->setLanguageArray($l);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', '', 8);
     // add a page
     $pdf->AddPage();
     $mdl_user_obj = $this->user->getObject();
     $html = '<b>Educational Provider Information:</b><br />';
     $html .= $app->getFullName() . '<br />';
     $html .= $person2->getFullName() . '<br />';
     $html .= $address->getStreet1() . '<br />';
     if ($address->getStreet2() != '') {
         $html .= $address->getStreet2() . "<br />";
     }
     $html .= $address->getCity() . ', ' . $address->getState() . ' ' . $address->getZipcode() . "<br />";
     $html .= $person2->getPhone1() . "<br />";
     $html .= $person2->getPhone2() . "<br />";
     $html .= $person2->getEmail() . '<br /><br />';
     $w = array(17, 65, 50, 12, 12, 23);
     $pdf->SetFillColor(255);
     $pdf->SetTextColor(0);
     // Data
     $fill = 0;
     $pdf->writeHTMLCell(array_sum($w), $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
     $pdf->SetFont('helvetica', '', 8);
     $row_count = $this->table->getRowCount();
     $columns = $this->table->getColumns();
     // Colors, line width and bold font
     $pdf->SetFillColor(230, 238, 238);
     $pdf->SetDrawColor(221, 221, 221);
     $pdf->SetLineWidth(0.3);
     $pdf->SetFont('', 'B', 8);
     // Header
     $pdf->Cell($w[0], 7, 'Date', 1, 0, 'L', 1);
     $pdf->Cell($w[1], 7, 'Course', 1, 0, 'L', 1);
     $pdf->Cell($w[2], 7, 'Instructor', 1, 0, 'L', 1);
     $pdf->Cell($w[3], 7, 'Credits', 1, 0, 'L', 1);
     $pdf->Cell($w[4], 7, 'Grade', 1, 0, 'L', 1);
     $pdf->Cell($w[5], 7, 'Result', 1, 0, 'L', 1);
     $pdf->Ln();
     // Color and font restoration
     $pdf->SetFillColor(240, 240, 246);
     $pdf->SetFont('helvetica', '', 8);
     // Data
     $fill = 0;
     // This convoluted code does the following for each table row:
     // 1. Break the table row contents into a multidimentional
     // array, $row[column][line], so that we can handle cells
     // which require multiple lines because they are too long.
     // 2. Print each column left to right, and repeat for each line
     // required for this row.
     for ($row = 1; $row < $row_count; $row++) {
         $row_content = array();
         $max_line_index = 0;
         for ($column = 0; $column < 6; $column++) {
             $max_chars = floor(0.75 * $w[$column]);
             $cell_content = strip_tags($columns[$column]->getCells($row)->getContent());
             $column_line_count = ceil((strlen($cell_content) + 0.1) / $max_chars);
//.........这里部分代码省略.........
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:101,代码来源:GcrCourseHistoryTable.class.php

示例9: printPDFOrder

        /**
         * print PDF order
         * @param Order $order
         */
        private function printPDFOrder(Order $order){

            global $lang;
            $product_items = $order->getProducts();
            $shop = new ShopInfo($this->module_srl);
            $this->model->includeTCPDF();

            // create new PDF document
            $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, TRUE, 'UTF-8', FALSE);

            // set document information
            $pdf->SetCreator($shop->getShopTitle());
            $pdf->SetTitle(sprintf($lang->order_with_number, $order->order_srl));
            $pdf->SetSubject(sprintf($lang->order_with_number, $order->order_srl));

            $pdf->setPrintHeader(FALSE);
            $pdf->setPrintFooter(FALSE);

            // set font
            $pdf->SetFont('dejavusans', '', 10);

            // add a page
            $pdf->AddPage();


            // create HTML content
            $html = '
            <div style="float:left; text-align: center;">'.$shop->getShopTitle().'</div>
            <h1>'.sprintf($lang->order_with_number, $order->order_srl).'</h1>
            <p></p>
            Order date: '.zdate($order->regdate,'d-M-y').'
            <p></p><h3>'.$lang->shipping_address.'</h3>'.$order->shipping_address.'
            <p></p><h3>'.$lang->billing_address.'</h3>'.$order->billing_address.'
            <p></p><h3>'.$lang->payment_method_used.'</h3>'.ucwords(str_replace('_', ' ', $order->payment_method)).'
            <p></p><h3>'.$lang->shipping_method_used.'</h3>'.ucwords(str_replace('_', ' ', $order->shipping_method)).'
            <p></p><h3>'.$lang->items_ordered.'</h3></br>';

            // output the HTML content
            $pdf->writeHTML($html, TRUE, FALSE, TRUE, FALSE, '');

            // Colors, line width and bold font
            $pdf->SetFillColor(38, 74, 108);
            $pdf->SetTextColor(255);
            $pdf->SetDrawColor(38, 74, 108);
            $pdf->SetLineWidth(0.3);
            $pdf->SetFont('', 'B');
            // Header
            $w = array(15, 70, 20, 45, 45);
            $header= $header = array($lang->product_no_dot, $lang->title, $lang->quantity, $lang->price, $lang->subtotal);
            $num_headers = count($header);
            for($i = 0; $i < $num_headers; ++$i) {
                $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', 1);
            }
            $pdf->Ln();
            // Color and font restoration
            $pdf->SetFillColor(224, 235, 255);
            $pdf->SetTextColor(0);
            $pdf->SetFont('');
            // Data
            $fill = 0;
            $i = 0;
            foreach($product_items as $product){
                $i++;
                $pdf->Cell($w[0], 6, $i, 'LR', 0, 'C', $fill);
                $pdf->Cell($w[1], 6, $product->getTitle(), 'LR', 0, 'L', $fill);
                $pdf->Cell($w[2], 6, $product->getQuantity(), 'LR', 0, 'R', $fill);
                $pdf->Cell($w[3], 6, ShopDisplay::priceFormat($product->getPrice(), $shop->getCurrencySymbol()), 'LR', 0, 'R', $fill);
                $pdf->Cell($w[4], 6, ShopDisplay::priceFormat($product->getPrice() * $product->getQuantity(), $shop->getCurrencySymbol()), 'LR', 0, 'R', $fill);
                $pdf->Ln();
                $fill=!$fill;
            }

            $pdf->Cell(array_sum($w) - $w[4], 6, $lang->total, 1, 0, 'R',$fill);
            $pdf->Cell($w[4], 6, ShopDisplay::priceFormat($order->getTotalBeforeDiscount(), $shop->getCurrencySymbol()), 1, 0, 'R',$fill);
            $fill=!$fill;
            $pdf->Ln();

            if($order->getDiscountAmount()){
                $pdf->Cell(array_sum($w) - $w[4], 6, $lang->discount, 1, 0, 'R',$fill);
                $pdf->Cell($w[4], 6, ShopDisplay::priceFormat(-1 * $order->getDiscountAmount(), $shop->getCurrencySymbol()), 1, 0, 'R',$fill);
                $fill=!$fill;
                $pdf->Ln();
            }

            if($order->getShippingMethodName()){
                $pdf->Cell(array_sum($w) - $w[4], 6, $lang->shipping, 1, 0, 'R',$fill);
                $pdf->Cell($w[4], 6, ShopDisplay::priceFormat($order->getShippingCost(), $shop->getCurrencySymbol()), 1, 0, 'R',$fill);
                $fill=!$fill;
                $pdf->Ln();
            }

            $pdf->SetFont('', 'B');
            $pdf->Cell(array_sum($w) - $w[4], 6, $lang->grand_total, 1, 0, 'R',$fill);
            $pdf->Cell($w[4], 6, ShopDisplay::priceFormat($order->getTotal(), $shop->getCurrencySymbol()), 1, 0, 'R',$fill);
            $fill=!$fill;
            $pdf->Ln();
//.........这里部分代码省略.........
开发者ID:haegyung,项目名称:xe-module-shop,代码行数:101,代码来源:shop.controller.php

示例10: Cell

$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('helvetica', 'B', 20);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of alignment options for Cell()', '', 0, 'L', true, 0, false, false, 0);
$pdf->SetFont('helvetica', '', 11);
// set border width
$pdf->SetLineWidth(0.7);
// set color for cell border
$pdf->SetDrawColor(0, 128, 255);
$pdf->setCellHeightRatio(3);
$pdf->SetXY(15, 60);
// text on center
$pdf->Cell(30, 0, 'Top-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'T', 'C');
$pdf->Cell(30, 0, 'Center-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'C');
$pdf->Cell(30, 0, 'Bottom-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'B', 'C');
$pdf->Cell(30, 0, 'Ascent-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'A', 'C');
$pdf->Cell(30, 0, 'Baseline-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'L', 'C');
$pdf->Cell(30, 0, 'Descent-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'D', 'C');
$pdf->SetXY(15, 90);
// text on top
$pdf->Cell(30, 0, 'Top-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'T', 'T');
$pdf->Cell(30, 0, 'Center-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'T');
开发者ID:cristminix,项目名称:cGRhbXRrcg-,代码行数:31,代码来源:example_057.php

示例11: display

 public function display($arraydata, $y_axis = 0, $fielddata = false)
 {
     //print_r($arraydata);echo "<br/>";
     //    $this->pdf->Cell(10,10,"SSSS");
     $this->Rotate($arraydata["rotation"]);
     if ($arraydata["rotation"] != "") {
         if ($arraydata["rotation"] == "Left") {
             $w = $arraydata["width"];
             $arraydata["width"] = $arraydata["height"];
             $arraydata["height"] = $w;
             $this->pdf->SetXY($this->pdf->GetX() - $arraydata["width"], $this->pdf->GetY());
         } elseif ($arraydata["rotation"] == "Right") {
             $w = $arraydata["width"];
             $arraydata["width"] = $arraydata["height"];
             $arraydata["height"] = $w;
             $this->pdf->SetXY($this->pdf->GetX(), $this->pdf->GetY() - $arraydata["height"]);
         } elseif ($arraydata["rotation"] == "UpsideDown") {
             //soverflow"=>$stretchoverflow,"poverflow"
             $arraydata["soverflow"] = true;
             $arraydata["poverflow"] = true;
             //   $w=$arraydata["width"];
             // $arraydata["width"]=$arraydata["height"];
             //$arraydata["height"]=$w;
             $this->pdf->SetXY($this->pdf->GetX() - $arraydata["width"], $this->pdf->GetY() - $arraydata["height"]);
         }
     }
     if ($arraydata["type"] == "SetFont") {
         if ($arraydata["font"] == 'uGB') {
             $this->pdf->isUnicode = true;
         } else {
             $this->pdf->isUnicode = false;
         }
         $this->pdf->SetFont($arraydata["font"], $arraydata["fontstyle"], $arraydata["fontsize"]);
     } elseif ($arraydata["type"] == "subreport") {
         $this->runSubReport($arraydata);
     } elseif ($arraydata["type"] == "MultiCell") {
         $currenty = $this->pdf->GetY();
         if ($fielddata == false) {
             if ($this->allowprintuntill >= $currenty) {
                 $this->checkoverflow($arraydata, $this->updatePageNo($arraydata["txt"]));
             }
         } elseif ($fielddata == true) {
             if ($this->allowprintuntill >= $currenty) {
                 $this->checkoverflow($arraydata, $this->updatePageNo($this->analyse_expression($arraydata["txt"], $arraydata["isPrintRepeatedValues"])));
             } elseif ($this->parentcurrentband == "detail") {
                 $this->pdf->Cell(40, 10, "SADSD");
             }
             //                  echo $arraydata["txt"]."+\"|(".$y_axis.",".print_r($arraydata,true)."),$this->allowprintuntill,$newy\"<br/><br/>";
         }
     } elseif ($arraydata["type"] == "SetXY") {
         $this->pdf->SetXY($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis);
     } elseif ($arraydata["type"] == "Cell") {
         $currenty = $this->pdf->GetY();
         if ($this->allowprintuntill >= $currenty) {
             $this->pdf->Cell($arraydata["width"], $arraydata["height"], $this->updatePageNo($arraydata["txt"]), $arraydata["border"], $arraydata["ln"], $arraydata["align"], $arraydata["fill"], $arraydata["link"]);
         } elseif ($this->parentcurrentband == "detail") {
             $this->pdf->Cell(40, 10, "SADSD");
         }
     } elseif ($arraydata["type"] == "Rect") {
         $this->pdf->Rect($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"]);
     } elseif ($arraydata["type"] == "Image") {
         $path = $this->analyse_expression($arraydata["path"]);
         $imgtype = substr($path, -3);
         if ($imgtype == 'jpg' || right($path, 3) == 'jpg' || right($path, 4) == 'jpeg') {
             $imgtype = "JPEG";
         } elseif ($imgtype == 'png' || $imgtype == 'PNG') {
             $imgtype = "PNG";
         }
         if (file_exists($path) || left($path, 4) == 'http') {
             $this->pdf->Image($path, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $imgtype, $arraydata["link"]);
         } elseif (left($path, 22) == "data:image/jpeg;base64") {
             $imgtype = "JPEG";
             $img = str_replace('data:image/jpeg;base64,', '', $path);
             $imgdata = base64_decode($img);
             $this->pdf->Image('@' . $imgdata, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"]);
             //,$imgtype,$arraydata["link"]);
         } elseif (left($path, 22) == "data:image/png;base64,") {
             $imgtype = "PNG";
             // $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
             $img = str_replace('data:image/png;base64,', '', $path);
             $imgdata = base64_decode($img);
             $this->pdf->Image('@' . $imgdata, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"]);
             //,$imgtype,$arraydata["link"]);
         }
     } elseif ($arraydata["type"] == "SetTextColor") {
         $this->pdf->SetTextColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "SetDrawColor") {
         $this->pdf->SetDrawColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "SetLineWidth") {
         $this->pdf->SetLineWidth($arraydata["width"]);
     } elseif ($arraydata["type"] == "Line") {
         $this->pdf->Line($arraydata["x1"] + $this->arrayPageSetting["leftMargin"], $arraydata["y1"] + $y_axis, $arraydata["x2"] + $this->arrayPageSetting["leftMargin"], $arraydata["y2"] + $y_axis);
     } elseif ($arraydata["type"] == "SetFillColor") {
         $this->pdf->SetFillColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "lineChart") {
         $this->showLineChart($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "barChart") {
         $this->showBarChart($arraydata, $y_axis, 'barChart');
     } elseif ($arraydata["type"] == "stackedBarChart") {
         $this->showBarChart($arraydata, $y_axis, 'stackedBarChart');
//.........这里部分代码省略.........
开发者ID:fabiorossetto1,项目名称:phpjasperxml,代码行数:101,代码来源:SubReport.php

示例12: 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 057');
        $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 . ' 057', 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 alignment options for Cell()', '', 0, 'L', true, 0, false, false, 0);
        $pdf->SetFont('helvetica', '', 11);
        // set border width
        $pdf->SetLineWidth(0.7);
        // set color for cell border
        $pdf->SetDrawColor(0, 128, 255);
        $pdf->setCellHeightRatio(3);
        $pdf->SetXY(15, 60);
        // text on center
        $pdf->Cell(30, 0, 'Top-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'T', 'C');
        $pdf->Cell(30, 0, 'Center-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'C');
        $pdf->Cell(30, 0, 'Bottom-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'B', 'C');
        $pdf->Cell(30, 0, 'Ascent-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'A', 'C');
        $pdf->Cell(30, 0, 'Baseline-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'L', 'C');
        $pdf->Cell(30, 0, 'Descent-Center', 1, $ln = 0, 'C', 0, '', 0, false, 'D', 'C');
        $pdf->SetXY(15, 90);
        // text on top
        $pdf->Cell(30, 0, 'Top-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'T', 'T');
        $pdf->Cell(30, 0, 'Center-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'T');
        $pdf->Cell(30, 0, 'Bottom-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'B', 'T');
        $pdf->Cell(30, 0, 'Ascent-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'A', 'T');
        $pdf->Cell(30, 0, 'Baseline-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'L', 'T');
        $pdf->Cell(30, 0, 'Descent-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'D', 'T');
        $pdf->SetXY(15, 120);
        // text on bottom
        $pdf->Cell(30, 0, 'Top-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'T', 'B');
        $pdf->Cell(30, 0, 'Center-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'B');
        $pdf->Cell(30, 0, 'Bottom-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'B', 'B');
        $pdf->Cell(30, 0, 'Ascent-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'A', 'B');
        $pdf->Cell(30, 0, 'Baseline-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'L', 'B');
        $pdf->Cell(30, 0, 'Descent-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'D', 'B');
        // draw some reference lines
        $linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(255, 0, 0));
        $pdf->Line(15, 60, 195, 60, $linestyle);
        $pdf->Line(15, 90, 195, 90, $linestyle);
        $pdf->Line(15, 120, 195, 120, $linestyle);
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // Print an image to explain cell measures
        $pdf->Image('tests/images/tcpdf_cell.png', 15, 160, 100, 100, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
        $legend = 'LEGEND:

X: cell x top-left origin (top-right for RTL)
Y: cell y top-left origin (top-right for RTL)
CW: cell width
CH: cell height
LW: line width
NRL: normal line position
EXT: external line position
INT: internal line position
ML: margin left
MR: margin right
MT: margin top
MB: margin bottom
PL: padding left
PR: padding right
PT: padding top
PB: padding bottom
TW: text width
FA: font ascent
FB: font baseline
FD: font descent';
        $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();
//.........这里部分代码省略.........
开发者ID:fooman,项目名称:tcpdf,代码行数:101,代码来源:Example057Test.php

示例13: btnPrint_Click

 protected function btnPrint_Click()
 {
     if ($this->lstLabelStock->SelectedValue) {
         $this->lstLabelStock->Warning = "";
         set_time_limit(0);
         // If the user clicked Cancel button
         if ($_SESSION["intGeneratingStatus"] != -1) {
             // If the user clicked outside of the modal dialog
             if ($this->dlgPrintLabels->Visible && $this->dlgPrintLabels->Display) {
                 if ($this->intCurrentBarCodeLabel < count($this->strBarCodeArray)) {
                     array_push($this->strTablesBufferArray, $this->CreateTableByBarCodeArray());
                     $this->txtWarning->Text = "Please wait... PDF Generating: " . $_SESSION["intGeneratingStatus"] . "% Complete";
                     $this->txtWarning->Display = true;
                     $this->btnPrint->Enabled = true;
                     QApplication::ExecuteJavaScript("document.getElementById('" . $this->btnPrint->ControlId . "').click();");
                 } else {
                     include_once '../includes/php/tcpdf/config/lang/eng.php';
                     include_once '../includes/php/tcpdf/tcpdf.php';
                     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
                     // Set document information
                     $pdf->SetCreator("Tracmor");
                     $pdf->SetAuthor("Tracmor");
                     $pdf->SetTitle("Bar Codes");
                     // Set PDF viewer preferences
                     $arrPreferences = array('PrintScaling' => 'None');
                     $pdf->setViewerPreferences($arrPreferences);
                     // Disable header and footer
                     $pdf->setPrintHeader(false);
                     $pdf->setPrintFooter(false);
                     // Disable auto page breaks
                     $pdf->SetAutoPageBreak(false);
                     // Set some language-dependent strings
                     $pdf->setLanguageArray($l);
                     // Set the color used for all drawing operations (lines, rectangles and cell borders).
                     $pdf->SetDrawColor(255);
                     // white
                     // Set Cell Padding
                     $pdf->SetCellPadding(0);
                     // Set Cell Spacing
                     $pdf->SetLineWidth(0);
                     // Initialize document
                     $pdf->AliasNbPages();
                     switch ($this->lstLabelStock->SelectedValue) {
                         case 1:
                             // Labels per row for Avery 6577 (5/8" x 3")
                             $pdf->SetFontSize(3);
                             $pdf->setCellHeightRatio(2.3);
                             // was 1.93
                             // Set margins
                             $pdf->SetMargins(12, 12, 12);
                             break;
                         case 2:
                             // Labels per row for Avery 6576 (1-1/4" x 1-3/4")
                             $pdf->SetFontSize(3);
                             $pdf->setCellHeightRatio(11.0);
                             // was 10.2
                             // Set margins
                             $pdf->SetMargins(10, 16, 10);
                             break;
                         default:
                             throw new QCallerException('Label Stock Not Provided');
                             break;
                     }
                     foreach ($this->strTablesBufferArray as $strTableBuffer) {
                         // add a page
                         $pdf->AddPage();
                         // output the HTML content
                         $pdf->writeHTML($strTableBuffer);
                     }
                     // Close and save PDF document
                     $pdf->Output(".." . __TRACMOR_TMP__ . "/" . $_SESSION['intUserAccountId'] . "_BarCodes.pdf", "F");
                     // Cleaning up
                     $this->btnCancel_Click();
                     // Uncheck all items but SelectAll checkbox
                     foreach ($this->GetAllControls() as $objControl) {
                         if (substr($objControl->ControlId, 0, 11) == 'chkSelected') {
                             $objControl->Checked = false;
                         }
                     }
                     $arrDataGridObjectNameId = $this->ctlSearchMenu->GetDataGridObjectNameId();
                     // Uncheck SelectAll checkbox
                     $this->ctlSearchMenu->{$arrDataGridObjectNameId}[0]->chkSelectAll->Checked = false;
                     // Open generated PDF in new window
                     QApplication::ExecuteJavaScript("window.open('.." . __TRACMOR_TMP__ . "/" . $_SESSION['intUserAccountId'] . "_BarCodes.pdf','Barcodes','resizeable,menubar=1,scrollbar=1,left=0,top=0,width=800,height=600');");
                 }
             } else {
                 // Cleaning up
                 $this->btnCancel_Click();
             }
         }
     } else {
         $this->lstLabelStock->Warning = "Please select one";
         $this->lstLabelStock->Enabled = true;
     }
 }
开发者ID:jdellinger,项目名称:tracmor,代码行数:95,代码来源:labels.php

示例14: setAlpha

    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage();
$txt = 'You can set the transparency of PDF objects using the setAlpha() method.';
$pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0);
/*
 * setAlpha() gives transparency support. You can set the
 * alpha channel from 0 (fully transparent) to 1 (fully
 * opaque). It applies to all elements (text, drawings,
 * images).
 */
$pdf->SetLineWidth(2);
// draw opaque red square
$pdf->SetFillColor(255, 0, 0);
$pdf->SetDrawColor(127, 0, 0);
$pdf->Rect(30, 40, 60, 60, 'DF');
// set alpha to semi-transparency
$pdf->SetAlpha(0.5);
// draw green square
$pdf->SetFillColor(0, 255, 0);
$pdf->SetDrawColor(0, 127, 0);
$pdf->Rect(50, 60, 60, 60, 'DF');
// draw blue square
$pdf->SetFillColor(0, 0, 255);
$pdf->SetDrawColor(0, 0, 127);
$pdf->Rect(70, 80, 60, 60, 'DF');
// draw jpeg image
开发者ID:tcsoftwareaustin,项目名称:vint,代码行数:31,代码来源:example_025.php

示例15: display


//.........这里部分代码省略.........
         $this->pdf->Rect($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $style, $arraydata['border'], $arraydata['fillcolor']);
     } elseif ($arraydata["type"] == "RoundedRect") {
         if ($arraydata['mode'] == 'Transparent') {
             $style = '';
         } else {
             $style = 'FD';
         }
         //
         //        $this->pdf->SetLineStyle($arraydata['border']);
         $this->pdf->RoundedRect($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $arraydata["radius"], '1111', $style, $arraydata['border'], $arraydata['fillcolor']);
     } elseif ($arraydata["type"] == "Ellipse") {
         //$this->pdf->SetLineStyle($arraydata['border']);
         $this->pdf->Ellipse($arraydata["x"] + $arraydata["width"] / 2 + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis + $arraydata["height"] / 2, $arraydata["width"] / 2, $arraydata["height"] / 2, 0, 0, 360, 'FD', $arraydata['border'], $arraydata['fillcolor']);
     } elseif ($arraydata["type"] == "Image") {
         //echo $arraydata["path"];
         $path = $this->analyse_expression($arraydata["path"]);
         $imgtype = substr($path, -3);
         $arraydata["link"] = $arraydata["link"] . "";
         if ($imgtype == 'jpg' || right($path, 3) == 'jpg' || right($path, 4) == 'jpeg') {
             $imgtype = "JPEG";
         } elseif ($imgtype == 'png' || $imgtype == 'PNG') {
             $imgtype = "PNG";
         }
         //echo $path;
         if (file_exists($this->imagesPath . $path) || $this->left($path, 4) == 'http') {
             //$path="/Applications/XAMPP/xamppfiles/simbiz/modules/simantz/images/modulepic.jpg";
             //  $path="/simbiz/images/pendingno.png";
             if ($arraydata["link"] == "") {
                 $this->pdf->Image($this->imagesPath . $path, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $imgtype, $arraydata["link"]);
             } else {
                 //                 if($arraydata['linktarget']=='Blank' && strpos($_SERVER['HTTP_USER_AGENT'],"Safari")!==false &&     strpos($_SERVER['HTTP_USER_AGENT'],"Chrome")==false){
                 //                        $href="javascript:window.open('".$arraydata["link"]."');";
                 //                        $imagehtml='<A  href="'.$href.'"><img src="'.$path.'" '.
                 //                                'width="'. $arraydata["width"] .'" height="'.$arraydata["height"].'" ></A>';
                 //                        $this->pdf->writeHTMLCell($arraydata["width"],$arraydata["height"],
                 //                            $arraydata["x"]+$this->arrayPageSetting["leftMargin"],$arraydata["y"]+$y_axis,$imagehtml);
                 //                 }
                 //                else
                 $this->pdf->Image($path, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $imgtype, $arraydata["link"]);
             }
         } elseif ($this->left($path, 22) == "data:image/jpeg;base64") {
             $imgtype = "JPEG";
             $img = str_replace('data:image/jpeg;base64,', '', $path);
             $imgdata = base64_decode($img);
             $this->pdf->Image('@' . $imgdata, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], '', $arraydata["link"]);
         } elseif ($this->left($path, 22) == "data:image/png;base64,") {
             $imgtype = "PNG";
             // $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
             $img = str_replace('data:image/png;base64,', '', $path);
             $imgdata = base64_decode($img);
             $this->pdf->Image('@' . $imgdata, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], '', $arraydata["link"]);
         }
     } elseif ($arraydata["type"] == "SetTextColor") {
         $this->textcolor_r = $arraydata['r'];
         $this->textcolor_g = $arraydata['g'];
         $this->textcolor_b = $arraydata['b'];
         if ($this->hideheader == true && $this->currentband == 'pageHeader') {
             $this->pdf->SetTextColor(100, 33, 30);
         } else {
             $this->pdf->SetTextColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
         }
     } elseif ($arraydata["type"] == "SetDrawColor") {
         $this->drawcolor_r = $arraydata['r'];
         $this->drawcolor_g = $arraydata['g'];
         $this->drawcolor_b = $arraydata['b'];
         $this->pdf->SetDrawColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "SetLineWidth") {
         $this->pdf->SetLineWidth($arraydata["width"]);
     } elseif ($arraydata["type"] == "break") {
     } elseif ($arraydata["type"] == "Line") {
         $printline = false;
         if ($arraydata['printWhenExpression'] == "") {
             $printline = true;
         } else {
             $printline = $this->analyse_expression($arraydata['printWhenExpression']);
         }
         if ($printline) {
             $this->pdf->Line($arraydata["x1"] + $this->arrayPageSetting["leftMargin"], $arraydata["y1"] + $y_axis, $arraydata["x2"] + $this->arrayPageSetting["leftMargin"], $arraydata["y2"] + $y_axis, $arraydata["style"]);
         }
     } elseif ($arraydata["type"] == "SetFillColor") {
         $this->fillcolor_r = $arraydata['r'];
         $this->fillcolor_g = $arraydata['g'];
         $this->fillcolor_b = $arraydata['b'];
         $this->pdf->SetFillColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "lineChart") {
         $this->showLineChart($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "barChart") {
         $this->showBarChart($arraydata, $y_axis, 'barChart');
     } elseif ($arraydata["type"] == "pieChart") {
         $this->showPieChart($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "stackedBarChart") {
         $this->showBarChart($arraydata, $y_axis, 'stackedBarChart');
     } elseif ($arraydata["type"] == "stackedAreaChart") {
         $this->showAreaChart($arraydata, $y_axis, $arraydata["type"]);
     } elseif ($arraydata["type"] == "Barcode") {
         $this->showBarcode($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "CrossTab") {
         $this->showCrossTab($arraydata, $y_axis);
     }
 }
开发者ID:fabiorossetto1,项目名称:phpjasperxml,代码行数:101,代码来源:Report.php


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