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


PHP TCPDF::setTextShadow方法代码示例

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


在下文中一共展示了TCPDF::setTextShadow方法的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 001');
        $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 . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
        $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
        // 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 default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        $pdf->SetFont('dejavusans', '', 14, '', true);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $pdf->AddPage();
        // set text shadow effect
        $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
        // Set some content to print
        $html = <<<EOD
<h1>Welcome to <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;">&nbsp;<span style="color:black;">TC</span><span style="color:white;">PDF</span>&nbsp;</a>!</h1>
<i>This is the first example of TCPDF library.</i>
<p>This text is printed using the <i>writeHTMLCell()</i> method but you can also use: <i>Multicell(), writeHTML(), Write(), Cell() and Text()</i>.</p>
<p>Please check the source code documentation and other examples for further information.</p>
<p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>
EOD;
        // Print text using writeHTMLCell()
        $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
        $this->comparePdfs($pdf);
    }
开发者ID:fooman,项目名称:tcpdf,代码行数:53,代码来源:Example001Test.php

示例2: pdfthongkeAction

    public function pdfthongkeAction()
    {
        $translate = Zend_Registry::get('Zend_Translate');
        $this->view->title = 'Thống kê - ' . $translate->_('TEXT_DEFAULT_TITLE');
        $this->view->headTitle($this->view->title);
        $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED;
        $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath);
        Zend_Layout::startMvc($option);
        $date = new Zend_Date();
        $date->subMonth(1);
        $thang = $this->_getParam('thang', $date->toString('M'));
        $nam = $this->_getParam('nam', $date->toString('Y'));
        $auth = Zend_Auth::getInstance();
        $identity = $auth->getIdentity();
        $em_id = $identity->em_id;
        $emModel = new Front_Model_Employees();
        $phongbanModel = new Front_Model_Phongban();
        $my_info = $emModel->fetchRow('em_id=' . $em_id . ' and em_status=1');
        $phong_ban_id = $list_phongban = $phong_ban = array();
        if ($my_info) {
            $phong_ban_id[] = $my_info->em_phong_ban;
            $list_phongban = $phongbanModel->fetchDataStatus($my_info->em_phong_ban, $phong_ban);
        }
        if (sizeof($list_phongban)) {
            foreach ($list_phongban as $phong_ban_info) {
                $phong_ban_id[] = $phong_ban_info->pb_parent;
            }
        }
        $phong_ban_id = implode(',', $phong_ban_id);
        $list_nhan_vien = $emModel->fetchAll("em_phong_ban in ({$phong_ban_id}) and em_status=1");
        $holidaysModel = new Front_Model_Holidays();
        $holidays = $holidaysModel->fetchData();
        $listHoliday = array();
        foreach ($holidays as $holiday) {
            $listHoliday[$holiday['hld_id']] = $holiday['hld_code'];
        }
        $k = 0;
        if ($list_nhan_vien) {
            $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
            $pdf->SetCreator(PDF_CREATOR);
            $pdf->SetAuthor(PDF_AUTHOR);
            $pdf->SetTitle(PDF_HEADER_TITLE);
            $pdf->SetSubject(PDF_HEADER_TITLE);
            $pdf->SetKeywords('bang luong');
            $pdf->setPrintHeader(false);
            $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
            $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
            $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
            $pdf->SetMargins(5, PDF_MARGIN_TOP, 5);
            $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
            $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
            $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
            $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
            $pdf->setFontSubsetting(true);
            $pdf->SetFont('dejavusans', '', 14, '', true);
            $pdf->AddPage('L', 'A4');
            $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
            $text_outout = '
                        <style>
                            .ten-co-quan {
                                color: #000;
                                font-size: 10pt;
                                height: 50px;
                                text-align:center;
                            }
                            .ten-bang-luong{
                                height: 30px;
                                text-align:center;
                                font-size: 10pt;
                            }

                            table.first {
                                color: #003300;
                                font-family: helvetica;
                                font-size: 8pt;
                                border-left: 3px solid red;
                                border-right: 3px solid #FF00FF;
                                border-top: 3px solid green;
                                border-bottom: 3px solid blue;
                                background-color: #ccffcc;
                            }
                            .borders {
                                border: 1px solid #000;
                                font-size: 10px;
                            }

                            .tieu-de{
                                height: 20px;
                                font-size: 11px;
                            }
                            .noi-dung{
                                font-size: 10px;
                            }
                            td.second {
                                border: 2px dashed green;
                            }

                            .lowercase {
                                text-transform: lowercase;
                            }
//.........这里部分代码省略.........
开发者ID:rongandat,项目名称:phanloaicanbo,代码行数:101,代码来源:ThongkethangController.php

示例3: __construct

 public function __construct(TCPDF $pdf, $title, $slogan, $name, $details)
 {
     $pdf->SetTextColor(255, 255, 255);
     $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.5, 'depth_h' => 0.5, 'color' => array(0, 0, 0), 'opacity' => 0.5, 'blend_mode' => 'Multiply'));
     $pdf->SetFont('league-gothic', '', 100, '', true);
     $pdf->writeHTMLCell(170, 200, 20, 40, $this->buildHTML('h1', $title), 0, 1, 0, true, 'C');
     $pdf->SetFont('AlegreyaSans-MediumItalic', '', 55, '', true);
     $pdf->writeHTMLCell(170, 200, 20, 63, $this->buildHTML('p', $slogan, 65), 0, 1, 0, true, 'C');
     $pdf->setTextShadow(array('enabled' => false));
     $pdf->SetFont('AlegreyaSans-ExtraBold', '', 25, '', true);
     $pdf->writeHTMLCell(180, 100, 18, 241, $this->buildHTML('h2', $name, 30), 0, 1, 0);
     $pdf->SetFont('AlegreyaSans-Regular', '', 16, '', true);
     $pdf->writeHTMLCell(180, 100, 18, 254, $this->buildHTML('p', $details, 20), 0, 1, 0);
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:14,代码来源:maria.class.php

