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


PHP Pdf::SetAlpha方法代码示例

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


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

示例1: index

 public function index()
 {
     if ($this->input->post('action') != NULL && $this->input->post('action') == 'user_survey') {
         if ($cats = $this->questionnaire_model->get_question_cats()) {
             foreach ($cats as $cat) {
                 $data[$cat->id_questionnaire] = array();
                 if ($questions = $this->questionnaire_model->get_questionnaire($cat->id_questionnaire)) {
                     foreach ($questions as $q) {
                         $data[$cat->id_questionnaire][] = $this->input->post('answer_' . $q->question_no);
                     }
                 }
             }
         }
         $survey_data = serialize($data);
         $created_at = date(DATETIME_DATABASE_FORMAT);
         $table_data = array('id_user' => $this->session->userdata('id_user'), 'survey_data' => $survey_data, 'created_at' => $created_at);
         if ($this->site_model->insert('smg_survey', $table_data)) {
             date_default_timezone_set('Australia/NSW');
             $ImageW = 105;
             //WaterMark Size
             $ImageH = 30;
             $id_user = $this->session->userdata('id_user');
             $display_name = $this->session->userdata('display_name');
             $getOrganization = $this->survey_model->get_organization($id_user);
             $getsurveydetails = $this->survey_model->getsurveydetails($id_user, $created_at);
             $getsurveydetail = unserialize($getsurveydetails);
             $this->load->library('Pdf');
             $pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
             // set document information
             $pdf->SetCreator(PDF_CREATOR);
             $pdf->SetAuthor('AMIT');
             $pdf->SetTitle('SMG Health Survey Report');
             $pdf->SetSubject('Survey Report');
             $pdf->SetKeywords('SMG Health Survey Report ');
             // set header and footer fonts
             $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
             // set default monospaced font
             $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
             // set margins
             $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP - 15, 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);
             }
             $pdf->SetFont('freeserif', '', 48);
             // remove default header
             $pdf->setPrintHeader(false);
             // add a page
             $pdf->AddPage();
             // get the current page break margin
             $bMargin = $pdf->getBreakMargin();
             // get current auto-page-break mode
             $auto_page_break = $pdf->getAutoPageBreak();
             // disable auto-page-break
             $pdf->SetAutoPageBreak(false, 0);
             // set bacground image
             $img_file = Base_url() . 'assets/site/images/coverImage.jpg';
             $pdf->Image($img_file, 0, 0, 210, 297, '', '', '', false, 400, '', false, false, 0);
             // restore auto-page-break status
             $pdf->SetAutoPageBreak($auto_page_break, $bMargin);
             // set the starting point for the page content
             $pdf->setPageMark();
             // Print a text
             $html = '<div style="position: relative; right:0; left:0; text-align:center; padding: 50px 15px;">
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">SMG Health Bounce Back Survey</h1>
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                         <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                         <h1 style="margin: 100px 0 0px; color: #000; font-weight: 500;font-size: 24px; text-transform: capitalize;">' . $getOrganization . '</h1>
                                         <h1 style="margin: 0 0 20px; color: #000; font-weight: 500;font-size: 18px;">' . $created_at . '</h1>
                                     </div>';
             $pdf->writeHTML($html, true, false, true, false, '');
             // ---------------------------------------------------------
             $img_file = Base_url() . 'assets/site/images/innerbanner.jpg';
             $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);
             $pdf->Image($img_file, 0, 0, 210, 47, '', '', '', false, 300, '', false, false, 0);
             $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>
//.........这里部分代码省略.........
开发者ID:subhadip-sahoo,项目名称:codeigniter,代码行数:101,代码来源:Survey.php

