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


PHP mPDF::SetAutoFont方法代码示例

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


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

示例1: render

 public function render($file = NULL)
 {
     // Render the HTML normally
     $html = parent::render($file);
     // Render the HTML to a PDF
     $mpdf = new mPDF('UTF-8', 'A4');
     $mpdf->SetAutoFont(AUTOFONT_ALL);
     $mpdf->WriteHTML($html);
     return $mpdf->output();
 }
开发者ID:ener,项目名称:mpdf,代码行数:10,代码来源:mpdf.php

示例2: exportPdf

function exportPdf($URl)
{
    include 'MPDF56/mpdf.php';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $URl);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $html = curl_exec($ch);
    curl_close($ch);
    $mpdf = new mPDF('utf-8');
    $mpdf->SetAutoFont();
    $mpdf->WriteHTML($html);
    $mpdf->Output();
}
开发者ID:somewhereocean,项目名称:InAppVerify,代码行数:14,代码来源:lib.php

示例3: pdf_create

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();
    }
}
开发者ID:smolareck,项目名称:hmvcadmin,代码行数:41,代码来源:mpdf_helper.php

示例4: send

 public function send()
 {
     $this->loadData();
     $mpdf = new mPDF('utf-8', 'A4');
     $mpdf->useOnlyCoreFonts = true;
     $mpdf->SetDisplayMode('fullpage');
     $mpdf->SetAutoFont(0);
     // CSS soubory
     $css[] = './styles/faktura.css';
     // faktura v HTML (PHP, atd.)
     $html[] = KIWI_INVOICE . '?bauth&o=' . $this->id;
     foreach ($css as $filename) {
         @$mpdf->WriteHTML(file_get_contents($filename, true), 1);
     }
     foreach ($html as $filename) {
         @$mpdf->WriteHTML(file_get_contents($this->file2Url($filename)), 2);
     }
     $o_id = sprintf("%03d", $this->data->YID) . "-{$this->data->Year}";
     $name = "invoice_{$o_id}.pdf";
     $mpdf->Output($name, "D");
     // download
 }
开发者ID:ctiborv,项目名称:spitzen-wein.ch,代码行数:22,代码来源:kiwi_invoice_pdf.class.php

示例5: get_pdf

 public static function get_pdf($html)
 {
     include FCPATH . "mpdf/mpdf.php";
     $mpdf = new mPDF();
     $mpdf->useAdobeCJK = true;
     $mpdf->SetAutoFont(AUTOFONT_ALL);
     //$mpdf->WriteHTML(file_get_contents(base_url().'assets/templates/default/fonts/mpdf.css'),1);
     $mpdf->WriteHTML($html);
     $mpdf->Output();
 }
开发者ID:mazba,项目名称:ams,代码行数:10,代码来源:system_helper.php

示例6: pdf_create

function pdf_create($html, $filename, $stream = TRUE)
{
    require_once APPPATH . 'helpers/mpdf/mpdf.php';
    $mpdf = new mPDF();
    $mpdf->autoScriptToLang = true;
    $mpdf->autoLangToFont = true;
    //$pdf = $this->pdf->load();
    //for chinese word soulution
    $mpdf->useAdobeCJK = true;
    $mpdf->SetAutoFont(AUTOFONT_ALL);
    $mpdf->SetAutoFont();
    $mpdf->WriteHTML($html);
    if ($stream) {
        $mpdf->Output($filename . '.pdf', 'D');
    } else {
        $mpdf->Output('./pdfinvoices/temp/' . $filename . '.pdf', 'F');
        return './pdfinvoices/temp/' . $filename . '.pdf';
    }
}
开发者ID:beebee1987,项目名称:sunhope,代码行数:19,代码来源:mpdf_helper.php

示例7: pdf_create

function pdf_create($html, $filename, $stream = TRUE)
{
    require_once APPPATH . 'helpers/mpdf/mpdf.php';
    $CI =& get_instance();
    $mpdf = new mPDF();
    $mpdf->SetAutoFont();
    $mpdf->WriteHTML($html);
    if ($stream) {
        $mpdf->Output($filename . '.pdf', 'I');
    } else {
        $mpdf->Output('./uploads/temp/' . $filename . '.pdf', 'F');
    }
}
开发者ID:rifaiaja,项目名称:orpsystem,代码行数:13,代码来源:mpdf_helper.php