示例4: __construct

 public function __construct(TCPDF $pdf, $title, $slogan, $name, $details)
 {
     $pdf->SetTextColor(255, 255, 255);
     $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.5, 'depth_h' => 0.5, 'color' => array(0, 0, 0), 'opacity' => 0.5, 'blend_mode' => 'Multiply'));
     $pdf->SetFont('BubblegumSans', '', 85, '', true);
     $pdf->writeHTMLCell(170, 200, 20, 35, $this->buildHTML('h1', $title), 0, 1, 0, true, 'C');
     $pdf->SetTextColor(247, 220, 102);
     $pdf->SetFont('BubblegumSans', '', 48, '', true);
     $pdf->writeHTMLCell(80, 200, 110, 55, $this->buildHTML('p', $slogan, 58), 0, 1, 0, true, 'C');
     $pdf->SetTextColor(0, 0, 0);
     $pdf->setTextShadow(array('enabled' => false));
     $pdf->SetFont('AlegreyaSans-ExtraBold', '', 25, '', true);
     $pdf->writeHTMLCell(180, 100, 18, 243, $this->buildHTML('h2', $name, 30), 0, 1, 0);
     $pdf->SetFont('AlegreyaSans-Regular', '', 16, '', true);
     $pdf->writeHTMLCell(180, 100, 18, 256, $this->buildHTML('p', $details, 20), 0, 1, 0);
 }
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:16,代码来源:school-games.class.php

示例5: dirname

    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set default font subsetting mode