示例2: index

    function index()
    {
        date_default_timezone_set('Australia/NSW');
        $ImageW = 105;
        //WaterMark Size
        $ImageH = 30;
        $id_user = $this->uri->segment(2);
        $created_at = urldecode($this->uri->segment(3));
        $display_name = $this->session->userdata('display_name');
        $getOrganization = $this->survey_model->get_organization($id_user);
        $getsurveydetails = $this->survey_model->getsurveydetails($id_user, $created_at);
        $getsurveydetail = unserialize($getsurveydetails);
        $this->load->library('Pdf');
        $pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
        // set document information
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor('AMIT');
        $pdf->SetTitle('SMG Health Survey Report');
        $pdf->SetSubject('Survey Report');
        $pdf->SetKeywords('SMG Health Survey Report ');
        // set header and footer fonts
        $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
        // set default monospaced font
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
        // set margins
        $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP - 15, 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);
        }
        $pdf->SetFont('freeserif', '', 48);
        // remove default header
        $pdf->setPrintHeader(false);
        // add a page
        $pdf->AddPage();
        // get the current page break margin
        $bMargin = $pdf->getBreakMargin();
        // get current auto-page-break mode
        $auto_page_break = $pdf->getAutoPageBreak();
        // disable auto-page-break
        $pdf->SetAutoPageBreak(false, 0);
        // set bacground image
        $img_file = Base_url() . 'assets/site/images/coverImage.jpg';
        $pdf->Image($img_file, 0, 0, 210, 297, '', '', '', false, 400, '', false, false, 0);
        // restore auto-page-break status
        $pdf->SetAutoPageBreak($auto_page_break, $bMargin);
        // set the starting point for the page content
        $pdf->setPageMark();
        // Print a text
        $html = '<div style="position: relative; right:0; left:0; text-align:center; padding: 50px 15px;">
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">SMG Health Bounce Back Survey</h1>
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                    <h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">&nbsp;</h1>
                                    <h1 style="margin: 100px 0 0px; color: #000; font-weight: 500;font-size: 24px; text-transform: capitalize;">' . $getOrganization . '</h1>
                                    <h1 style="margin: 0 0 20px; color: #000; font-weight: 500;font-size: 18px;">' . $created_at . '</h1>
                                </div>';
        $pdf->writeHTML($html, true, false, true, false, '');
        // ---------------------------------------------------------
        $img_file = Base_url() . 'assets/site/images/innerbanner.jpg';
        $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);
        $pdf->Image($img_file, 0, 0, 210, 47, '', '', '', false, 300, '', false, false, 0);
        $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>';
        $content .= '<div style="padding: 30px;">
                                <p style="margin: 0 0 10px;color: #424242;font-weight: 500;font-size: 20px;">Introduction</p>
                                <p>Thank you for completing your Bounce Back Survey. This report provides you with a summary of your results, makes some personalised recommendations and provides you with the tools to create an action plan.</p>
                                <p>Each dimension is presented individually with a description of your results and strategies for strengthening.</p>
                                <p style="margin: 5px 0 10px;color: #424242;font-weight: 500;font-size: 20px;">Understanding Your Report</p>
                                <p>Your report contains a description of the 10 dimensions of resilience for which you were assessed.  Your individual assessment results for each dimension is presented as a flag.  Refer to the table below when reading your report.</p>
                                <p>Red flag: <img src="' . Base_url() . 'assets/site/images/close_icon.jpg" height="25" alt="">
                                &nbsp;&nbsp;&nbsp;Green Flag:<img src="' . Base_url() . 'assets/site/images/tick_icon.jpg" height="25" alt=""></p>
                                <p style="margin: 5px 0 10px; color: #424242; font-weight: 500; font-size: 20px;">Summary of Results</p>
                                <table style="text-align: left;">
                                    <thead>
//.........这里部分代码省略.........
开发者ID:subhadip-sahoo,项目名称:codeigniter,代码行数:101,代码来源:Pdfcreate.php