示例8: pdf_create

function pdf_create($html, $filename, $stream = TRUE)
{
    require_once APPPATH . 'helpers/mpdf/mpdf.php';
    $mpdf = new mPDF();
    $mpdf->SetAutoFont();
    $mpdf->WriteHTML($html);
    if ($stream) {
        $mpdf->Output($filename . '.pdf', 'D');
    } else {
        $mpdf->Output('./pdfinvoices/temp/' . $filename . '.pdf', 'F');
        return './pdfinvoices/temp/' . $filename . '.pdf';
    }
}
开发者ID:anji12172,项目名称:finalProject,代码行数:13,代码来源:mpdf_helper.php

示例9: downliuzhuanfile

 public function downliuzhuanfile()
 {
     $per = C('DB_PREFIX');
     $borrow_config = (require C("APP_ROOT") . "Conf/borrow_config.php");
     $invest_id = intval($_GET['id']);
     //$borrow_id=intval($_GET['id']);
     //old
     //$iinfo = M('borrow_investor')->field('id,borrow_id,investor_capital,investor_interest,deadline,investor_uid,add_time')->where("(investor_uid={$this->uid} OR borrow_uid={$this->uid}) AND id={$invest_id}")->find();
     $iinfo = M('borrow_investor')->field('id,borrow_id,investor_capital,investor_interest,deadline,investor_uid,add_time')->where("investor_uid={$this->uid} AND id={$invest_id}")->find();
     $investor_capital_big = cny($iinfo['investor_capital']);
     $borrow_id = $iinfo['borrow_id'];
     //dump( $borrow_id);
     //exit;
     $binfo = M('borrow_info bi')->field('bi.id,bi.repayment_type,bi.borrow_duration,bi.borrow_uid,bi.borrow_type,bi.borrow_use,bi.borrow_money,bi.full_time,bi.add_time,bi.borrow_interest_rate,bi.deadline,bi.second_verify_time,bi.collect_time,mi.real_name,mi.stamp_img')->join("{$per}member_info mi ON bi.danbao=mi.uid")->find($borrow_id);
     //dump($iinfo);
     //dump(M("members m")->getlastsql());
     //exit;
     $mBorrow = M("members m")->join("{$per}member_info mi ON mi.uid=m.id")->field('mi.real_name,m.user_name,mi.idcard,mi.stamp_img')->where("m.id={$binfo['borrow_uid']}")->find();
     //$mInvest = M("members m")->join("{$per}member_info mi ON mi.uid=m.id")->field('mi.real_name,m.user_name')->where("m.id={$iinfo['investor_uid']}")->find();
     $mInvest = M("members m")->join("{$per}member_info mi ON mi.uid=m.id")->field('mi.real_name,mi.address,mi.cell_phone,mi.idcard,m.user_name,m.user_email')->where("m.id={$iinfo['investor_uid']}")->find();
     //if(!is_array($iinfo)||!is_array($binfo)||!is_array($mBorrow)||!is_array($mInvest)) exit;
     $detail = M('investor_detail d')->field('d.borrow_id,d.investor_uid,d.borrow_uid,d.capital,sum(d.capital+d.interest-d.interest_fee) benxi,d.total')->where("d.borrow_id={$iinfo['borrow_id']} and d.invest_id ={$iinfo['id']}")->group('d.investor_uid')->find();
     //$detailinfo = M('investor_detail d')->join("{$per}borrow_investor bi ON bi.id=d.invest_id")->join("{$per}members m ON m.id=d.investor_uid")->field('d.borrow_id,d.investor_uid,d.borrow_uid,d.capital,sum(d.capital+d.interest-d.interest_fee) benxi,d.total,m.user_name,bi.investor_capital,bi.add_time')->where("d.borrow_id={$iinfo['borrow_id']} and d.invest_id ={$iinfo['id']}")->group('d.investor_uid')->find();
     $detailinfo = M('investor_detail d')->field('d.borrow_id,d.investor_uid,d.borrow_uid,(d.capital+d.interest-d.interest_fee) benxi,d.capital,d.interest,d.interest_fee,d.sort_order,d.deadline')->where("d.borrow_id={$iinfo['borrow_id']} and d.invest_id ={$iinfo['id']}")->select();
     $time = M('borrow_investor')->field('id,add_time')->where("borrow_id={$iinfo['borrow_id']} order by add_time asc")->limit(1)->find();
     if ($binfo['repayment_type'] == 1) {
         $deadline_last = strtotime("+{$binfo['borrow_duration']} day", $time['add_time']);
     } else {
         $deadline_last = strtotime("+{$binfo['borrow_duration']} month", $time['add_time']);
     }
     $this->assign('deadline_last', $deadline_last);
     $this->assign('detailinfo', $detailinfo);
     $this->assign('detail', $detail);
     $type1 = $this->gloconf['BORROW_USE'];
     $binfo['borrow_use'] = $type1[$binfo['borrow_use']];
     $ht = M('hetong')->field('hetong_img,name,dizhi,tel')->find();
     $this->assign("ht", $ht);
     $type = $borrow_config['REPAYMENT_TYPE'];
     //echo $binfo['repayment_type'];
     $binfo['repayment_name'] = $type[$binfo['repayment_type']];
     //	dump($binfo['stamp_img']);exit;
     $iinfo['repay'] = getFloatValue(($iinfo['investor_capital'] + $iinfo['investor_interest']) / $binfo['borrow_duration'], 2);
     $this->assign("bid", "bytp2pD");
     //print_r($type);
     $this->assign('investor_capital_big', $investor_capital_big);
     $this->assign('iinfo', $iinfo);
     $this->assign('binfo', $binfo);
     $this->assign('mBorrow', $mBorrow);
     $this->assign('mInvest', $mInvest);
     $this->assign('borrow_id', $borrow_id);
     $detail_list = M('investor_detail')->field(true)->where("invest_id={$invest_id}")->select();
     $this->assign("detail_list", $detail_list);
     //echo "<pre>";print_r($binfo);echo "</pre>";exit;
     //$this->display("transfer");exit;
     Vendor('Mpdf.mpdf');
     $mpdf = new mPDF('UTF-8', 'A4', '', '', 15, 15, 4, 15);
     $mpdf->useAdobeCJK = true;
     $mpdf->SetAutoFont(AUTOFONT_ALL);
     $mpdf->SetDisplayMode('fullpage');
     $mpdf->SetAutoFont();
     $mpdf->SetHTMLFooter(' >>{PAGENO}<<');
     $mpdf->WriteHTML($this->fetch('transfer'));
     $mpdf->Output('cailaijinfu.pdf', 'I');
     exit;
     $this->display("transfer");
 }