$pdf->setFontSubsetting(true);
// Set font
// dejavusans is a UTF-8 Unicode font, if you only need to
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
$pdf->SetFont('dejavusans', '', 10, '', true);
// Add a page
// This method has several options, check the source code documentation for more information.
$pdf->AddPage();
// set text shadow effect
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
$con_error = "cannot be connected";
$mysql_host = "localhost";
$mysql_user = "root";
$mysql_pass = "";
$mysql_db = "users";
$ip = $_GET['var'];
$res = explode(',', $ip);
$cno = $res[0];
$fac = $res[1];
$name = $res[2];
if (!mysql_connect($mysql_host, $mysql_user, $mysql_pass) || !mysql_select_db($mysql_db)) {
    die($con_error);
} else {
    $i = 0;
    $j = 0;
开发者ID:manogna1409,项目名称:Course_Feeback_Application,代码行数:31,代码来源:example_002.php

示例6: download_pdf

 protected function download_pdf($html)
 {
     $this->load->library('tcpdf');
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 001');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
     $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     $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(true);
     $pdf->SetFont('dejavusans', '', 14, '', true);
     $pdf->AddPage();
     $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
     $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
     $pdf->Output('example_001.pdf', 'I');
 }
开发者ID:soarmorrow,项目名称:ci-kindergarden,代码行数:32,代码来源:MY_Controller.php

示例7: process

 public function process()
 {
     $context = \CADB\Model\Context::instance();
     if (!$this->params['nid']) {
         Error('단체협약서 번호를 입력하세요.');
     }
     if (!$this->themes) {
         $this->themes = $context->getProperty('service.themes');
     }
     $this->fields = \CADB\Agreement::getFieldInfo(1);
     $this->articles = \CADB\Agreement::getAgreement($this->params['nid'], $this->params['did'] ? $this->params['did'] : 0);
     if (!$this->articles) {
         Error('존재하지 않는 단체협약입니다.');
     }
     \CADB\Log::articleLog('pdf', $this->params['nid'], $this->params['did'] ? $this->params['did'] : 0, "단체협약: [" . $this->articles['subject'] . "]을 PDF 조회했습니다.");
     $pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor($context->getProperty('service.title'));
     $pdf->SetTitle($this->articles['subject']);
     $pdf->SetSubject($this->articles['subject']);
     $pdf->SetKeywords(preg_replace("/[ ]{1,}/i", ", ", $this->article['subject']));
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, $context->getProperty('service.title'), $context->getProperty('service.domain'), array(0, 64, 255), array(0, 64, 128));
     $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
     // 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 default font subsetting mode
     $pdf->setFontSubsetting(true);
     $pdf->SetFont('nanumbarungothic', '', 14, '', true);
     $pdf->AddPage();
     // set text shadow effect
     $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
     $pdf->writeHTMLCell(0, 0, '', '', '<h1>' . $this->articles['subject'] . '</h1><br><br>', 0, 1, 0, true, '', true);
     ob_start();
     $theme_html_file = "";
     if ($this->themes) {
         $theme_html_file = CADB_PATH . "/themes/" . $this->themes . "/articles/pdf.html.php";
         if ($theme_html_file && file_exists($theme_html_file)) {
             include $theme_html_file;
         } else {
             include dirname(__FILE__) . "/pdf.html.php";
         }
     } else {
         include dirname(__FILE__) . "/pdf.html.php";
     }
     $content = ob_get_contents();
     ob_end_clean();
     $pdf->SetFont('nanumbarungothic', '', 12, '', true);
     $pdf->writeHTML($content, true, false, false, false, 'center');
     $pdf->SetFont('nanumbarungothic', '', 14, '', true);
     $pdf->writeHTMLCell(0, 0, '', '', $this->articles['content'], 0, 1, 0, true, '', true);
     $pdf->Output($this->articles['subject'] . '.pdf', 'I');
 }
开发者ID:jinbonetwork,项目名称:collective-agreement-database,代码行数:65,代码来源:pdf.php

示例8: downAction