示例3: generarReporteActividadEvento

    public function generarReporteActividadEvento()
    {
        $idEvento = $this->input->get('idEv');
        $html = null;
        $pdf = new Pdf('L', 'mm', 'Legal', true, 'UTF-8', false);
        $pdf->setPageOrientation('l');
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
        $pdf->SetMargins(PDF_MARGIN_LEFT, 15, PDF_MARGIN_RIGHT);
        $pdf->setHeaderMargin(2);
        $pdf->SetHeaderData('bannerprevengo4.png', 270, 'Gobernacion de Lara', 'Oficina de Personal--División de Planificación y Presupuesto', array(0, 64, 255), array(0, 64, 128));
        $pdf->setFooterMargin(12);
        $pdf->setFooterData();
        $pdf->SetAlpha(1, 'Normal');
        $pdf->Image('imagen/logo/degradado.PNG', 30, 54, 100, 104, '', '', 'N', '', '', 'C');
        // recuperamos la opacidad por defecto
        $pdf->SetAlpha(1, 'Normal');
        $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        $pdf->setFontSubsetting(true);
        $pdf->SetFont('times', '', 12, '', true);
        $pdf->SetFont('Times', 'B', 12);
        $pdf->setPrintHeader(true);
        $pdf->setPrintFooter(true);
        $pdf->AddPage();
        $pdf->SetTextColor('8', '8', '8');
        $pdf->Ln(10);
        $pdf->SetFont('times', '', 11, '', true);
        $ano = date('Y');
        $mesesN = array(1 => "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
        $mes = $mesesN[date('n')];
        $dia = date('d');
        $html .= '
                    <table>
                   
                    <tr colspan="8">
                     
                        <td colspan="8"><p align="rigth"><b>Barquisimeto, ' . $dia . ' de ' . $mes . ' del ' . $ano . '</b></p></td>
                    </tr>
                    </table>';
        $html .= "<h1>Reporte General de Metas alcanzada para las actividades</h1>";
        $condicion = 'evento.id=' . $idEvento;
        $reporte = $this->evento_model->cargarListaEventoSeleccionPDF($condicion);
        if ($reporte->num_rows > 0) {
            foreach ($reporte->result_array() as $fila2) {
                $html .= '
                    <table border="1">
                <tr colspan="4">
                       
                        <td colspan="4" bgColor="#429DED"><p align="center"><b>Evento</b></p></td>
                     
                         
                    </tr>   
                    
                      <tr colspan="4">
                       
                        <td colspan="1" bgColor="#429DED"><p align="center"><b>Titulo</b></p></td>
                        <td colspan="2" bgColor="#429DED"><p align="center"><b>Descripción</b></p></td>
                        <td colspan="1" bgColor="#429DED"><p align="center"><b>Estatus</b></p></td>
                         
                    </tr>


                  <tr colspan="4">
                           
                            <td colspan="1"><p align="center">' . $fila2['titulo'] . '</p></td>
                            <td colspan="2"><p align="center">' . $fila2['descripcion'] . '</p></td>
                            <td colspan="1"><p align="center">' . $fila2['estatus'] . '</p></td>
                        </tr>';
                $reporte2 = $this->actividad_model->cargarMetaPlandeAccionDeEventoPDF($fila2['idEv']);
                $html .= '<tr colspan="4">
                        <td colspan="4" bgColor="#429DED"><p align="center"><b>Plan de Accion</b></p></td>       
                    </tr>';
                if ($reporte2->num_rows > 0) {
                    foreach ($reporte2->result_array() as $fila2) {
                        $html .= '
                    <tr colspan="5">
                        <td colspan="1" bgColor="#00BFFF"><p align="center"><b>Actividad:</b></p></td>
                        <td colspan="1" bgColor="#00BFFF"><p align="center"><b>Meta Propuesta</b></p></td>
                        <td colspan="1" bgColor="#00BFFF"><p align="center"><b>Meta Alcanzada</b></p></td>
                        <td colspan="1" bgColor="#00BFFF"><p align="center"><b>Estatus</b></p></td>
                         
            </tr>       
            
                       <tr colspan="4">
                            <td colspan="1" ><p align="center">' . $fila2['descripcion'] . '</p></td>
                            <td colspan="1" ><p align="center">' . $fila2['metap'] . '</p></td>
                            <td colspan="1" ><p align="center">' . $fila2['metaa'] . '</p></td>
                            <td colspan="1" ><p align="center">' . $fila2['estatus'] . '</p></td>
                           
                        </tr>';
                    }
                } else {
                    $html .= '<tr colspan="4">
                             <td colspan="4"><p align="center"><b> El evento no tiene plan de accion registrado.</b></p></td>    
                        </tr>';
                }
                $html .= '</table>';
                $html .= '<h1></H1>';
            }
        } else {
//.........这里部分代码省略.........
开发者ID:jeicas,项目名称:preveng,代码行数:101,代码来源:reportegeneralMetaActividad.php


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