public function Pdfcreation()
 {
     $USERSTAMP = $this->Mdl_eilib_common_function->getSessionUserStamp();
     $this->load->library('pdf');
     $pdfresult = '';
     $custname = $this->input->get('custname');
     $custid = $this->input->get('custnameid');
     $unitno = $this->input->get('unitno');
     $cardno = $this->input->get('cardno');
     $option = $this->input->get('option');
     $pdfresult = $this->Mdl_access_card_view->Pdf_creation($custid, $unitno, $cardno, $option, $USERSTAMP);
     $pdfheader = '';
     if ($option == 18) {
         $pdfheader = 'ACCESS CARD DETAIL FOR CARD NO ' . $cardno;
     } else {
         if ($option == 21) {
             $pdfheader = 'ACCESS CARD DETAIL FOR CUSTOMER ' . $custname;
         } else {
             if ($option == 31) {
                 $pdfheader = 'ACCESS CARD DETAILS FOR THE UNIT NUMBER ' . $unitno;
             } else {
                 if ($option == 40) {
                     $pdfheader = 'ACCESS CARD DETAILS FOR ALL UNITS';
                 }
             }
         }
     }
     $pdf = $this->pdf->load();
     $pdf = new mPDF('utf-8', 'A4');
     $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">' . $pdfheader . '</div>', 'O', true);
     $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
     $pdf->WriteHTML($pdfresult);
     $pdf->Output($pdfheader . '.pdf', 'D');
 }
 private function printRelatorioHTMLPDF($html)
 {
     $this->getContext()->getConfiguration()->loadHelpers('Partial');
     $mpdf = new mPDF('', 'A4', '', '', 5, 5, 37, 37, 3, 3);
     $mpdf->useOnlyCoreFonts = true;
     // false is default
     $mpdf->SetWatermarkText("PÉROLA NEGRA");
     $mpdf->showWatermarkText = true;
     $mpdf->watermark_font = 'DejaVuSansCondensed';
     $mpdf->watermarkTextAlpha = 0.1;
     $mpdf->SetDisplayMode('fullpage');
     $stylesheet = file_get_contents('css/relatorios.css');
     $mpdf->WriteHTML($stylesheet, 1);
     $mpdf->SetHTMLHeader(utf8_encode(get_partial('header')));
     $mpdf->SetHTMLFooter(utf8_encode(get_partial('footer')));
     $mpdf->SetMargins(0, 0, 65);
     $mpdf->WriteHTML(utf8_encode($html));
     $mpdf->Output();
 }
 /**
  * @param $path
  * @param $print_portrait
  * @param $print_paper_size
  * @param $labels
  * @return bool|string
  */
 public function explodePDF($path, $print_portrait, $print_paper_size, $labels)
 {
     ini_set('memory_limit', '1024M');
     if (!is_file($path)) {
         return false;
     }
     $isPortrait = $print_portrait;
     $paperSize = in_array($print_paper_size, ['A2', 'A3', 'A4', 'A5']) ? $print_paper_size : 'A4';
     $pdfInfo = $this->pdfInfo($path);
     if (!$pdfInfo) {
         return false;
     }
     $pdfSize = array_map(function ($item) {
         return trim((int) $item);
     }, explode('x', $pdfInfo['Page size']));
     $pdfSize['w'] = $pdfSize[0] * 0.75;
     $pdfSize['h'] = $pdfSize[1] * 0.75;
     $paperSizes = ['A2' => ['w' => 420, 'h' => 594], 'A3' => ['w' => 297, 'h' => 420], 'A4' => ['w' => 210, 'h' => 297], 'A5' => ['w' => 148, 'h' => 210]];
     include dirname(__DIR__) . "/lib/mpdf/mpdf.php";
     $mgl = 10;
     $mgr = 10;
     $mgt = 20 + 10;
     $mgb = 5 + 10;
     $mgh = 9;
     $mgf = 9;
     if ($isPortrait) {
         $mgl = 20;
         $mgr = 10;
         $mgt = 5 + 10;
         $mgb = 5 + 10;
         $mgh = 9;
         $mgf = 9;
     }
     $mpdf = new \mPDF('c', $paperSize . ($isPortrait ? '-P' : '-L'));
     $mpdf->SetImportUse();
     $mpdf->SetDisplayMode('fullpage');
     $mpdf->SetCompression(true);
     //$mpdf->SetAutoPageBreak(true);
     $mpdf->mirrorMargins = true;
     $source = $mpdf->SetSourceFile($path);
     $page_w = $isPortrait ? $paperSizes[$paperSize]['w'] : $paperSizes[$paperSize]['h'];
     $page_h = $isPortrait ? $paperSizes[$paperSize]['h'] : $paperSizes[$paperSize]['w'];
     $iter_w = ceil($pdfSize['w'] / $page_w / 2);
     $iter_h = ceil($pdfSize['h'] / $page_h / 1);
     $crop_x = 0;
     $crop_y = 0;
     $head_left = isset($labels['head_left']) ? $labels['head_left'] : '';
     $head_center = isset($labels['head_center']) ? $labels['head_center'] : '';
     $head_right = isset($labels['head_right']) ? $labels['head_right'] : '';
     $footer_left = isset($labels['footer_left']) ? $labels['footer_left'] : '';
     $footer_center = isset($labels['footer_center']) ? $labels['footer_center'] : '';
     $footer_right = isset($labels['footer_right']) ? $labels['footer_right'] : '';
     $header = '
         <table width="100%" style="vertical-align: bottom; font-size: 12pt; font-weight: bold"><tr>
         <td width="33%">' . $head_left . '</td>
         <td width="33%" align="center">' . $head_center . '</td>
         <td width="33%" style="text-align: right;">' . $head_right . '</td>
         </tr></table>
         ';
     $footer = '
         <table width="100%" style="vertical-align: bottom; font-size: 12pt; font-weight: bold"><tr>
         <td width="33%">' . $footer_left . '</td>
         <td width="33%" align="center">' . $footer_center . '</td>
         <td width="33%" style="text-align: right;">' . $footer_right . '</td>
         </tr></table>
         ';
     $mpdf->SetHTMLHeader($header);
     $mpdf->SetHTMLHeader($header, 'E');
     $mpdf->SetHTMLFooter($footer);
     $mpdf->SetHTMLFooter($footer, 'E');
     for ($i = 0; $i < $iter_w; $i++) {
         if ($i > 0) {
             $mpdf->AddPage();
         }
         // '', '', '', '', '', $mgl, $mgr, $mgt, $mgb, $mgh, $mgf
         $tpl = $mpdf->ImportPage($source, $crop_x, $crop_y, $page_w - ($mgl + $mgr), $page_h - ($mgt + $mgb));
         $mpdf->UseTemplate($tpl, $mgl, $mgt);
         if ($iter_h > 2) {
             $mpdf->AddPage();
             $tpl = $mpdf->ImportPage($source, $crop_x, $crop_y, $page_w - ($mgl + $mgr), $page_h - ($mgt + $mgb));
             $mpdf->UseTemplate($tpl, $mgl, $mgt);
         }
         $crop_x += $page_w - ($mgl + $mgr);
     }
     $mpdf->Output($path . 'gen.pdf', 'F');
     return $path . 'gen.pdf';
 }
 public function BankttPdfCreation()
 {
     $UserStamp=$this->Mdl_eilib_common_function->getSessionUserStamp();
     $timeZoneFormat= $this->Mdl_eilib_common_function->getTimezone();
     $option=$_GET['Searchoption'];
     $unit=$_GET['Frominput'];
     $customer=$_GET['Todate'];
     $header=$_GET['Header'];
     $SearchResults=$this->Mdl_ocbc_banktt_entry->Banktt_PDF_SearchResults($option,$UserStamp,$timeZoneFormat,$unit,$customer);
     $this->load->library('pdf');
     $pdf = $this->pdf->load();
     $pdf=new mPDF('utf-8','A4');
     $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$header.'</div>', 'O', true);
     $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
     $pdf->WriteHTML($SearchResults);
     $pdf->Output('BANK TT DETAILS.pdf', 'D');
 }