//.........这里部分代码省略.........
                                 <td>PC thâm niên</td>
                                 <td>' . $tham_nien . ' Năm</td>
                                 <td>' . $hs_pc_tham_nien . '</td>
                                 <td>' . number_format($thanh_tien_pc_tham_nien, 0, '.', ',') . '</td>
                             </tr>
                             <tr>
                                 <td>PC ưu đãi nghề</td>
                                 <td>' . $uu_dai_nghe . '%</td>
                                 <td>' . $hs_pc_uu_dai_nghe . '</td>
                                 <td>' . number_format($thanh_tien_pc_uu_dai_nghe, 0, '.', ',') . '</td>
                             </tr>
                             <tr>
                                 <td>PC công vụ</td>
                                 <td>' . $cong_vu . '%</td>
                                 <td>' . $hs_pc_cong_vu . '</td>
                                 <td>' . number_format($thanh_tien_pc_cong_vu, 0, '.', ',') . '</td>
                             </tr>
                             <tr>
                                 <td>PC kiêm nhiệm</td>
                                 <td colspan="2">' . $hs_pc_kiem_nhiem . '</td>
                                 <td>' . number_format($thanh_tien_pc_kiem_nhiem, 0, '.', ',') . '</td>
                             </tr>
                             <tr>
                                 <td>PC khác</td>
                                 <td colspan="2">' . $hs_pc_khac . ($hs_pc_khac_type ? '%' : '') . '</td>
                                 <td>' . number_format($thanh_tien_pc_khac, 0, '.', ',') . '</td>
                             </tr>
                             <tr>
                                 <td colspan="3">Tổng cộng (I)</td>
                                 <td>' . number_format($tong_1, 0, '.', ',') . '</td>
                             </tr>
                             <tr>
                                 <td>Tỷ lệ tăng thêm</td>
                                 <td colspan="2">' . $hs_tang_them . '</td>
                                 <td>' . number_format($ti_le_tang_them, 0, '.', ',') . '</td>
                             </tr>
                             <tr>
                                 <td colspan="3"><strong>Tổng cộng (II)</strong></td>
                                 <td><strong>' . number_format($tong_2, 0, '.', ',') . '</strong></td>
                             </tr>
                         </table>                            
                     </td>
                 </tr>
                 <tr>
                     <td colspan="3" class="tieu-de"></td>
                 </tr>  
                 ' . $khen_thuong_text_out . '
                 <tr>
                     <td colspan="3" class="tieu-de"></td>
                 </tr> 
                 ' . $ky_luat_text_out . '
                 <tr>
                     <td colspan="3" class="tieu-de"></td>
                 </tr> 
                 <tr>
                     <td colspan="3">
                         <br/>
                         <table border="1" width="100%" class="noi-dung" cellpadding="5" nobr="true">
                             <tr>
                                 <td style="width: 395pt;"><strong>Tổng được nhận = II + III + IV</strong></td>
                                 <td style="width: 100pt;"><strong>' . number_format($tong_cong, 0, '.', ',') . '</strong></td>
                             </tr>
                         </table>
                     </td>
                 </tr>
             </table> 
           ';
         /*
          $mpdf->WriteHTML($text_outout);
          $file_name = $this->loc_tieng_viet($em_info->em_ho) . '_' . $this->loc_tieng_viet($em_info->em_ten) . '_' . $thang . '-' . $nam . '.pdf';
          $mpdf->Output($file_name, 'D');
         */
         $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
         $pdf->SetCreator(PDF_CREATOR);
         $pdf->SetAuthor(PDF_AUTHOR);
         $pdf->SetTitle(PDF_HEADER_TITLE);
         $pdf->SetSubject(PDF_HEADER_TITLE);
         $pdf->SetKeywords('bang luong');
         $pdf->setPrintHeader(false);
         $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
         $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
         $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
         $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);
         $pdf->setFontSubsetting(true);
         $pdf->SetFont('dejavusans', '', 14, '', true);
         $pdf->AddPage();
         $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
         $file_name = $this->loc_tieng_viet($em_info->em_ho) . '_' . $this->loc_tieng_viet($em_info->em_ten) . '_' . $thang . '-' . $nam . '.pdf';
         $pdf->writeHTMLCell(0, 0, '', '', $text_outout, 0, 1, 0, true, '', true);
         // ---------------------------------------------------------
         // Close and output PDF document
         // This method has several options, check the source code documentation for more information.
         $pdf->Output($file_name, 'I');
         die;
     }
 }
开发者ID:rongandat,项目名称:phanloaicanbo,代码行数:101,代码来源:InluongController.php

示例9: create_pdf

    public function create_pdf()
    {
        /**
         * Creates an example PDF TEST document using TCPDF
         * @package com.tecnick.tcpdf
         * @abstract TCPDF - Example: Default Header and Footer
         * @author Nicola Asuni
         * @since 2008-03-04
         */
        // 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('Guadalajara');
        $pdf->SetTitle('Formato Guadalajara');
        $pdf->SetSubject('Formatos Espacios Abiertos');
        $pdf->SetKeywords('Guadalajara, centro_historico');
        // set default header data
        $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, '', '', array(91, 104, 113), array(91, 104, 113));
        $pdf->setFooterData(array(91, 104, 113), array(91, 104, 113));
        // 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 default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        $pdf->SetFont('times', '', 14, '', true);
        // INICIA FORMATO DE DECLARACIÓN PERSONA FÍSICA
        $pdf->AddPage();
        $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
        $html = <<<EOD
    <br>
    <h1>titulo</h1>
    <p style="text-align: right;">texto</p>
    <br>
    <br>

EOD;
        $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
        // TERMINA FORMATO DE DECLARACIÓN PERSONA FÍSICA
        // ---------------------------------------------------------
        // Close and output PDF document
        // This method has several options, check the source code documentation for more information.
        $pdf->Output('formatos_guadalajara.pdf', 'I');
        //============================================================+
        // END OF FILE
        //============================================================+
    }
开发者ID:saulayto,项目名称:gafetes,代码行数:67,代码来源:C_test.php