开发者ID:GStepOne,项目名称:CI,代码行数:66,代码来源:AgreementAction.class.php

示例10: PDF_processing

 /**
  * Creates the PDF and does a specific output (see PDF_Generator function above for $output variable types)
  */
 public function PDF_processing($html, $filename, $id, $output = 'view', $arguments)
 {
     /* 
      * DOMPDF replaced with mPDF in v3.0.0 
      * Check which version of mpdf we are calling
      * Full, Lite or Tiny
      */
     if (!class_exists('mPDF')) {
         if (FP_PDF_ENABLE_MPDF_TINY === true) {
             include FP_PDF_PLUGIN_DIR . '/mPDF/mpdf-extra-lite.php';
         } elseif (FP_PDF_ENABLE_MPDF_LITE === true) {
             include FP_PDF_PLUGIN_DIR . '/mPDF/mpdf-lite.php';
         } else {
             include FP_PDF_PLUGIN_DIR . '/mPDF/mpdf.php';
         }
     }
     /* 
      * Initialise class and set the paper size and orientation
      */
     $paper_size = $arguments['pdf_size'];
     if (!is_array($paper_size)) {
         $orientation = $arguments['orientation'] == 'landscape' ? '-L' : '';
         $paper_size = $paper_size . $orientation;
     } else {
         $orientation = $arguments['orientation'] == 'landscape' ? 'L' : 'P';
     }
     $mpdf = new mPDF('', $paper_size, 0, '', 15, 15, 16, 16, 9, 9, $orientation);
     /*
      * Display PDF is full-page mode which allows the entire PDF page to be viewed
      * Normally PDF is zoomed right in.
      */
     $mpdf->SetDisplayMode('fullpage');
     if (FP_PDF_ENABLE_SIMPLE_TABLES === true) {
         $mpdf->simpleTables = true;
     }
     /*
      * Automatically detect fonts and substitue as needed
      */
     if (FP_PDF_DISABLE_FONT_SUBSTITUTION === true) {
         $mpdf->useSubstitutions = false;
     } else {
         $mpdf->SetAutoFont(AUTOFONT_ALL);
         $mpdf->useSubstitutions = true;
     }
     /*
      * Set Creator Meta Data
      */
     $mpdf->SetCreator('Formidable Pro PDF Extended v' . FP_PDF_EXTENDED_VERSION . '. http://formidablepropdfextended.com');
     /*
      * Set RTL languages at user request
      */
     if ($arguments['rtl'] === true) {
         $mpdf->SetDirectionality('rtl');
     }
     /*
      * Set up security if user requested
      */
     if ($arguments['security'] === true && $arguments['pdfa1b'] !== true && $arguments['pdfx1a'] !== true) {
         $password = strlen($arguments['pdf_password']) > 0 ? $arguments['pdf_password'] : '';
         $master_password = strlen($arguments['pdf_master_password']) > 0 ? $arguments['pdf_master_password'] : null;
         $pdf_privileges = is_array($arguments['pdf_privileges']) ? $arguments['pdf_privileges'] : array();
         $mpdf->SetProtection($pdf_privileges, $password, $master_password, 128);
     }
     /* PDF/A1-b support added in v3.4.0 */
     if ($arguments['pdfa1b'] === true) {
         $mpdf->PDFA = true;
         $mpdf->PDFAauto = true;
     } else {
         if ($arguments['pdfx1a'] === true) {
             $mpdf->PDFX = true;
             $mpdf->PDFXauto = true;
         }
     }
     /*
      * Check if we should auto prompt to print the document on open
      */
     if (isset($_GET['print'])) {
         $mpdf->SetJS('this.print();');
     }
     /* load HTML block */
     $mpdf->WriteHTML($html);
     switch ($output) {
         case 'download':
             $mpdf->Output($filename, 'D');
             exit;
             break;
         case 'view':
             $mpdf->Output(time(), 'I');
             exit;
             break;
         case 'save':
             /*
              * PDF wasn't writing to file with the F method - http://mpdf1.com/manual/index.php?tid=125
              * Return as a string and write to file manually
              */
             $pdf = $mpdf->Output('', 'S');
             return $this->savePDF($pdf, $filename, $id);
//.........这里部分代码省略.........
开发者ID:vfontjr,项目名称:formidable-pro-pdf-extended,代码行数:101,代码来源:pdf-render.php

示例11: pdf_create

function pdf_create($html, $filename, $stream = true, $password = null, $isInvoice = null, $isGuest = null, $zugferd_invoice = false, $associatedFiles = null)
{
    require_once APPPATH . 'helpers/mpdf/mpdf.php';
    $mpdf = new mPDF();
    $mpdf->useAdobeCJK = true;
    $mpdf->SetAutoFont();
    if ($zugferd_invoice) {
        $CI =& get_instance();
        $CI->load->helper('zugferd');
        $mpdf->PDFA = true;
        $mpdf->PDFAauto = true;
        $mpdf->SetAdditionalRdf(zugferd_rdf());
        $mpdf->SetAssociatedFiles($associatedFiles);
    } else {
        // Avoid setting protection when password is blank/empty
        if (!empty($password)) {
            $mpdf->SetProtection(array('copy', 'print'), $password, $password);
        }
    }
    if (!(is_dir('./uploads/archive/') || is_link('./uploads/archive/'))) {
        mkdir('./uploads/archive/', '0777');
    }
    // Enable image error logging
    if (IP_DEBUG) {
        $mpdf->showImageErrors = true;
    }
    if (strpos($filename, trans('invoice')) !== false) {
        $CI =& get_instance();
        $mpdf->setAutoBottomMargin = 'stretch';
        $mpdf->SetHTMLFooter('<div id="footer">' . $CI->mdl_settings->settings['pdf_invoice_footer'] . '</div>');
    }
    $invoice_array = array();
    $mpdf->WriteHTML($html);
    // If $stream is true (default) the PDF will be displayed directly in the browser, otherwise will be returned as a download
    if ($stream) {
        if (!$isInvoice) {
            return $mpdf->Output($filename . '.pdf', 'I');
        }
        foreach (glob('./uploads/archive/*' . $filename . '.pdf') as $file) {
            array_push($invoice_array, $file);
        }
        if (!empty($invoice_array) && $isGuest) {
            rsort($invoice_array);
            header('Content-type: application/pdf');
            return readfile($invoice_array[0]);
        } else {
            if ($isGuest) {
                // @TODO flashdata is deleted between requests
                //$CI->session->flashdata('alert_error', 'sorry no Invoice found!');
                redirect('guest/view/invoice/' . end($CI->uri->segment_array()));
            }
        }
        $mpdf->Output('./uploads/archive/' . date('Y-m-d') . '_' . $filename . '.pdf', 'F');
        return $mpdf->Output($filename . '.pdf', 'I');
    } else {
        if ($isInvoice) {
            foreach (glob('./uploads/archive/*' . $filename . '.pdf') as $file) {
                array_push($invoice_array, $file);
            }
            if (!empty($invoice_array) && !is_null($isGuest)) {
                rsort($invoice_array);
                return $invoice_array[0];
            }
            $mpdf->Output('./uploads/archive/' . date('Y-m-d') . '_' . $filename . '.pdf', 'F');
            return './uploads/archive/' . date('Y-m-d') . '_' . $filename . '.pdf';
        }
        $mpdf->Output('./uploads/temp/' . $filename . '.pdf', 'F');
        // Housekeeping
        // Delete any files in temp/ directory that are >1 hrs old
        $interval = 3600;
        if ($handle = @opendir(preg_replace('/\\/$/', '', './uploads/temp/'))) {
            while (false !== ($file = readdir($handle))) {
                if ($file != '..' && $file != '.' && !is_dir($file) && filemtime('./uploads/temp/' . $file) + $interval < time() && substr($file, 0, 1) !== '.' && $file != 'remove.txt') {
                    // mPDF 5.7.3
                    unlink('./uploads/temp/' . $file);
                }
            }
            closedir($handle);
        }
        // Return the pdf itself
        return './uploads/temp/' . $filename . '.pdf';
    }
}
开发者ID:Thewafflication,项目名称:InvoicePlane,代码行数:83,代码来源:mpdf_helper.php

示例12: exportToPdf

function exportToPdf($content, $fileName = "reports.pdf")
{
    include_once SP_LIBPATH . "/mpdf/mpdf.php";
    $mpdf = new mPDF();
    $mpdf->useAdobeCJK = true;
    $mpdf->SetAutoFont(AUTOFONT_ALL);
    $spider = new Spider();
    $ret = $spider->getContent(SP_CSSPATH . "/screen.css");
    $stylesheet = str_replace("../../../images", SP_IMGPATH, $ret['page']);
    $mpdf->WriteHTML($stylesheet, 1);
    $mpdf->SetDisplayMode('fullpage');
    $mpdf->WriteHTML($content, 2);
    $mpdf->Output($fileName, "I");
    exit;
}
开发者ID:codegooglecom,项目名称:seopanel,代码行数:15,代码来源:sp-common.php

示例13: pdf_create

function pdf_create($html, $filename, $stream = TRUE, $password = NULL,$isInvoice = NULL,$isGuest = NULL)
{
    require_once(APPPATH . 'helpers/mpdf/mpdf.php');

    $mpdf = new mPDF('','','','','15','15','15','45','',''    // mode - default ''
//'A4',    // format - A4, for example, default ''
//0,     // font size - default 0
//'',    // default font family
//'',    // 15 margin_left
//'',    // 15 margin right
//25,     // 16 margin top
//55,    // margin bottom
//'',     // 9 margin header
//'',     // 9 margin footer
//'L'
);   $mpdf->setAutoBottomMargin = '200';
    $mpdf->useAdobeCJK = true;
	$mpdf->SetAutoFont();
    $mpdf->SetProtection(array('copy','print'), $password, $password);
    if(!(is_dir('./uploads/archive/') OR is_link('./uploads/archive/') ))
        mkdir ('./uploads/archive/','0777');

    if (strpos($filename, lang('invoice')) !== false) {
        $CI = &get_instance();
        $mpdf->setAutoBottomMargin = 'stretch';
        #$mpdf->SetHTMLFooter('<div id="footer">' . $CI->mdl_settings->settings['pdf_invoice_footer'] . '</div>');
    }
    $invoice_array = array();

    $mpdf->WriteHTML($html);

    if ($stream) {
        if (!$isInvoice) {
            return $mpdf->Output($filename . '.pdf', 'I');
        }

        foreach (glob('./uploads/archive/*' . $filename . '.pdf') as $file) {
            array_push($invoice_array, $file);
        }

        if (!empty($invoice_array) AND $isGuest) {
            rsort($invoice_array);
            header('Content-type: application/pdf');
            return readfile($invoice_array[0]);
        } else
            if ($isGuest){
            //todo flashdata is deleted between requests
            //$CI->session->flashdata('alert_error', 'sorry no Invoice found!');
            redirect('guest/view/invoice/' . end($CI->uri->segment_array()));
        }
        $mpdf->Output('./uploads/archive/' . date('Y-m-d') . '_' . $filename . '.pdf', 'F');
        return $mpdf->Output( $filename . '.pdf', 'I');
    }

    else {

        if($isInvoice) {

            foreach (glob('./uploads/archive/*' .  $filename . '.pdf') as $file) {
                array_push($invoice_array, $file);
            }
            if (!empty($invoice_array) && !is_null($isGuest)) {
                rsort($invoice_array);
                return $invoice_array[0];
            }
            $mpdf->Output('./uploads/archive/' . date('Y-m-d') .'_'. $filename . '.pdf', 'F');
            return './uploads/archive/'.date('Y-m-d').'_'. $filename . '.pdf';
        }
        $mpdf->Output('./uploads/temp/' . $filename . '.pdf', 'F');

        // DELETE OLD TEMP FILES - Housekeeping
        // Delete any files in temp/ directory that are >1 hrs old
        $interval = 3600;
        if ($handle = @opendir(preg_replace('/\/$/','','./uploads/temp/'))) {
            while (false !== ($file = readdir($handle))) {
                if (($file != "..") && ($file != ".") && !is_dir($file) && ((filemtime('./uploads/temp/'.$file)+$interval) < time()) && (substr($file, 0, 1) !== '.') && ($file !='remove.txt')) { // mPDF 5.7.3
                    unlink('./uploads/temp/'.$file);
                }
            }
            closedir($handle);
        }
        //==============================================================================================================
        return './uploads/temp/' . $filename . '.pdf';
    }
}
开发者ID:n0rp3d,项目名称:invoice,代码行数:85,代码来源:mpdf_helper.php

示例14: GetPreparedMPDF

 public function GetPreparedMPDF(&$mpdf, $record, $module, $language)
 {
     require_once "modules/PDFMaker/resources/mpdf/mpdf.php";
     $focus = CRMEntity::getInstance($module);
     $TemplateContent = array();
     foreach ($focus->column_fields as $cf_key => $cf_value) {
         $focus->column_fields[$cf_key] = '';
     }
     $focus->retrieve_entity_info($record, $module);
     $focus->id = $record;
     $PDFContent = $this->GetPDFContentRef($module, $focus, $language);
     $Settings = $PDFContent->getSettings();
     $name = $PDFContent->getFilename();
     $pdf_content = $PDFContent->getContent();
     $header_html = $pdf_content["header"];
     $body_html = $pdf_content["body"];
     $footer_html = $pdf_content["footer"];
     if ($Settings["orientation"] == "landscape") {
         $orientation = "L";
     } else {
         $orientation = "P";
     }
     $format = $Settings["format"];
     // variable $format used in mPDF constructor
     $formatPB = $format;
     // variable $formatPB used in <pagebreak ... /> contruction
     if (strpos($format, ";") > 0) {
         $tmpArr = explode(";", $format);
         $format = array($tmpArr[0], $tmpArr[1]);
         $formatPB = $format[0] . "mm " . $format[1] . "mm";
     } elseif ($Settings["orientation"] == "landscape") {
         $format .= "-L";
         $formatPB .= "-L";
     }
     if (!is_object($mpdf)) {
         $mpdf = new mPDF('', $format, '', '', $Settings["margin_left"], $Settings["margin_right"], 0, 0, $Settings["margin_top"], $Settings["margin_bottom"], $orientation);
         $mpdf->SetAutoFont();
         $this->mpdf_preprocess($mpdf, $templateid, $PDFContent->bridge2mpdf);
         @$mpdf->SetHTMLHeader($header_html);
     } else {
         $this->mpdf_preprocess($mpdf, $templateid, $PDFContent->bridge2mpdf);
         @$mpdf->SetHTMLHeader($header_html);
         @$mpdf->WriteHTML('<pagebreak sheet-size="' . $formatPB . '" orientation="' . $orientation . '" margin-left="' . $Settings["margin_left"] . 'mm" margin-right="' . $Settings["margin_right"] . 'mm" margin-top="0mm" margin-bottom="0mm" margin-header="' . $Settings["margin_top"] . 'mm" margin-footer="' . $Settings["margin_bottom"] . 'mm" />');
     }
     @$mpdf->SetHTMLFooter($footer_html);
     @$mpdf->WriteHTML($body_html);
     $this->mpdf_postprocess($mpdf, $PDFContent->bridge2mpdf);
     //check in case of some error when $mpdf object is not set it is caused by lack of permissions - i.e. when workflow template is 'none'
     if (!is_object($mpdf)) {
         @($mpdf = new mPDF());
         @$mpdf->WriteHTML(vtranslate("LBL_PERMISSION", "PDFMaker"));
     }
     $name = str_replace(array(' ', '/', ','), array('-', '-', '-'), $name);
     return $name;
 }
开发者ID:Wasage,项目名称:werpa,代码行数:55,代码来源:PDFMaker.php

示例15: PDFContent

if ($xx11 != "") {
    $xx10->retrieve_entity_info($xx0e, $xx0f);
    $xx10->id = $xx0e;
    $xx12 = new PDFContent($xx11, $xx0f, $xx10, $_REQUEST["language"]);
    $xx13 = $xx12->getContent();
    $xx14 = $xx12->getSettings();
    $xx15 = $xx1e($xx13["header"], ENT_COMPAT, "utf-8");
    $xx16 = $xx1e($xx13["body"], ENT_COMPAT, "utf-8");
    $xx17 = $xx1e($xx13["footer"], ENT_COMPAT, "utf-8");
    if ($xx14["orientation"] == "landscape") {
        $xx18 = $xx14["format"] . "-L";
    } else {
        $xx18 = $xx14["format"];
    }
    $xx19 = new mPDF('', $xx18, '', 'Arial', $xx14["margin_left"], $xx14["margin_right"], 0, 0, $xx14["margin_top"], $xx14["margin_bottom"]);
    $xx19->SetAutoFont();
    @$xx19->SetHTMLHeader($xx15);
    @$xx19->SetHTMLFooter($xx17);
    @$xx19->WriteHTML($xx16);
    $xx19->Output('cache/' . $xx0f . '.pdf');
    @$xx1f();
    $xx1d('Content-Type: application/pdf');
    $xx1d("Content-length: " . $xx1a("./cache/" . $xx0f . ".pdf"));
    $xx1d("Cache-Control: private");
    $xx1d("Content-Disposition: attachment; filename=" . $xx0f . ".pdf");
    $xx1d("Content-Description: PHP Generated Data");
    echo $xx1b($xx1c("./cache/" . $xx0f . ".pdf", "r"), $xx1a("./cache/" . $xx0f . ".pdf"));
    @$xx20("cache/" . $xx0f . ".pdf");
    exit;
} else {
    echo "ERROR, selected pdf template is wrong";
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:31,代码来源:checkGenerate.php


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