Example #5
1
function pdf_create($html, $filename, $stream = true, $textoMarcaDagua = null, $path = null, $css = null, $idEmissor = null, $orientacao = null)
{
    $arrayParams = array();
    require_once APPPATH . 'helpers/mpdf/mpdf.php';
    $CI =& get_instance();
    $CI->load->model('comum/empresas_model', 'empresas_model');
    $paramVariaveis = 'relatorio_variaveis_padrao';
    $paramModelo = 'relatorio_modelo_padrao';
    if ($CI->session->userdata('idEmissor') != null) {
        $arrayParams = $CI->empresas_model->getParametros($CI->session->userdata('idEmissor'));
    } elseif ($idEmissor != null) {
        $arrayParams = $CI->empresas_model->getParametros($idEmissor);
    } else {
        $arrayParams = $CI->empresas_model->getParametros($CI->usuariologado->getIdEmpresa());
    }
    $mpdf = new mPDF('c', $orientacao == 'L' ? 'A4-L' : '', 9, 'Verdana', 18, 18, 35, 20, 0, 10, $orientacao);
    $mpdf->SetTitle($filename);
    $mpdf->SetHTMLHeader($CI->load->view('pdfHeader', null, true));
    $mpdf->SetHTMLFooter($CI->load->view('pdfFooter', null, true));
    if (!empty($css)) {
        $mpdf->WriteHTML(file_get_contents($css), 1);
    } else {
        $mpdf->WriteHTML(file_get_contents('assets/css/report.css'), 1);
    }
    if ($textoMarcaDagua != null) {
        $mpdf->SetWatermarkText($textoMarcaDagua);
        $mpdf->showWatermarkText = true;
    }
    $mpdf->WriteHTML($html, 2);
    $mpdf->SetAutoFont();
    if ($path !== '' && $path !== null) {
        if (!file_exists($path)) {
            mkdir($path, 0777, true);
        }
    }
    if ($stream) {
        $mpdf->Output($path . DS . $filename . '.pdf', 'F');
    } else {
        $mpdf->Output();
    }
}
 function getClientes()
 {
     $clientes = Clientes::orderBy('nombres')->orderBy('apellidos')->get();
     $reporte = new Reporte("Lista de clientes");
     $filas = "";
     if ($clientes->count() == 0) {
         $tabla = '<div style="text-align:center"><p>Sin datos para mostrar</p></div>';
     } else {
         $cont = 0;
         foreach ($clientes as $item) {
             $cont++;
             $mod = $cont % 2 == 0;
             if ($mod == 1) {
                 $filas .= '<tr>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: center;">' . $item->identificacion . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: left;">' . $item->nombres . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: left;">' . $item->apellidos . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: left;">' . $item->correo . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: left;">' . $item->direccion . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: center;">' . $item->telefono . '</td>' . '</tr>';
             } else {
                 $filas .= '<tr>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: center;">' . $item->identificacion . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: left;">' . $item->nombres . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: left;">' . $item->apellidos . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: left;">' . $item->correo . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: left;">' . $item->direccion . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: center;">' . $item->telefono . '</td>' . '</tr>';
             }
         }
         $columnas = array('Identificaci&#243;n', 'Nombres', 'Apellidos', 'Correo', 'Direcci&#243;n', 'Tel&#233;fono');
         $tabla = $reporte->getTable($columnas, $filas);
     }
     $mpdf = new \mPDF('utf-8', 'A4-L', '', '', '15', '15', '28', '18');
     $mpdf->SetTitle("Reporte");
     $mpdf->SetHTMLHeader($reporte->getHeader());
     $mpdf->SetHTMLFooter($reporte->getFooter());
     $mpdf->WriteHTML($tabla);
     $mpdf->Output('reporte.pdf', 'I');
 }
 function getUsuarios()
 {
     $usuarios = User::orderBy('type')->orderBy('name')->get();
     $reporte = new Reporte("Lista de usuarios");
     $filas = "";
     if ($usuarios->count() == 0) {
         $tabla = '<div style="text-align:center"><p>Sin datos para mostrar</p></div>';
     } else {
         $cont = 0;
         foreach ($usuarios as $item) {
             $cont++;
             $mod = $cont % 2 == 0;
             if ($mod == 1) {
                 $filas .= '<tr>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: left;">' . $item->name . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: center;">' . $item->username . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: left;">' . $item->email . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: center;">' . $item->type . '</td>' . '</tr>';
             } else {
                 $filas .= '<tr>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: left;">' . $item->name . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: center;">' . $item->username . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: left;">' . $item->email . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: center;">' . $item->type . '</td>' . '</tr>';
             }
         }
         $columnas = array('Nombres', 'Usuario', 'Correo', 'Tipo');
         $tabla = $reporte->getTable($columnas, $filas);
     }
     $mpdf = new \mPDF('utf-8', 'A4', '', '', '15', '15', '28', '18');
     $mpdf->SetTitle("Reporte");
     $mpdf->SetHTMLHeader($reporte->getHeader());
     $mpdf->SetHTMLFooter($reporte->getFooter());
     $mpdf->WriteHTML($tabla);
     $mpdf->Output('reporte.pdf', 'I');
 }
 public function getCuentas()
 {
     $facturas = CuentasxpagarModel::where("estado_activo", "=", 1)->join('proveedores', 'proveedores.id', '=', 'cuentasxpagar.proveedor_id')->groupBy('proveedor_id')->select(DB::raw('count(*) as contador, proveedores.identificacion, proveedores.nombres, Sum(saldo) as monto, proveedor_id'))->orderby('proveedores.nombres')->get();
     $reporte = new Reporte("Cuentas por pagar");
     $filas = "";
     if ($facturas->count() == 0) {
         $tabla = '<div style="text-align:center"><p>Sin datos para mostrar</p></div>';
     } else {
         $cont = 0;
         foreach ($facturas as $item) {
             $cont++;
             $mod = $cont % 2 == 0;
             if ($mod == 1) {
                 $filas .= '<tr>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: center;">' . $item->identificacion . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: center;">' . $item->nombres . ' ' . $item->apellidos . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: center;">' . $item->contador . '</td>' . '<td style="background: #E8EDFF; color: #1E252B; font-size: 12px; text-align: center;">' . $item->monto . '</td>' . '</tr>';
             } else {
                 $filas .= '<tr>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: center;">' . $item->identificacion . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: center;">' . $item->nombres . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: center;">' . $item->contador . '</td>' . '<td style="background: #F5F5F5; color: #1E252B; font-size: 12px; text-align: center;">' . $item->monto . '</td>' . '</tr>';
             }
         }
         $columnas = array('Identificaci&#243;n', 'Proveedores', 'Facturas', 'Total');
         $tabla = $reporte->getTable($columnas, $filas);
     }
     $mpdf = new \mPDF('utf-8', 'A4', '', '', '15', '15', '28', '18');
     $mpdf->SetTitle("Reporte");
     $mpdf->SetHTMLHeader($reporte->getHeader());
     $mpdf->SetHTMLFooter($reporte->getFooter());
     $mpdf->WriteHTML($tabla);
     $mpdf->Output('reporte.pdf', 'I');
 }
 /**
  * Generates the invoice with MPDF lib.
  * @param $dest
  * @return string
  */
 protected function generate($html_sections, $dest, $paid)
 {
     set_time_limit(0);
     $mpdf_filename = BEWPI_LIB_DIR . 'mpdf/mpdf.php';
     include $mpdf_filename;
     $mpdf_options = $this->get_mpdf_options();
     $mpdf = new mPDF($mpdf_options['mode'], $mpdf_options['format'], $mpdf_options['default_font_size'], $mpdf_options['default_font'], $mpdf_options['margin_left'], $mpdf_options['margin_right'], $mpdf_options['margin_top'], $mpdf_options['margin_bottom'], $mpdf_options['margin_header'], $mpdf_options['margin_footer'], $mpdf_options['orientation']);
     $mpdf->useOnlyCoreFonts = false;
     // false is default
     if ((bool) $this->template_options['bewpi_show_payment_status'] && $paid) {
         $mpdf->SetWatermarkText(__('Paid', 'woocommerce-pdf-invoices'));
         $mpdf->showWatermarkText = true;
     }
     $mpdf->SetDisplayMode('fullpage');
     //$mpdf->useSubstitutions = true;
     $mpdf->autoScriptToLang = true;
     $mpdf->autoLangToFont = true;
     $mpdf->setAutoTopMargin = 'stretch';
     $mpdf->setAutoBottomMargin = 'stretch';
     $mpdf->autoMarginPadding = 10;
     //$mpdf->debug = true;
     //$mpdf->showImageErrors = true;
     if (!empty($html_sections['header'])) {
         $mpdf->SetHTMLHeader($html_sections['header']);
     }
     if (!empty($html_sections['footer'])) {
         $mpdf->SetHTMLFooter($html_sections['footer']);
     }
     $mpdf->WriteHTML($html_sections['style'] . $html_sections['body']);
     $mpdf = apply_filters('bewpi_mpdf', $mpdf);
     $mpdf->Output($dest === 'F' ? $this->full_path : $this->filename, $dest);
 }