示例10: actionPDF

 public function actionPDF()
 {
     $session = new CHttpSession();
     $session->open();
     if (isset($session['orderVariations']) && is_array($session['orderVariations']) && count($session['orderVariations']) > 0) {
         require_once Yii::getPathOfAlias('webroot.protected.extensions.pdf.tcpdf') . DIRECTORY_SEPARATOR . 'tcpdf.php';
         $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
         $aOrderVariations = $session['orderVariations'];
         $html_output = '<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><table>';
         $html_output .= '<tr><td colspan="3"></td></tr>';
         $html_output .= '<tr><td colspan="3">' . Yii::t('strings', 'Order products:') . "</td></tr>";
         $html_output .= '<tr><td colspan="3"></td></tr>';
         foreach ($aOrderVariations as $variation_id) {
             $Product2variation = Product2variation::model()->find('variation_id=' . $variation_id);
             if (isset($Product2variation)) {
                 $product = ProductDescription::model()->find('product_id=' . $Product2variation['product_id'] . ' AND language_id=' . $this->language_id);
                 $Variation = Variation::model()->find('variation_id=' . $variation_id);
                 $VariationDescription = VariationDescription::model()->find('variation_id=' . $variation_id . ' AND language_id=' . $this->language_id);
                 $html_output .= '<tr><td colspan="3">' . $product['product_name'] . '</td></tr>';
                 $html_output .= '<tr><td><img src="' . Yii::app()->request->getBaseUrl(true) . '/uploads/images/' . $Variation['variation_image'] . '" alt="product_image" width="100" height="50"/></td>';
                 $html_output .= '<td>' . $VariationDescription['variation_name'] . '<br/>' . $VariationDescription['variation_description'] . "</td></tr>";
                 $html_output .= '<tr><td colspan="3"></td><td></td></tr>';
             }
         }
         $html_output .= '</table></body></html>';
         $pdf->SetHeaderData(PDF_HEADER_LOGO, '', '', '', array(0, 64, 255), array(169, 172, 182));
         $pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
         $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);
         $pdf->setLanguageArray($l);
         $pdf->setFontSubsetting(true);
         $pdf->SetFont('dejavusans', '', 14, '', true);
         $pdf->AddPage();
         $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
         $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html_output, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'L', $autopadding = true);
         $pdf->Output('order.pdf', 'I');
     }
 }
开发者ID:Kostiantin,项目名称:floors,代码行数:41,代码来源:CartController.php

