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


PHP Pdf::setTextRenderingMode方法代码示例

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


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

示例1: index


//.........这里部分代码省略.........
                                <table style="text-align: left;">
                                    <thead>
                                        <tr>
                                            <th style="padding:3px; border: solid 1px #e0e0e0; background-color:#18A7A5;color:#fff; width:200px">Name</th>
                                            <th style="padding:3px; border: solid 1px #e0e0e0; background-color:#18A7A5;color:#fff; width:90px">Question 1</th>
                                            <th style="padding:3px; border: solid 1px #e0e0e0; background-color:#18A7A5;color:#fff; width:90px">Question 2</th>
                                            <th style="padding:3px; border: solid 1px #e0e0e0; background-color:#18A7A5;color:#fff; width:90px">Question 3</th>
                                            <th style="padding:3px; border: solid 1px #e0e0e0; background-color:#18A7A5;color:#fff; width:90px">Question 4</th>
                                            <th style="padding:3px; border: solid 1px #e0e0e0; background-color:#18A7A5;color:#fff; width:90px">Total</th>
                                        </tr>
                                    </thead>
                                    <tbody>';
        $grandtotal = 0;
        //$content.='<table cellspacing="0" cellpadding="5" border="1">';
        // $content.='<tr><td width="25%"><strong>Dimension</strong></td><td width="10%"><strong>Score</strong></td><td width="65%"><strong>Comment</strong></td></tr>';
        foreach ($getsurveydetail as $key => $value) {
            $getcategory = $this->survey_model->getcategory($key);
            $getvalue1 = $this->survey_model->getvalue($value[0]);
            $getvalue2 = $this->survey_model->getvalue($value[1]);
            $getvalue3 = $this->survey_model->getvalue($value[2]);
            $getvalue4 = $this->survey_model->getvalue($value[3]);
            $getQuestion = $this->survey_model->getQuestion($value[3]);
            $total = $getvalue1 + $getvalue2 + $getvalue3 + $getvalue4;
            $grandtotal = $grandtotal + $total;
            $content .= '
                                        <tr>
                                            <td style="padding:3px; border: solid 1px #e0e0e0; background-color:#f5f5f5; width:200px">' . $getQuestion . '</td>
                                            <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $getvalue1 . '</td>
                                            <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $getvalue2 . '</td>
                                            <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $getvalue3 . '</td>
                                            <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $getvalue4 . '</td>
                                            <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $total . '</td>
                                        </tr>';
        }
        $content .= '               </tbody>
                                    <tfoot>
                                        <tr>
                                            <td style="padding:3px; border: solid 1px #e0e0e0;" colspan="5"></td>
                                            <td style="padding:3px; border: solid 1px #e0e0e0;background-color:#B72529; color:#fff;">' . $grandtotal . '</td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>';
        // $content.='<p style="padding: 75px 15px 0;text-align:center; border-top: solid 1px #E0E0E0; font-size: 10px;">&nbsp;<br>© 2016. SMG Health. All rights reserved.</p>';
        $pdf->SetFont('freeserif', '', 12);
        $pdf->setTextRenderingMode($stroke = 0, $fill = true, $clip = false);
        //$pdf->writeHTMLCell(0, 10, '© 2016. SMG Health. All rights reserved.', 0, false, 'C', 0, '', 0, false, 'T', 'M');
        $pdf->writeHTML($content, true, false, false, false, '');
        foreach ($getsurveydetail as $key => $value) {
            $getcategory = $this->survey_model->getcategory($key);
            $getvalue1 = $this->survey_model->getvalue($value[0]);
            $getvalue2 = $this->survey_model->getvalue($value[1]);
            $getvalue3 = $this->survey_model->getvalue($value[2]);
            $getvalue4 = $this->survey_model->getvalue($value[3]);
            $getQuestion = $this->survey_model->getQuestion($value[3]);
            $total = $getvalue1 + $getvalue2 + $getvalue3 + $getvalue4;
            $getFeedback = $this->survey_model->getFeedback($getQuestion, $total);
            $pdf->AddPage();
            $myPageWidth = $pdf->getPageWidth();
            $myPageHeight = $pdf->getPageHeight();
            $myX = $myPageWidth / 2 - 50;
            $myY = $myPageHeight / 2 - 40;
            $pdf->SetAlpha(0.09);
            $pdf->Image(Base_url() . 'assets/site/images/dase_logo.png', $myX, $myY, $ImageW, $ImageH, '', '', '', true, 150);
            $pdf->SetAlpha(1);
            // set the starting point for the page content
            $pdf->setPageMark();
            $pdf->Image($img_file, 0, 0, 210, 47, '', '', '', false, 300, '', false, false, 0);
            // set color for text stroke
            $pdf->SetDrawColor(255, 0, 0);
            $content = '<table cellspacing="0" cellpadding="0">
                <tr><td><img title="" alt="" src="' . Base_url() . 'assets/site/images/dase_logo.png"></td></tr>
                <tr><td>' . $display_name . '</td></tr>
                <tr><td>' . $created_at . '</td></tr>
                <tr><td>&nbsp;</td></tr>
                <tr><td>&nbsp;</td></tr>
            </table>';
            if ($total > 13) {
                $icon = "tick_icon.jpg";
            } else {
                $icon = "close_icon.jpg";
            }
            $content .= '<div style="padding: 30px;">
                        <p style="margin: 0 0 10px;color: #424242;font-weight: 500;font-size: 20px;">Interpretation of scores</p>';
            $content .= '<div style="padding:0 0 30px;">
                                    <h3 style="margin: 0 0 5px;color: #18A7A5;font-weight: 700;font-size: 24px;"><span style="display:inline-block; width:200px; color: #ADADAD; font-weight:500;">Dimension :</span>' . $getQuestion . '</h3>
                                    <h3 style="margin: 0 0 5px;color: #18A7A5;font-weight: 700;font-size: 24px;"><span style="display:inline-block; width:200px; color: #ADADAD; font-weight:500;">Score :</span>' . $total . '</h3>
                                    <h3 style="margin: 0 0 5px;color: #18A7A5;font-weight: 700;font-size: 24px;"><span style="display:inline-block; width:200px; color: #ADADAD; font-weight:500;">Comment :</span><img src="' . Base_url() . 'assets/site/images/' . $icon . '" alt=""></h3>
                                    <div style="margin-left:200px;">
                                        ' . $getFeedback . '
                                    </div>
                                </div>
';
            $pdf->SetFont('freeserif', '', 12);
            $pdf->setTextRenderingMode($stroke = 0, $fill = true, $clip = false);
            //$pdf->writeHTMLCell(0, 10, '© 2016. SMG Health. All rights reserved.', 0, false, 'C', 0, '', 0, false, 'T', 'M');
            $pdf->writeHTML($content, true, false, false, false, '');
        }
        $pdf->Output('example.pdf', 'I');
    }