Example #10
0
 public function getMpdfInstance()
 {
     $mpdf = new \mPDF($this->options['encoding'], $this->options['format'], $this->options['font-size'], $this->options['font'], $this->options['margin-left'], $this->options['margin-right'], $this->options['margin-top'], $this->options['margin-bottom'], $this->options['margin-header'], $this->options['margin-footer'], $this->options['orientation']);
     if ($this->footer !== NULL) {
         $mpdf->SetHTMLFooter($this->footer);
     }
     if ($this->header !== NULL) {
         $mpdf->SetHTMLHeader($this->header);
     }
     return $mpdf;
 }
 public function DCSU_tablepdf(){
     $timeZoneFrmt= $this->Mdl_eilib_common_function->getTimezone();
     $unitno=$this->input->get("DCSUunitno");
     $pdfresult=$this->Mdl_unit_door_code_search_update->DCSU_table_pdf($unitno,$timeZoneFrmt);
     $pdfheader='DOOR CODE LOGIN DETAILS FOR THE UNIT NUMBER '.$unitno;
     $this->load->library('pdf');
     $pdf = $this->pdf->load();
     $pdf=new mPDF('utf-8','A4');
     $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$pdfheader.'</div>', 'O', true);
     $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
     $pdf->WriteHTML($pdfresult);
     $pdf->Output($pdfheader.'.pdf', 'D');
 }