示例11: createPdf

    /** Creates a PDF for the Message
     *
     */
    private function createPdf($user, $uid)
    {
        require_once PATH_INCLUDE . '/pdf/tcpdf/config/lang/ger.php';
        require_once PATH_INCLUDE . '/pdf/tcpdf/tcpdf.php';
        // 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('LeG Uelzen');
        $pdf->SetKeywords('');
        // set default header data
        $pdf->SetHeaderData('../../../res/images/logo.jpg', 15, 'LeG Uelzen', "Abmeldung von: " . $user['forename'] . " " . $user['name'] . " (geb. am " . $user['birthday'] . ")\nKlasse: " . $user['class'], array(0, 0, 0), array(0, 0, 0));
        $pdf->setFooterData($tc = array(0, 0, 0), $lc = array(0, 0, 0));
        // 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 default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        $pdf->SetFont('helvetica', '', 11, '', true);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $pdf->AddPage();
        // set text shadow effect
        $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
        // Set some content to print
        $html = '<p align="center"><h2>R&uuml;ckgabe der LeG-Card / L&ouml;schung der Benutzerdaten</h2></p><br>' . 'Hiermit wird best&auml;tigt, dass die Schulb&uuml;cher von ' . $user['forename'] . ' ' . $user['name'] . ' vollst&auml;ndig zur&uuml;ckgegeben wurden. <br/>
Hiermit wird best&auml;tigt, dass s&auml;mtliche personenbezogenen Daten am ' . date("d.m.Y") . ' aus dem System gel&ouml;scht wurden.<br/>';
        if ($user['credit'] == "0.00") {
            $html .= 'Es liegt kein Restguthaben vor.<br/>';
        } else {
            $html .= 'Es liegt ein Restguthaben in H&ouml;he von ' . $user['credit'] . ' &euro; vor. Dieses muss beim Caterer abgeholt werden.<br/>';
        }
        $html .= 'Mit der R&uuml;ckgabe der LeG-Card kann das Pfandgeld in H&ouml;he von 3,50 &euro; zzgl. 0,50 &euro;, je nach Zustand der H&uuml;lle, ausbezahlt werden.<br/>
Dieses Schreiben wurde maschinell erstellt und ist ohne Unterschrift g&uuml;ltig.
				<hr>
<p align="center"><h3>Auszahlung des Restguthabens</h3></p><br>
Restguthaben in H&ouml;he von ' . $user['credit'] . ' &euro; am ___.___.2013 ausgezahlt.<br><br>
<br>						Unterschrift Caterer
		<br>
		<hr>
<p align="center"><h3>Abschnitt f&uuml;r den Caterer</h3></p><br>
 Restguthaben in H&ouml;he von ' . $user['credit'] . ' &euro; am ___.___.2013 erhalten.<br><br>
		<br><br>Unterschrift ' . $user['forename'] . ' ' . $user['name'] . ' (geb. am ' . $user['birthday'] . ')
		<hr>
<p align="center"><h3>Pfanderstattung</h3></p><br>
Bitte geben Sie diesen Abschnitt im Gnissel-B&uuml;ro im Lessing-Gymnasium ab.<br>
Bitte kreuzen Sie an, ob Sie den Pfandbetrag an die Sch&uuml;lergenossenschaft Gnissel des LeG Uelzen spenden m&ouml;chten
		oder eine &Uuml;berweisung auf ein Bankkonto w&uuml;nschen.<br>

[&nbsp;&nbsp;] Das Pfandgeld m&ouml;chte ich an Gnissel spenden<br>
[&nbsp;&nbsp;] Ich m&ouml;chte das Pfandgeld auf folgendes Konto &uuml;berwiesen haben:<br>
Kontoinhaber:   <br>
Kontonummer:<br>
BLZ:		<br>
Kreditinstitut: <br><br>

Uelzen, den ___.___.2013
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unterschrift ' . $user['forename'] . ' ' . $user['name'] . ' (geb. am ' . $user['birthday'] . ')<br>



		';
        // Print text using writeHTMLCell()
        $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
        // ---------------------------------------------------------
        if (!is_dir('../include/pdf/tempPdf')) {
            mkdir('../include/pdf/tempPdf');
        }
        // Close and output PDF document
        // This method has several options, check the source code documentation for more information.
        $pdf->Output('../include/pdf/tempPdf/deleted_' . $uid . '.pdf', 'F');
        return true;
    }
开发者ID:Auwibana,项目名称:babesk,代码行数:93,代码来源:AdminGDelUserProcessing.php

示例12: TCPDF

    function print_pdf($title, $html_content, $lp, $fsize)
    {
        global $root;
        ob_clean();
        $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
        $usr = $root->query("SELECT `Emri`,`Mbiemri` FROM administrata WHERE User = '" . $_SESSION['username'] . "'");
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor($usr[0]['Emri'] . " " . $usr[0]['Mbiemri']);
        $pdf->SetTitle($title);
        $pdf->SetSubject($title);
        $pdf->SetKeywords($title);
        // set default header data
        $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
        $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
        // 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 default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        $pdf->SetFont('helvetica', '', $fsize, '', true);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $pdf->AddPage($lp, 'A4');
        // set text shadow effect
        $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
        // Set some content to print
        $html = <<<EOD
        {$html_content}
EOD;
        // Print text using writeHTMLCell()
        $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
        // ---------------------------------------------------------
        // Close and output PDF document
        // This method has several options, check the source code documentation for more information.
        $pdf->Output('example_001.pdf', 'I');
        ob_end_clean();
        //============================================================+
        // END OF FILE
        //============================================================+
    }
开发者ID:AlbanMulaki,项目名称:smps-vpa,代码行数:60,代码来源:class_admin.php

示例13: pdf_four

/**
 * 设置PDF文件
 */