开发者ID:subhadip-sahoo,项目名称:codeigniter,代码行数:101,代码来源:Pdfcreate.php

示例2: index


//.........这里部分代码省略.........
             $grandtotal = 0;
             //$content.='<table cellspacing="0" cellpadding="5" border="1">';
             // $content.='<tr><td width="25%"><strong>Dimension</strong></td><td width="10%"><strong>Score</strong></td><td width="65%"><strong>Comment</strong></td></tr>';
             foreach ($getsurveydetail as $key => $value) {
                 $getcategory = $this->survey_model->getcategory($key);
                 $getvalue1 = $this->survey_model->getvalue($value[0]);
                 $getvalue2 = $this->survey_model->getvalue($value[1]);
                 $getvalue3 = $this->survey_model->getvalue($value[2]);
                 $getvalue4 = $this->survey_model->getvalue($value[3]);
                 $getQuestion = $this->survey_model->getQuestion($value[3]);
                 $total = $getvalue1 + $getvalue2 + $getvalue3 + $getvalue4;
                 $grandtotal = $grandtotal + $total;
                 $content .= '
                                             <tr>
                                                 <td style="padding:3px; border: solid 1px #e0e0e0; background-color:#f5f5f5; width:200px">' . $getQuestion . '</td>
                                                 <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $getvalue1 . '</td>
                                                 <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $getvalue2 . '</td>
                                                 <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $getvalue3 . '</td>
                                                 <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $getvalue4 . '</td>
                                                 <td style="padding:3px; border: solid 1px #e0e0e0; width:90px">' . $total . '</td>
                                             </tr>';
             }
             $content .= '               </tbody>
                                         <tfoot>
                                             <tr>
                                                 <td style="padding:3px; border: solid 1px #e0e0e0;" colspan="5"></td>
                                                 <td style="padding:3px; border: solid 1px #e0e0e0;background-color:#B72529; color:#fff;">' . $grandtotal . '</td>
                                             </tr>
                                         </tfoot>
                                     </table>
                                 </div>';
             // $content.='<p style="padding: 75px 15px 0;text-align:center; border-top: solid 1px #E0E0E0; font-size: 10px;">&nbsp;<br>© 2016. SMG Health. All rights reserved.</p>';
             $pdf->SetFont('freeserif', '', 12);
             $pdf->setTextRenderingMode($stroke = 0, $fill = true, $clip = false);
             //$pdf->writeHTMLCell(0, 10, '© 2016. SMG Health. All rights reserved.', 0, false, 'C', 0, '', 0, false, 'T', 'M');
             $pdf->writeHTML($content, true, false, false, false, '');
             foreach ($getsurveydetail as $key => $value) {
                 $getcategory = $this->survey_model->getcategory($key);
                 $getvalue1 = $this->survey_model->getvalue($value[0]);
                 $getvalue2 = $this->survey_model->getvalue($value[1]);
                 $getvalue3 = $this->survey_model->getvalue($value[2]);
                 $getvalue4 = $this->survey_model->getvalue($value[3]);
                 $getQuestion = $this->survey_model->getQuestion($value[3]);
                 $total = $getvalue1 + $getvalue2 + $getvalue3 + $getvalue4;
                 $getFeedback = $this->survey_model->getFeedback($getQuestion, $total);
                 $pdf->AddPage();
                 $myPageWidth = $pdf->getPageWidth();
                 $myPageHeight = $pdf->getPageHeight();
                 $myX = $myPageWidth / 2 - 50;
                 $myY = $myPageHeight / 2 - 40;
                 $pdf->SetAlpha(0.09);
                 $pdf->Image(Base_url() . 'assets/site/images/dase_logo.png', $myX, $myY, $ImageW, $ImageH, '', '', '', true, 150);
                 $pdf->SetAlpha(1);
                 // set the starting point for the page content
                 $pdf->setPageMark();
                 $pdf->Image($img_file, 0, 0, 210, 47, '', '', '', false, 300, '', false, false, 0);
                 // set color for text stroke
                 $pdf->SetDrawColor(255, 0, 0);
                 $content = '<table cellspacing="0" cellpadding="0">
                     <tr><td><img title="" alt="" src="' . Base_url() . 'assets/site/images/dase_logo.png"></td></tr>
                     <tr><td>' . $display_name . '</td></tr>
                     <tr><td>' . $created_at . '</td></tr>
                     <tr><td>&nbsp;</td></tr>
                     <tr><td>&nbsp;</td></tr>
                 </table>';
                 if ($total > 13) {
开发者ID:subhadip-sahoo,项目名称:codeigniter,代码行数:67,代码来源:Survey.php


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