Example #12
0
 public function OCBCPdfCreation()
 {
     $Period=$_GET['Period'];
     $SubmittedData=$this->Mdl_ocbc_ocbc->OCBC_PDF_Creation($Period);
     $header='OCBC RECORDS-'.strtoupper($Period);
     $this->load->library('pdf');
     $pdf = $this->pdf->load();
     $pdf=new mPDF('utf-8','A4');
     $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$header.'</div>', 'O', true);
     $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
     $pdf->WriteHTML($SubmittedData);
     $pdf->Output($header.'.pdf', 'D');
 }
 public function ModelPdfCreation()
 {
     $header=$_GET['Header'];
     $timeZoneFormat= $this->Mdl_eilib_common_function->getTimezone();
     $AllmodelDetails=$this->Mdl_ocbc_model_entry_search_update->PDF_AllModels_Details($timeZoneFormat);
     $this->load->library('pdf');
     $pdf = $this->pdf->load();
     $pdf=new mPDF('utf-8','A4');
     $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$header.'</div>', 'O', true);
     $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
     $pdf->WriteHTML($AllmodelDetails);
     $pdf->Output($header.'.pdf', 'D');
 }
 public function User_Details_pdf(){
     $UserStamp=$this->Mdl_eilib_common_function->getSessionUserStamp();
     $timeZoneFormat=$this->Mdl_eilib_common_function->getTimezone();
     $this->load->library('pdf');
     $pdfresult='';
     $pdfresult=$this->Mdl_access_rights_user_search_details->User_Details_pdf($timeZoneFormat);
     $pdfheader='USER SEARCH DETAILS';
     $pdf = $this->pdf->load();
     $pdf=new mPDF('utf-8','A4');
     $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$pdfheader.'</div>', 'O', true);
     $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
     $pdf->WriteHTML($pdfresult);
     $pdf->Output($pdfheader.'.pdf', 'D');
 }
    public  function EMPLOYEE_pdf(){

        $timeZoneFormat=$this->Mdl_eilib_common_function->getTimezone();
        $this->load->library('pdf');
        $pdfresult='';
        $pdfresult=$this->Mdl_staff_employee_entry_search_update_delete->Employee_pdf($timeZoneFormat,$_GET['EMPSRC_UPD_DEL_lb_designation_listbox'],$_GET['emp_first_name'],$_GET['emp_last_name'],$_GET['EMPSRC_UPD_DEL_ta_mobile'],$_GET['EMPSRC_UPD_DEL_lb_employeename_listbox'],$_GET['EMPSRC_UPD_DEL_lb_searchoption'],$_GET['EMPSRC_UPD_DEL_ta_email'],$_GET['EMPSRC_UPD_DEL_ta_comments']);
        $header=$_GET['header'];
        $pdfheader=$header;//'TICKLER HISTORY FOR CUSTOMER:'.$TH_fname.' '.$TH_lname;
        $pdf = $this->pdf->load();
        $pdf=new mPDF('utf-8','A4');
        $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$pdfheader.'</div>', 'O', true);
        $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
        $pdf->WriteHTML($pdfresult);
        $pdf->Output($pdfheader.'.pdf', 'D');
    }
 public function ChequePdfCreation()
 {
     $timeZoneFormat= $this->Mdl_eilib_common_function->getTimezone();
     $Option=$_GET['Searchoption'];
     $Data1=$_GET['Frominput'];
     $Data2=$_GET['Todate'];
     $header=$_GET['Header'];
     $Allrecords=$this->Mdl_ocbc_cheque_entry_search_update->ChequePDFCreation($Option,$Data1,$Data2,$timeZoneFormat);
     $this->load->library('pdf');
     $pdf = $this->pdf->load();
     $pdf=new mPDF('utf-8','A4');
     $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$header.'</div>', 'O', true);
     $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
     $pdf->WriteHTML($Allrecords);
     $pdf->Output('CHEQUE DETAILS.pdf', 'D');
 }