function pdf_four()
{
    //包含类文件
    require_once 'tcpdf.php';
    //创建TCPDF对象
    //PDF_PAGE_ORIENTATION: 页面方向横向P纵向L,默认P
    //PDF_UNIT: 档的最小度量单位,点pt/毫米mm/厘米cm/英寸in。(默认为mm)
    //PDF_PAGE_FORMAT: 设置 PDF 页面格式,默认为 A4 纸
    //True:是否为唯一编码格式,true 为是
    //编码格式
    //最后一个参数是:确定是否需要磁盘高速缓存,默认为否
    //false=PDF/X true=PDF/A
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, false);
    //设置文档信息
    $pdf->SetCreator('zhaoning@leju.com');
    $pdf->SetAuthor('Leju');
    $pdf->SetTitle('标题TCPDF');
    $pdf->SetSubject('这是一个生成PDF文件简单的例子');
    $pdf->SetKeywords('TCPDF, PDF, example, 测试, guide');
    //设置页眉和页脚数据
    //204,255,51 绿色
    //255,51,102 红色
    $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'TCPDF header info111', 'www.leju.com', array(0, 64, 255), array(0, 64, 128));
    $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
    //设置页眉和页脚字体
    $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    //设置间距
    //PDF_MARGIN_LEFT 左边距
    //PDF_MARGIN_TOP 顶部距离
    //PDF_MARGIN_RIGHT 右边距
    $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->setFontSubsetting(true);
    //设置字体
    //dejavusans 是 UTF-8 编码字体, 如果你需要输出标准的ASCII字符,你可以使用
    //helvetica 或者 times 减小文件的体积.
    $pdf->SetFont('dejavusans', '', 14, '', true);
    //添加页面
    $pdf->AddPage();
    //设置文字阴影效果
    $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.8, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
    //内容部分
    $html = '
	<h1> Welcome to <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;">&nbsp;<span style="color:black;">TC</span><span style="color:white;">PDF</span>&nbsp;</a>!</h1>
	<i>This is the first example of TCPDF library.</i>
	<p>This text is printed using the <i>writeHTMLCell()</i> method but you can also use: <i>Multicell(), writeHTML(), Write(), Cell() and Text()</i>.</p>
	<p>Please check the source code documentation and other examples for further information.</p>
	<p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>';
    //生成内容
    $pdf->writeHTML($html);
    //输出内容
    $pdf->Output('example.pdf', 'I');
}
开发者ID:zncode,项目名称:codebase,代码行数:63,代码来源:index.php