Example #17
0
/**
* output the pdf
*/
function dkpdf_output_pdf($query)
{
    // TODO sanitize validate...
    $pdf = get_query_var('pdf');
    if ($pdf) {
        include 'mpdf60/mpdf.php';
        // page orientation
        $dkpdf_page_orientation = get_option('dkpdf_page_orientation', '');
        if ($dkpdf_page_orientation == 'horizontal') {
            $format = 'A4-L';
        } else {
            $format = 'A4';
        }
        // font size
        $dkpdf_font_size = get_option('dkpdf_font_size', '12');
        // margins
        $dkpdf_margin_left = get_option('dkpdf_margin_left', '15');
        $dkpdf_margin_right = get_option('dkpdf_margin_right', '15');
        $dkpdf_margin_top = get_option('dkpdf_margin_top', '50');
        $dkpdf_margin_bottom = get_option('dkpdf_margin_bottom', '30');
        $dkpdf_margin_header = get_option('dkpdf_margin_header', '15');
        // creating and setting the pdf
        $mpdf = new mPDF('utf-8', $format, $dkpdf_font_size, $dkpdf_font_family, $dkpdf_margin_left, $dkpdf_margin_right, $dkpdf_margin_top, $dkpdf_margin_bottom, $dkpdf_margin_header);
        // header
        $pdf_header_html = dkpdf_get_template('dkpdf-header');
        $mpdf->SetHTMLHeader($pdf_header_html);
        // footer
        $pdf_footer_html = dkpdf_get_template('dkpdf-footer');
        $mpdf->SetHTMLFooter($pdf_footer_html);
        $mpdf->WriteHTML(dkpdf_get_template('dkpdf-index'));
        // action to do (open or download)
        $pdfbutton_action = sanitize_option('dkpdf_pdfbutton_action', get_option('dkpdf_pdfbutton_action', 'open'));
        if ($pdfbutton_action == 'open') {
            $mpdf->Output();
        } else {
            global $post;
            $mpdf->Output(get_the_title($post->ID) . '.pdf', 'D');
        }
        exit;
    }
}
        $tcount = strpos($parts[1], "</tr>") + 5;
        $parts[1] = substr($parts[1], $tcount);
    }
    $text .= $parts[1];
}
$converted = templateParser::parse_template($text, $object_arr);
$header = templateParser::parse_template($header, $object_arr);
$footer = templateParser::parse_template($footer, $object_arr);
$printable = str_replace("\n", "<br />", $converted);
if ($task == 'pdf' || $task == 'emailpdf') {
    $file_name = $mod_strings['LBL_PDF_NAME'] . "_" . str_replace(" ", "_", $module->name) . ".pdf";
    ob_clean();
    try {
        $pdf = new mPDF('en', 'A4', '', 'DejaVuSansCondensed', 15, 15, 16, 16, 8, 8);
        $pdf->setAutoFont();
        $pdf->SetHTMLHeader($header);
        $pdf->SetHTMLFooter($footer);
        $pdf->writeHTML($printable);
        if ($task == 'pdf') {
            $pdf->Output($file_name, "D");
        } else {
            $fp = fopen($sugar_config['upload_dir'] . 'attachfile.pdf', 'wb');
            fclose($fp);
            $pdf->Output($sugar_config['upload_dir'] . 'attachfile.pdf', 'F');
            sendEmail::send_email($module, $module_type, '', $file_name, true);
        }
    } catch (mPDF_exception $e) {
        echo $e;
    }
} else {
    if ($task == 'email') {
Example #19
0
 static function mpdfGenerator_Html2PDF($params = array())
 {
     $translate = Zend_Registry::get('Zend_Translate');
     //-----------------------------
     if (!$params['pdfReport'] || !$params['html']) {
         throw new Exception($translate->_('ERR_CREATE_PDF_REPORT'));
     }
     $mode = '';
     // Получим URLLogoReport
     $config = Zend_Registry::get('config');
     $urlLogoReport = $config['user']['main']['logo_report'];
     $urlLogoReport = self::getFullURL_Res($urlLogoReport);
     //------------------------------------------------------
     // Установим значения по умолчанию
     $defaults = array('pdfReport' => '', 'html' => '', 'isCommonFont' => FALSE, 'pathStylesheet' => 'css/report/mpdf-style.css', 'isHeaders' => TRUE, 'isFooters' => TRUE, 'mirrorMargins' => TRUE, 'headerLeftMargin' => '', 'headerCentreMargin' => $urlLogoReport, 'headerRightMargin' => '{PAGENO}/{nbpg}', 'footerLeftMargin' => '{DATE Y-m-j}', 'footerCentreMargin' => '', 'footerRightMargin' => '', 'pageFormat' => 'A4');
     // Обьединим два массива
     $params = array_merge($defaults, $params);
     if (!$params['footerRightMargin']) {
         $params['footerRightMargin'] = self::getFullUrl_For_FilePDF($params['pdfReport']);
     }
     // Установим значения переменных из массива
     //        extract($params, EXTR_OVERWRITE);
     try {
         // Изменим параметры PHP
         self::iniSetConfig_PHP(array("memory_limit" => "500M", "max_execution_time" => "300"));
         //            require_once("mpdf_source.php");
         require_once "mpdf.php";
         if ($params['isCommonFont']) {
             $mode = 'c';
         }
         $isHeaders = (bool) $params['isHeaders'];
         $isFooters = (bool) $params['isFooters'];
         if ($isHeaders || $isFooters) {
             $mpdf = new mPDF($mode, $params['pageFormat'], '', '', 15, 15, 32, 20, 10, 10);
         } else {
             $mpdf = new mPDF($mode, $params['pageFormat']);
         }
         // Установим параметры для оптимизации (уменьшим время испольнения и используемую память)
         $mpdf->useOnlyCoreFonts = true;
         $mpdf->useSubstitutions = false;
         $mpdf->simpleTables = true;
         // Уменьшает время выполнения
         $mpdf->packTableData = true;
         // Уменьшает используемую память
         $mpdf->use_kwt = true;
         //Keep-with-table  Оставить заголовок таблицы вместе с маблицей на одной странице
         //            $mpdf->shrink_tables_to_fit=0;
         //            $mpdf->hyphenate = true;
         //            $mpdf->SHYlang = 'ru';
         //            $mpdf->SHYleftmin = 3;
         // Определим заголовок страницы
         $header = " \n            <table width=\"100%\" style=\"border-bottom: 1px solid #000000; vertical-align: bottom;  font-weight: bold; font-size: 14pt; color: #000088;\"><tr>\n            <td width=\"33%\"><span style=\"\">{$params['headerLeftMargin']}</span></td>\n            <td width=\"33%\" align=\"center\"><img src=\"{$params['headerCentreMargin']}\" /></td>\n            <td width=\"33%\" style=\"text-align: right;\"><span style=\"\">{$params['headerRightMargin']}</span></td>\n            </tr></table>\n            ";
         // Определим подвал страницы
         $footer = "\n            <table width=\"100%\" style=\"vertical-align: bottom;  font-size: 14pt; color: #000088; font-weight: bold; font-style: italic;\"><tr>\n            <td width=\"33%\"><span style=\"\">{$params['footerLeftMargin']}</span></td>\n            <td width=\"33%\" align=\"center\" style=\"\">{$params['footerCentreMargin']}</td>\n            <td width=\"33%\" style=\"text-align: right; \">{$params['footerRightMargin']}</td>\n            </tr></table>\n            ";
         if ($mirrorMargins) {
             $headerE = "\n                <table width=\"100%\" style=\"border-bottom: 1px solid #000000; vertical-align: bottom;  font-weight: bold; font-size: 14pt; color: #000088;\"><tr>\n                <td width=\"33%\"><span style=\"\"><span style=\"\">{$params['headerRightMargin']}</span></span></td>\n                <td width=\"33%\" align=\"center\"><img src=\"{$params['headerCentreMargin']}\" /></td>\n                <td width=\"33%\" style=\"text-align: right;\"><span style=\"\">{$params['headerLeftMargin']}</span></td>\n                </tr></table>\n                ";
             $footerE = "\n                <table width=\"100%\" style=\"vertical-align: bottom;  font-size: 14pt; color: #000088; font-weight: bold; font-style: italic;\"><tr>\n                <td width=\"33%\"><span style=\"\">{$params['footerRightMargin']}</span></td>\n                <td width=\"33%\" align=\"center\" style=\"\">{$params['footerCentreMargin']}</td>\n                <td width=\"33%\" style=\"text-align: right; \">{$params['footerLeftMargin']}</td>\n                </tr></table>\n                ";
             if ($isHeaders) {
                 $mpdf->mirrorMargins = TRUE;
                 // Use different Odd/Even headers and footers and mirror margins
                 $mpdf->SetHTMLHeader($headerE, 'E');
             }
             if ($isFooters) {
                 $mpdf->mirrorMargins = TRUE;
                 // Use different Odd/Even headers and footers and mirror margins
                 $mpdf->SetHTMLFooter($footerE, 'E');
             }
         }
         if ($isHeaders) {
             $mpdf->SetHTMLHeader($header);
         }
         if ($isFooters) {
             $mpdf->SetHTMLFooter($footer);
         }
         $html = $params['html'];
         //$html = '';
         //$params['pathStylesheet'] = '';
         if ($params['pathStylesheet']) {
             $stylesheet = file_get_contents($params['pathStylesheet']);
             $mpdf->WriteHTML($stylesheet, 1);
             $mpdf->WriteHTML($html, 2);
         } else {
             $mpdf->WriteHTML($html);
         }
         // Получим директорию сохранения файлов
         $dirFilePDF = self::getPath_For_FilePDF($params['pdfReport']);
         // Сохраним файл на серверном ресурсе пользователя
         $mpdf->Output($dirFilePDF, 'F');
     } catch (Exception $exc) {
         throw new Exception($exc->getMessage());
     }
     // Возвратим URL путь, полученного файла PDF
     return Default_Plugin_SysBox::getFullUrl_For_FilePDF($params['pdfReport']);
 }
Example #20
0
 $message_header .= '</table>';
 $message_header .= '<h3 style="text-align:left; width:100%;">' . $company_name . '<br>' . $comp_bussiness_add_1 . '<br>' . $comp_bussiness_add_2 . '<br>' . $company_city . "," . $company_state . "&nbsp;" . $company_zip;
 '</h3>';
 $message_header .= '<table>';
 $message_header .= '<tr>';
 $message_header .= '<th align="center" style="padding-left:5%;font-size:14px; width: 25%;"> JobNumber </th>';
 $message_header .= '<th align="center" style="padding-left:-2 %;font-size:14px; width: 25%;">Date</th>';
 $message_header .= '<th align="center" style="padding:10px;font-size:14px; width: 25%;">Item Description</th>';
 $message_header .= '<th align="center" style="padding-left:4%;font-size:14px; width: 25%;">Quantity</th>';
 $message_header .= '<th align="center" style="padding-left:4%;font-size:14px; width: 25%;">Unit Price</th>';
 $message_header .= '<th align="center" style="padding-left:6%;font-size:14px; width: 25%;">Extended Price</th>';
 $message_header .= '<th align="center" style="padding-left:6%;font-size:14px; width: 25%;">Tax</th>';
 $message_header .= '<th align="center" style="padding-left:3%;font-size:14px; width: 25%;">Total</th>';
 $message_header .= '</tr>';
 $message_header .= '</table>';
 $mpdf->SetHTMLHeader($message_header);
 $message = '<tr>';
 $message .= '<td align="left" valign="top">';
 // $message .='<h3 style="text-align:left; width:50%;">'.$comp_bussiness_add_1.'<br>'.$comp_bussiness_add_2.'</h3>';
 $message .= '<table style="width:100%;">';
 $invoice_orders = GetInvoice_ID($company_id);
 $i = 1;
 foreach ($invoice_orders as $invoice) {
     $rowColor = $i % 2 != 0 ? '#dfdfdf' : '#eeeeee';
     $company_name = $invoice['customer_company_name'];
     $order = InvoiceOrders_Reference($invoice['company_name']);
     // $current_date = date("m/d", strtotime($inv_id[0]['created_date']));
     $current_date = date("m/d", strtotime($invoice['created_date']));
     // print_r($current_date); exit;
     foreach ($order as $inv_prod_invoice) {
         $Invoice_products = GetInvoiceviewOrders($inv_prod_invoice['order_id']);
<table width="100%" style="border-bottom: 1px solid #000000; vertical-align: bottom; font-family: serif; font-size: 9pt; color: #000088;"><tr>
<td width="33%">Left header p <span style="font-size:14pt;">{PAGENO}</span></td>
<td width="33%" align="center"><img src="sunset.jpg" width="126px" /></td>
<td width="33%" style="text-align: right;"><span style="font-weight: bold;">Right header</span></td>
</tr></table>
';
$headerE = '
<table width="100%" style="border-bottom: 1px solid #000000; vertical-align: bottom; font-family: serif; font-size: 9pt; color: #000088;"><tr>
<td width="33%"><span style="font-weight: bold;">Outer header</span></td>
<td width="33%" align="center"><img src="sunset.jpg" width="126px" /></td>
<td width="33%" style="text-align: right;">Inner header p <span style="font-size:14pt;">{PAGENO}</span></td>
</tr></table>
';
$footer = '<div align="center">See <a href="http://mpdf1.com/manual/index.php">documentation manual</a></div>';
$footerE = '<div align="center">See <a href="http://mpdf1.com/manual/index.php">documentation manual</a></div>';
$mpdf->SetHTMLHeader($header);
$mpdf->SetHTMLHeader($headerE, 'E');
$mpdf->SetHTMLFooter($footer);
$mpdf->SetHTMLFooter($footerE, 'E');
$html = '
<h1>mPDF</h1>
<h2>Headers & Footers Method 2</h2>
<h3>Odd / Right page</h3>
<p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
<pagebreak />
<h3>Even / Left page</h3>
<p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
';
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
$runTxa = explode(",", $d["taxs"]);
$Tax = 0;
foreach ($runTxa as $idat) {
    //echo $idat.'<br>';
    $ops = mysql_fetch_array(mysql_query("SELECT * FROM tax_table WHERE tax_id = '{$idat}' AND saasid = '" . $_SESSION['saasid'] . "' AND active = 'true'"));
    //echo $ops['percent'].'<br>'.$subTottax;
    $Tax = round($subTottax * $ops['percent'] / 100, 2);
    $runTax .= '<div style="width:360px; height:31px; float:right; clear:both; border-bottom:solid thin #CCC;"><div style="width:210px; float:left">' . $ops['tax_name'] . ':</div> <div style="width:130px; float:left; text-align:right">$' . $Tax . '</div></div>';
    $taxcom += $Tax;
}
$afterMath = number_format($cleanSub + $taxcom, 2);
$html .= '<div style="width:360px; height:31px; float:right;"><div style="width:210px; float:left">Subtotal:</div> <div style="width:130px; float:left; text-align:right">$' . $cleanSubtru . '</div></div>

' . $runTax . '


<div style="width:360px; height:31px; float:right; clear:both"><div style="width:210px; float:left; font-weight:bold">Total:</div> <div style="width:130px; float:left; text-align:right">$' . $afterMath . '</div></div><input name="estiamount" id="estiamount" type="hidden" value="' . $afterMath . '" />';
$html .= '</div>

';
$rt = mysql_fetch_array(mysql_query("SELECT * FROM core_users WHERE usr_id = '" . $b["salesman"] . "' AND saasid = '" . $_SESSION['saasid'] . "'"));
$mpdf = new mPDF();
$mpdf->SetHTMLHeader('<div style="width:161px; height:64px; float:left; background-image:url(images/main_logo.gif)"></div><div style="float:left; text-align:right; font-size:11px">Work Order for: ' . $dd["companyname"] . '<br>Date Created: ' . $b["issue_date"] . '<br>Created By: ' . $rt["fname"] . ' ' . $rt["lname"] . '</div>');
$mpdf->SetFooter('ACS Work Orders | {PAGENO}');
$mpdf->WriteHTML($html);
$mpdf->Output();
//$mpdf->Output('filename.pdf','F');
exit;
//==============================================================
//==============================================================
//==============================================================
Example #23
0
<table width="100%" style="border-bottom: 1px solid #000; vertical-align: bottom; font-size: 9pt; color: #000;"><tr>
<td width="35%"><img src="../img/logo.png" width="150px"></td>
<td width="65%" align="right">
    <span>พีเอส ซัพพลาย</span> 
    <span>อาคารคอมพิวเตอร์พลาซ่า ห้อง A12</span> <br>
    <span>312 ถ.มณีนพรัตน์ ต.ศรีภูมิ อ.เมือง จ.เชียงใหม่ 50200</span><br>
    <span>Tel. 094-6071991 Fax. 053-405399</span><br>
</td>
</tr></table>
';
$footer = '<table width="100%" style="border-top: 1px solid #000000; vertical-align: bottom; font-size: 9pt; color: #000088;"><tr>
<td width="33%"></td>
<td width="33%" align="center">หน้า {PAGENO}</td>
<td width="33%" style="text-align: right;"></td>
</tr></table>';
$mpdf->SetHTMLHeader($header);
$mpdf->SetHTMLHeader($header, E);
$mpdf->SetHTMLFooter($footer);
$mpdf->SetHTMLFooter($footer, E);
$html = '<table style="width:100%; padding:10px 0 10px 0;">';
$html .= '<tr><td style="width:50%; font-size:20px; font-weight:bold;">ใบแจ้งซ่อม</td>';
$html .= '<td width="50%" align="right">เลขที่ RP-' . $r['rp_id'] . '<br>เมื่อ ' . formatDateThaiFromDatatime($r['rp_datekey']) . ' น.</td></tr>';
$html .= '</table><hr>';
$html .= '<div style="float: left; width: 49%;"><table style="width:100%;">';
$html .= '<tr><td style="width:100%; font-weight:bold; text-decoration: underline;" colspan="2">ข้อมูลลูกค้า</td></tr>';
$html .= '<tr><td style="font-weight:bold; width:35%;">ชื่อลูกค้า </td><td>: ' . $r['c_flname'] . '</td></tr>
<tr><td style="font-weight:bold;">เลขที่ประชาชน </td><td>: ' . $r['c_cradid'] . '</td></tr>
<tr><td style="font-weight:bold;">E-mail </td><td>: ' . $r['c_email'] . '</td></tr>
<tr><td style="font-weight:bold;">เบอร์โทรศัพ </td><td>: ' . $r['c_phone'] . '</td></tr></table></div>';
$html .= '<div style="float: right; width: 49%;"><table style="width:100%;">
<tr><td style="width:100%; font-weight:bold; text-decoration: underline;" colspan="2">ข้อมูลเครื่อง</td></tr>
Example #24
0
			$mpdf->WriteHTML(htmlspecialchars_decode($html2));

			$header3=__('<div style="padding:0px 0px 0px 0px;height:12mm;width:100%;background:#FFF;border:0;outline:none;margin:0;">
							<div style="padding:1px 38.4px 0px 37px;">
								 <div style="width:20%; float:left; color:#162c5d;text-align:left; line-height:10px;">
									  <p style="float:left;">Tipps & Tricks</p>
								</div>
								<div style="float:left;width:60%;text-align:center; vertical-align:middle;">
									<img style="margin-top:8px;" width="100" height=""  src="'.$site_logo.'"></div>
								<div style="float:right;width:19%;padding-right:2px; color:#162c5d;text-align:right;line-height:10px; ">
									<p>Seite {PAGENO}/{nbpg}</p>
								</div>
							</div>     
						  </div>', 'shopkeeper' );
						  
			$mpdf->SetHTMLHeader(htmlspecialchars_decode($header3));
			
		//	$mpdf->SetHTMLFooter(htmlspecialchars_decode($header3));
			$mpdf->AddPage('UTF-8','A4-L', 0, 'avenir', 0,0,0,16.7,10.18,0,0);
			$mpdf->WriteHTML(htmlspecialchars_decode($html3));

			for($i=1;$i<2;$i++){
				if($i==1){ 
					$min_w=str_replace(".",",",0.1);
				}
				else{
					//$min_w=	str_replace(".",",",(float)$order_details[0]->current_weight-(float)$weight_range_new[$i]);
					$min_w=$max_w;
				}
		
				$wr= (float)$order_details[0]->current_weight-(float)$weight_range_new[$i];
$tabla = '<table class="bpmTopnTail" border="1" style="margin:0 auto;"><thead><tr class="headerrow"><th>ID EMPLEADO</th><th>NOMBRE</th>
<th>TURNO</th>
<th>AREA</th>
<th>DEPARTAMENTO</th>
<th>MEDICAMENTO(S)</th>
<th>FECHA</th><th>PROCESO</th></tr></thead><tbody>' . $tabla . '</tbody></table>';
$html = $tabla;
//==============================================================
//==============================================================
//==============================================================
define('_MPDF_URI', 'data/lib/mpdf60/');
include "data/lib/mpdf60/mpdf.php";
$mpdf = new mPDF('utf-8', 'Leter-L', 0, '', 15, 15, 40, 16, 5, 9);
$mpdf->SetDisplayMode('fullpage');
$mpdf->SetHTMLHeader('
<table style="width: 100%;"><tr><td><h1>Cirpro de Delicias</h1></td><td style="text-align: right"> <img src="img/header.png" style="height 80pt; width: 110pt; margin 0 0 0 0;" alt="Cardinal Healt"></td></tr></table>
<h2>Visitas de ' . $_POST['fecha_inicio_mostrar'] . ' a ' . $_POST['fecha_fin_mostrar'] . ' </h2>
<h4>Reporte de Visitas</h4>');
$mpdf->setFooter('Pagina {PAGENO} de {nbpg}');
$mpdf->list_indent_first_level = 0;
// 1 or 0 - whether to indent the first level of a list
// LOAD a stylesheet
$stylesheet = file_get_contents('mpdfstyletables.css');
$mpdf->WriteHTML($stylesheet, 1);
// The parameter 1 tells that this is css/style only and no body/html/text
$mpdf->WriteHTML($html, 2);
//print $html;
$mpdf->Output('mpdf.pdf', 'I');
exit;
//==============================================================
//==============================================================
//==============================================================
Example #26
0
 static function save_in_pdf($kp_id, $client_id, $user_id, $filename = '1.pdf')
 {
     $html = self::open_in_blank($kp_id, $client_id, $user_id, true);
     //echo $html;
     //exit;
     include ROOT . "/libs/php/mpdf60/mpdf.php";
     //$stylesheet = file_get_contents('style.css');
     $filename = 'Презентация_' . $client_id . '_' . date('Ymd_His') . '.pdf';
     $mpdf = new mPDF();
     //$mpdf->WriteHTML($stylesheet,1);
     //$mpdf->SetHTMLHeader('<div style="height:80px;border:#000 solid 1px;"><img src="'.HOST.'/skins/images/img_design/spec_offer_top_plank_2.jpg"></div><br><br><br><br>');
     $mpdf->SetHTMLHeader('<img src="' . HOST . '/skins/images/img_design/spec_offer_top_plank_2.jpg">');
     $mpdf->WriteHTML($html, 2);
     $mpdf->Output($filename, 'D');
     //$mpdf->Output();
     exit;
 }
Example #27
0
 public function generate_pdf($content, $name = 'download.pdf', $output_type = NULL, $footer = NULL, $margin_bottom = NULL, $header = NULL, $margin_top = NULL, $orientation = 'P')
 {
     if (!$output_type) {
         $output_type = 'D';
     }
     if (!$margin_bottom) {
         $margin_bottom = 10;
     }
     if (!$margin_top) {
         $margin_top = 10;
     }
     $this->load->library('pdf');
     $pdf = new mPDF('utf-8', 'A4-' . $orientation, '13', '', 10, 10, $margin_top, $margin_bottom, 9, 9);
     $pdf->debug = false;
     $pdf->autoScriptToLang = true;
     $pdf->autoLangToFont = true;
     $pdf->SetProtection(array('print'));
     // You pass 2nd arg for user password (open) and 3rd for owner password (edit)
     //$pdf->SetProtection(array('print', 'copy')); // Comment above line and uncomment this to allow copying of content
     $pdf->SetTitle($this->Settings->site_name);
     $pdf->SetAuthor($this->Settings->site_name);
     $pdf->SetCreator($this->Settings->site_name);
     $pdf->SetDisplayMode('fullpage');
     $stylesheet = file_get_contents('assets/bs/bootstrap.min.css');
     $pdf->WriteHTML($stylesheet, 1);
     $pdf->WriteHTML($content);
     if ($header != '') {
         $pdf->SetHTMLHeader('<p class="text-center">' . $header . '</p>', '', TRUE);
     }
     if ($footer != '') {
         $pdf->SetHTMLFooter('<p class="text-center">' . $footer . '</p>', '', TRUE);
     }
     //$pdf->SetHeader($this->Settings->site_name.'||{PAGENO}', '', TRUE); // For simple text header
     //$pdf->SetFooter($this->Settings->site_name.'||{PAGENO}', '', TRUE); // For simple text footer
     if ($output_type == 'S') {
         $file_content = $pdf->Output('', 'S');
         write_file('assets/uploads/' . $name, $file_content);
         return 'assets/uploads/' . $name;
     } else {
         $pdf->Output($name, $output_type);
     }
 }
    public  function Staff_Detail_pdf(){

        $timeZoneFormat=$this->Mdl_eilib_common_function->getTimezone();
        $this->load->library('pdf');
        $pdfresult='';
        $STDTL_SEARCH_cpfnumber=$_GET['STDTL_SEARCH_cpfnumber'];
        $STDTL_SEARCH_staffexpense_selectquery=$_GET['STDTL_SEARCH_staffexpense_selectquery'];
        $STDTL_SEARCH_cpffrom_form=$_GET['STDTL_SEARCH_cpffrom_form'];
        $STDTL_SEARCH_cpfto_form=$_GET['STDTL_SEARCH_cpfto_form'];
        $STDTL_SEARCH_staffcommentstxt=$_GET['STDTL_SEARCH_staffcommentstxt'];
        $emp_first_name=$_GET['emp_first_name'];
        $emp_last_name=$_GET['emp_last_name'];
        $pdfresult = $this->Mdl_staff_detail_entry_search_update_delete->Staff_Detail_pdf($STDTL_SEARCH_staffexpense_selectquery,$STDTL_SEARCH_cpfnumber,$STDTL_SEARCH_cpffrom_form,$STDTL_SEARCH_cpfto_form,$STDTL_SEARCH_staffcommentstxt,$emp_first_name,$emp_last_name);//$timeZoneFormat,$_GET['EMPSRC_UPD_DEL_lb_designation_listbox'],$_GET['emp_first_name'],$_GET['emp_last_name'],$_GET['EMPSRC_UPD_DEL_ta_mobile'],$_GET['EMPSRC_UPD_DEL_lb_employeename_listbox'],$_GET['EMPSRC_UPD_DEL_lb_searchoption'],$_GET['EMPSRC_UPD_DEL_ta_email'],$_GET['EMPSRC_UPD_DEL_ta_comments']);
        $header=$_GET['header'];
        $header= str_replace("^","&",$header);
        $pdfheader=$header;//'TICKLER HISTORY FOR CUSTOMER:'.$TH_fname.' '.$TH_lname;
        $pdf = $this->pdf->load();
        $pdf=new mPDF('utf-8','A4-L');
        $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$pdfheader.'</div>', 'O', true);
        $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
        $pdf->WriteHTML($pdfresult);
        $pdf->Output($pdfheader.'.pdf', 'D');
        $data=$this->Mdl_staff_daily_entry_search_update_delete->Staff_Daily_pdf();
        echo json_encode($data);



    }
 public function Customer_Expiry_List_pdf(){
     $UserStamp=$this->Mdl_eilib_common_function->getSessionUserStamp();
     $timeZoneFormat=$this->Mdl_eilib_common_function->getTimezone();
     $this->load->library('pdf');
     $pdfresult='';
     $CEXP_fromdate=$this->input->get('CEXP_fromdate');
     $CEXP_todate=$this->input->get('CEXP_todate');
     $CEXP_radio_button_select_value=$this->input->get('CEXP_radio_button_select_value');
     $header=$this->input->get('header');
     $pdfresult=$this->Mdl_customer_expiry_list->Customer_Expiry_List_pdf($CEXP_fromdate,$CEXP_todate,$CEXP_radio_button_select_value,$UserStamp,$timeZoneFormat);
     $pdfheader='CUSTOMER EXPIRY LIST - '.$header;
     $pdf = $this->pdf->load();
     $pdf=new mPDF('utf-8','A4-L');
     $pdf->SetHTMLHeader('<div style="text-align: center; font-weight: bold;">'.$pdfheader.'</div>', 'O', true);
     $pdf->SetHTMLFooter('<div style="text-align: center;">{PAGENO}</div>');
     $pdf->WriteHTML($pdfresult);
     $pdf->Output($pdfheader.'.pdf', 'D');
 }
 /**
  * Generates the invoice with MPDF lib.
  * @param $dest
  * @return string
  */
 protected function generate($dest, $document)
 {
     set_time_limit(0);
     $mpdf_filename = BEWPI_LIB_DIR . 'mpdf/mpdf.php';
     include $mpdf_filename;
     $mpdf = new mPDF('', 'A4', 0, 'opensans', 17, 17, 150, 50, 20, 0, '');
     $mpdf->useOnlyCoreFonts = false;
     // false is default
     $mpdf->SetTitle($this->title);
     $mpdf->SetAuthor($this->author);
     $mpdf->showWatermarkText = false;
     $mpdf->SetDisplayMode('fullpage');
     $mpdf->useSubstitutions = true;
     $mpdf->SetHTMLHeader($document->header);
     $mpdf->SetHTMLFooter($document->footer);
     $mpdf->WriteHTML($document->css . $document->body);
     $mpdf->Output($document->filename, $dest);
 }