示例14: ConstructFlightEventsList

 public function ConstructFlightEventsList($extFlightId, $sections = [], $colored = false)
 {
     $flightId = $extFlightId;
     $user = $this->_user->username;
     $Fl = new Flight();
     $flightInfo = $Fl->GetFlightInfo($flightId);
     $bruType = $flightInfo['bruType'];
     unset($Fl);
     $Bru = new Bru();
     $bruInfo = $Bru->GetBruInfo($bruType);
     $flightApHeaders = $Bru->GetBruApHeaders($bruType);
     $flightBpHeaders = $Bru->GetBruBpHeaders($bruType);
     $prefixArr = $Bru->GetBruApCycloPrefixes($bruType);
     unset($Bru);
     $Frame = new Frame();
     $framesCount = $Frame->GetFramesCount($flightInfo['apTableName'], $prefixArr[0]);
     //giving just some prefix
     unset($Frame);
     // create new PDF document
     $pdf = new TCPDF('L', 'mm', 'A4', true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator($user);
     $pdf->SetAuthor($user);
     $pdf->SetTitle('Flight events list');
     $pdf->SetSubject('Flight events list');
     // $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     $bort = $flightInfo['bort'];
     $voyage = $flightInfo['voyage'];
     $copyDate = date('H:i:s d-m-Y', $flightInfo['startCopyTime']);
     $Fr = new Frame();
     $flightDuration = $Fr->FrameCountToDuration($framesCount, $bruInfo['stepLength']);
     unset($Fr);
     $usrInfo = $this->_user->userInfo;
     $headerStr = $usrInfo['company'];
     $imageFile = '';
     if ($colored && $usrInfo['logo'] != '') {
         $imageFile = SITE_ROOT_DIR . '/fileUploader/files/' . uniqid() . '.png';
         file_put_contents($imageFile, $usrInfo['logo']);
         $img = file_get_contents($imageFile);
         $pdf->SetHeaderData('$' . $img, "20", $headerStr, "", [0, 10, 50], [0, 10, 50]);
     } else {
         // set default header data
         $pdf->SetHeaderData("", "", $headerStr, "", [0, 10, 50], [0, 10, 50]);
     }
     $pdf->setFooterData([0, 10, 50], [0, 10, 50]);
     // set header and footer fonts
     $pdf->setHeaderFont(array('dejavusans', '', 11));
     $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 default font subsetting mode
     $pdf->setFontSubsetting(true);
     // Set font
     // dejavusans is a UTF-8 Unicode font, if you only need to
     // print standard ASCII chars, you can use core fonts like
     // helvetica or times to reduce file size.
     $pdf->SetFont('dejavusans', '', 12, '', true);
     // Add a page
     // This method has several options, check the source code documentation for more information.
     $pdf->AddPage();
     if ($imageFile !== '') {
         unlink($imageFile);
     }
     // set text shadow effect
     $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => [196, 196, 196], 'opacity' => 1, 'blend_mode' => 'Normal'));
     // Pasport
     $strStyle = "text-align:center; font-size: xx-large; font-weight: bold; color: rgb(0, 10, 64);";
     $str = '<p style="' . $strStyle . '">' . $this->lang->pasport . '</p>';
     $pdf->writeHTML($str, true, false, false, false, '');
     // Pasport info
     $strStyle = "text-align:center;";
     $str = '<p style="' . $strStyle . '">' . $this->lang->bruType . ' - ' . $bruInfo['bruType'] . '. <br>' . $this->lang->bort . ' - ' . $flightInfo['bort'] . '; ' . $this->lang->voyage . ' - ' . $flightInfo['voyage'] . '; ' . $this->lang->route . ' : ' . ($new_string = preg_replace('/[^a-zA-z0-9]/', '', $flightInfo['departureAirport']) . ' - ' . preg_replace('/[^a-zA-z1-9]/', '', $flightInfo['arrivalAirport']) . '. <br>' . $this->lang->flightDate . ' - ' . date('H:i:s d-m-Y', $flightInfo['startCopyTime']) . '; ' . $this->lang->duration . ' - ' . $flightDuration . '. <br>');
     $fileName = date('Y-m-d_H.i.s', $flightInfo['startCopyTime']) . '_' . $flightInfo['bort'] . '_' . $flightInfo['voyage'] . '_' . $bruInfo['bruType'];
     if (strpos($bruInfo['aditionalInfo'], ";") >= 0) {
         $counterNeedBrake = false;
         $aditionalInfoArr = explode(";", $flightInfo['flightAditionalInfo']);
         foreach ($aditionalInfoArr as $aditionalInfo) {
             if ($aditionalInfo != "") {
                 $nameVal = explode(":", $aditionalInfo);
                 if (count($nameVal) > 1) {
                     $name = $nameVal[0];
                     $val = $nameVal[1];
                     if ($counterNeedBrake) {
                         $str .= (isset($this->lang->{$name}) ? $this->lang->{$name} : $name) . " - " . $val . "; </br>";
                         $counterNeedBrake = !$counterNeedBrake;
                     } else {
                         $str .= (isset($this->lang->{$name}) ? $this->lang->{$name} : $name) . " - " . $val . "; ";
                         $counterNeedBrake = !$counterNeedBrake;
                     }
                 }
             }
//.........这里部分代码省略.........
开发者ID:AlexanderKosianchuk,项目名称:luch,代码行数:101,代码来源:PrinterController.php

示例15: create_pdf

    public function create_pdf()
    {
        //============================================================+
        // File name   : example_001.php
        // Begin       : 2008-03-04
        // Last Update : 2013-05-14
        //
        // Description : Example 001 for TCPDF class
        //               Default Header and Footer
        //
        // Author: Nicola Asuni
        //
        // (c) Copyright:
        //               Nicola Asuni
        //               Tecnick.com LTD
        //               www.tecnick.com
        //               info@tecnick.com
        //============================================================+
        /**
         * Creates an example PDF TEST document using TCPDF
         * @package com.tecnick.tcpdf
         * @abstract TCPDF - Example: Default Header and Footer
         * @author Nicola Asuni
         * @since 2008-03-04
         */
        // 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 001');
        $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 . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
        $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
        // 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 default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        $pdf->SetFont('dejavusans', '', 14, '', true);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $pdf->AddPage();
        // set text shadow effect
        $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
        // Set some content to print
        $html = <<<EOD
   hehe
EOD;
        // Print text using writeHTMLCell()
        $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
        // ---------------------------------------------------------
        // Close and output PDF document
        // This method has several options, check the source code documentation for more information.
        $pdf->Output('example_001.pdf', 'I');
        //============================================================+
        // END OF FILE
        //============================================================+
    }
开发者ID:hoangductho,项目名称:Gravtivy-Start-Project,代码行数:81,代码来源:c_test.php


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