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


PHP mPDF::SetWatermarkText方法代码示例

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


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

示例1: printRelatorioHTMLPDF

 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();
 }
开发者ID:robertcosta,项目名称:symfony-condomino,代码行数:19,代码来源:actions.class.php

示例2: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->bind('mpdf.wrapper', function ($app, $cfg) {
         $app['mpdf.pdf'] = $app->share(function ($app) use($cfg) {
             if (!empty($cfg)) {
                 foreach ($cfg as $key => $value) {
                     Config::set('pdf.' . $key, $value);
                 }
             }
             $mpdf = new \mPDF(Config::get('pdf.mode'), Config::get('pdf.defaultFontSize'), Config::get('pdf.defaultFont'), Config::get('pdf.marginLeft'), Config::get('pdf.marginRight'), Config::get('pdf.marginTop'), Config::get('pdf.marginBottom'), Config::get('pdf.marginHeader'), Config::get('pdf.Footer'), Config::get('pdf.orientation'));
             $permissions = [];
             foreach (Config::get('pdf.protection.permissions') as $perm => $enable) {
                 if ($enable) {
                     $permissions[] = $perm;
                 }
             }
             $mpdf->SetProtection($permissions, Config::get('pdf.protection.user_password'), Config::get('pdf.protection.owner_password'), Config::get('pdf.protection.length'));
             $mpdf->SetTitle(Config::get('pdf.title'));
             $mpdf->SetAuthor(Config::get('pdf.author'));
             $mpdf->SetWatermarkText(Config::get('pdf.watermark'));
             $mpdf->showWatermarkText = Config::get('pdf.showWatermark');
             $mpdf->watermark_font = Config::get('pdf.watermarkFont');
             $mpdf->watermarkTextAlpha = Config::get('pdf.watermarkTextAlpha');
             $mpdf->SetDisplayMode(Config::get('pdf.displayMode'));
             return $mpdf;
         });
         return new PdfWrapper($app['mpdf.pdf']);
     });
 }
开发者ID:kendu,项目名称:l5-mpdf,代码行数:34,代码来源:ServiceProvider.php

示例3: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->bind('mpdf.wrapper', function ($app, $cfg) {
         if ($cfg) {
             $app['mpdf.pdf'] = $app->share(function ($app) use($cfg) {
                 $mpdf = new \mPDF($cfg[0], $cfg[1], $cfg[2], $cfg[3], $cfg[4], $cfg[5], $cfg[6], $cfg[7], $cfg[8], $cfg[9], $cfg[10]);
                 $mpdf->SetProtection(array('print'));
                 $mpdf->SetTitle("");
                 $mpdf->SetAuthor("");
                 $mpdf->SetWatermarkText("");
                 $mpdf->showWatermarkText = true;
                 $mpdf->watermark_font = 'DejaVuSansCondensed';
                 $mpdf->watermarkTextAlpha = 0.1;
                 $mpdf->SetDisplayMode('fullpage');
                 return $mpdf;
             });
         } else {
             $mpdf = new \mPDF('th', 'A4', '', '', 10, 10, 10, 10, 10, 5);
             $mpdf->SetProtection(array('print'));
             $mpdf->SetTitle("");
             $mpdf->SetAuthor("");
             $mpdf->SetWatermarkText("");
             $mpdf->showWatermarkText = true;
             $mpdf->watermark_font = 'DejaVuSansCondensed';
             $mpdf->watermarkTextAlpha = 0.1;
             $mpdf->SetDisplayMode('fullpage');
             $app['mpdf.pdf'] = $mpdf;
         }
         return new PdfWrapper($app['mpdf.pdf']);
     });
     // // work --------------------------------------------------------------------------start ----------
     // 	$this->app['mpdf.pdf'] = $this->app->share(function($app)
     // 	{
     // 		// $cfg =['th','A0','','',10,10,10,10,10,5,'L'];
     // 		$cfg = $app['config']['mpdfconfig.pdf.options'];
     // 		consolelog('cfg',$cfg);
     // 		if($cfg) {
     // 			$mpdf = new \mPDF( $cfg[0],$cfg[1],$cfg[2],$cfg[3],$cfg[4],$cfg[5],$cfg[6],$cfg[7],$cfg[8],$cfg[9],$cfg[10] );
     // 		} else {
     // 			$mpdf=new \mPDF('th','A4','','',10,10,10,10,10,5);
     // 		}
     // 		$mpdf->SetProtection(array('print'));
     // 		$mpdf->SetTitle("TOMATO POS - Invoice");
     // 		$mpdf->SetAuthor("Thongchai Lim");
     // 		$mpdf->SetWatermarkText("Paid");
     // 		$mpdf->showWatermarkText = true;
     // 		$mpdf->watermark_font = 'DejaVuSansCondensed';
     // 		$mpdf->watermarkTextAlpha = 0.1;
     // 		$mpdf->SetDisplayMode('fullpage');
     // 		return $mpdf;
     // 	});
     // 	$this->app['mpdf.wrapper'] = $this->app->share(function($app)
     // 	{
     // 		return new PdfWrapper($app['mpdf.pdf']);
     // 	});
     // // work --------------------------------------------------------------------------end----------
 }
开发者ID:maspriyono,项目名称:l5mpdf,代码行数:62,代码来源:ServiceProvider.php

示例4: 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

示例5: pdf_echo

function pdf_echo($filename = "")
{
    global $__pdf_html, $__pdf_orientation, $__pdf_wm_text, $__pdf_wm_img, $__pdg_pgn_pos, $__pdf_title, $__pdf_subject, $__pdf_author, $__pdf_creator, $__pdf_keywords, $__pdf_wm_talpha, $__pdf_wm_font, $__pdf_wm_ialpha, $__pdf_pgn_text, $__pdf_pgn_pos, $__pdf_pgn_oalign, $__pdf_pgn_ealign, $__pdf_pgn_show, $__pdf_pgn_fcolor, $__pdf_pgn_ftype, $__pdf_pgn_fsize, $__pdf_pgn_fstyle, $__pdf_pgn_lstyle, $__pdf_pgn_lwidth, $__pdf_pgn_lcolor, $__pdf_pgmargin_l, $__pdf_pgmargin_r, $__pdf_pgmargin_t, $__pdf_pgmargin_b, $__pdf_pgmargin_h, $__pdf_pgmargin_f;
    require_once dirname(__FILE__) . "/__RES__/mpdf.php";
    $pdf = new mPDF("th");
    $pdf->useOddEven = 1;
    if ($__pdf_pgn_show) {
        $dv1 = "<div style=\"{$__pdf_pgn_fcolor};width:auto;text-align:";
        $dv2 = ";{$__pdf_pgn_ftype}{$__pdf_pgn_fsize}{$__pdf_pgn_fstyle}";
        $dv3 = "style:{$__pdf_pgn_lstyle};";
        $dv4 = "width:{$__pdf_pgn_lwidth};";
        $dv5 = "color:{$__pdf_pgn_lcolor};";
        $dv6 = "\">{$__pdf_pgn_text}</div>";
        if ($__pdf_pgn_pos == "TOP") {
            $align = $__pdf_pgn_oalign;
            $border = "border-bottom-";
            $pgh_o = "{$dv1}{$align}{$dv2}{$border}{$dv3}{$border}{$dv4}{$border}{$dv5}{$dv6}";
            $pdf->DefHTMLHeaderByName("ho", $pgh_o);
            $align = $__pdf_pgn_ealign;
            $pgh_e = "{$dv1}{$align}{$dv2}{$border}{$dv3}{$border}{$dv4}{$border}{$dv5}{$dv6}";
            $pdf->DefHTMLHeaderByName("he", $pgh_e);
            $pdf->AddPage($__pdf_orientation, '', '', '', '', $__pdf_pgmargin_l, $__pdf_pgmargin_r, $__pdf_pgmargin_t, $__pdf_pgmargin_b, $__pdf_pgmargin_h, $__pdf_pgmargin_f, 'html_ho', 'html_he', '', '', 1, 1, 0, 0);
        } else {
            if ($__pdf_pgn_pos == "BOTTOM") {
                $align = $__pdf_pgn_oalign;
                $border = "border-top-";
                $pgf_o = "{$dv1}{$align}{$dv2}{$border}{$dv3}{$border}{$dv4}{$border}{$dv5}{$dv6}";
                $pdf->DefHTMLFooterByName("fo", $pgf_o);
                $align = $__pdf_pgn_ealign;
                $pgf_e = "{$dv1}{$align}{$dv2}{$border}{$dv3}{$border}{$dv4}{$border}{$dv5}{$dv6}";
                $pdf->DefHTMLFooterByName("fe", $pgf_e);
                $pdf->AddPage($__pdf_orientation, '', '', '', '', $__pdf_pgmargin_l, $__pdf_pgmargin_r, $__pdf_pgmargin_t, $__pdf_pgmargin_b, $__pdf_pgmargin_h, $__pdf_pgmargin_f, '', '', 'html_fo', 'html_fe', 0, 0, 1, 1);
            }
        }
    } else {
        $pdf->AddPage($__pdf_orientation);
    }
    $pdf->SetTitle($__pdf_title);
    $pdf->SetAuthor($__pdf_author);
    $pdf->SetCreator($__pdf_creator);
    $pdf->SetSubject($__pdf_subject);
    $pdf->SetKeywords($__pdf_keywords);
    if ($__pdf_wm_text != "") {
        $pdf->SetWatermarkText($__pdf_wm_text, $__pdf_wm_talpha);
        $pdf->showWatermarkText = true;
        if ($__pdf_wm_font) {
            $pdf->watermark_font = $__pdf_wm_font;
        }
    }
    if (file_exists($__pdf_wm_img)) {
        $pdf->SetWatermarkImage($__pdf_wm_img, $__pdf_wm_ialpha);
        $pdf->showWatermarkImage = true;
    }
    $pdf->WriteHTML($__pdf_html);
    $pdf->Output($filename, $dest);
}
开发者ID:Kunnapat,项目名称:chowtime,代码行数:56,代码来源:thaipdf.php

示例6: pdfprint

 public function pdfprint($id = null)
 {
     $recibo = $this->Recibos->get($id, ['contain' => ['Clients', 'CuotasPolizas']]);
     $this->response->header(['Content-type: application/pdf;', 'Content-Disposition: inline;']);
     $estilos = file_get_contents(WWW_ROOT . DS . 'htm' . DS . 'recibo01.css');
     $body = file_get_contents(WWW_ROOT . DS . 'htm' . DS . 'recibo01.htm');
     $body = $this->entityToHtml($recibo, $body);
     $pdf = new \mPDF('', array(210, 148));
     //porque mpdf no usa namespaces
     $pdf->SetWatermarkText('ORIGINAL', 0.1);
     $pdf->showWatermarkText = true;
     $pdf->WriteHTML($estilos, 1);
     // 1 significa solo estilos
     $pdf->WriteHTML($body, 2);
     // 2 significa solo html
     $pdf->addPage();
     $pdf->SetWatermarkText('COPIA', 0.1);
     $pdf->showWatermarkText = true;
     $pdf->WriteHTML($body, 2);
     // 2 significa solo html
     $pdf->Output();
     /*
     $this->viewBuilder()->layout('ajax');
     $recibo = $this->Recibos->get($id, [
         'contain' => ['Clients', 'CuotasPolizas']
     ]);
     $this->set('recibo', $recibo);
     $this->set('_serialize', ['recibo']);
     */
 }
开发者ID:ElWray,项目名称:JCMv2,代码行数:30,代码来源:RecibosController.php

示例7: generate

 /**
  * 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);
 }
开发者ID:setasss,项目名称:woocommerce-pdf-invoices,代码行数:37,代码来源:abstract-bewpi-document.php

示例8: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     // load config
     $this->mergeConfigFrom(__DIR__ . '/../../config/pdf.php', 'pdf');
     // bind wrapper
     $this->app->bind('mpdf.wrapper', function ($app, $cfg) {
         $app['mpdf.pdf'] = $app->share(function ($app) use($cfg) {
             if (!empty($cfg)) {
                 foreach ($cfg as $key => $value) {
                     Config::set('pdf.' . $key, $value);
                 }
             }
             $mpdf = new \mPDF(Config::get('pdf.mode'), Config::get('pdf.format'), Config::get('pdf.defaultFontSize'), Config::get('pdf.defaultFont'), Config::get('pdf.marginLeft'), Config::get('pdf.marginRight'), Config::get('pdf.marginTop'), Config::get('pdf.marginBottom'), Config::get('pdf.marginHeader'), Config::get('pdf.marginFooter'), Config::get('pdf.orientation'));
             $mpdf->SetProtection(array('print'));
             $mpdf->SetTitle(Config::get('pdf.title'));
             $mpdf->SetAuthor(Config::get('pdf.author'));
             $mpdf->SetWatermarkText(Config::get('pdf.watermark'));
             $mpdf->showWatermarkText = Config::get('pdf.showWatermark');
             $mpdf->watermark_font = Config::get('pdf.watermarkFont');
             $mpdf->watermarkTextAlpha = Config::get('pdf.watermarkTextAlpha');
             $mpdf->SetDisplayMode(Config::get('pdf.displayMode'));
             return $mpdf;
         });
         return new PdfWrapper($app['mpdf.pdf']);
     });
 }
开发者ID:donnykurnia,项目名称:l5mpdf,代码行数:31,代码来源:ServiceProvider.php

示例9: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->mergeConfigFrom(__DIR__ . '/../config/pdf.php', 'pdf');
     $this->app->bind('mpdf.wrapper', function ($app, $cfg) {
         if (Config::has('pdf.custom_font_path') && Config::has('pdf.custom_font_data')) {
             define(_MPDF_SYSTEM_TTFONTS_CONFIG, __DIR__ . '/../mpdf_ttfonts_config.php');
         }
         $mpdf = new \mPDF(Config::get('pdf.mode'), Config::get('pdf.format'), Config::get('pdf.default_font_size'), Config::get('pdf.default_font'), Config::get('pdf.margin_left'), Config::get('pdf.margin_right'), Config::get('pdf.margin_top'), Config::get('pdf.margin_bottom'), Config::get('pdf.margin_header'), Config::get('pdf.margin_footer'), Config::get('pdf.orientation'));
         $mpdf->SetTitle(Config::get('pdf.title'));
         $mpdf->SetAuthor(Config::get('pdf.author'));
         $mpdf->SetWatermarkText(Config::get('pdf.watermark'));
         $mpdf->SetDisplayMode(Config::get('pdf.display_mode'));
         $mpdf->showWatermarkText = Config::get('pdf.show_watermark');
         $mpdf->watermark_font = Config::get('pdf.watermark_font');
         $mpdf->watermarkTextAlpha = Config::get('pdf.watermark_text_alpha');
         return new PdfWrapper($mpdf);
     });
 }
开发者ID:niklasravnsborg,项目名称:laravel-pdf,代码行数:23,代码来源:PdfServiceProvider.php

示例10: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->package('kendu/l4-mpdf');
     $this->app['mpdf.pdf'] = $this->app->share(function ($app) {
         $base = $app['config']->get('l4-mpdf::config.pdf.base');
         $options = $app['config']->get('l4-mpdf::config.pdf.options');
         $mpdf = new \mPDF(Config::get('pdf.mode'), Config::get('pdf.defaultFontSize'), Config::get('pdf.defaultFont'), Config::get('pdf.marginLeft'), Config::get('pdf.marginRight'), Config::get('pdf.marginTop'), Config::get('pdf.marginBottom'), Config::get('pdf.marginHeader'), Config::get('pdf.Footer'), Config::get('pdf.orientation'));
         $mpdf->SetProtection(array('print'));
         $mpdf->SetTitle(Config::get('pdf.title'));
         $mpdf->SetAuthor(Config::get('pdf.author'));
         $mpdf->SetWatermarkText(Config::get('pdf.watermark'));
         $mpdf->showWatermarkText = Config::get('pdf.showWatermark');
         $mpdf->watermark_font = Config::get('pdf.watermarkFont');
         $mpdf->watermarkTextAlpha = Config::get('pdf.watermarkTextAlpha');
         $mpdf->SetDisplayMode(Config::get('pdf.displayMode'));
         return $mpdf;
     });
     $this->app['mpdf.wrapper'] = $this->app->share(function ($app) {
         return new PdfWrapper($app['mpdf.pdf']);
     });
 }
开发者ID:kendu,项目名称:l4-mpdf,代码行数:26,代码来源:ServiceProvider.php

示例11: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->package('shinomontaz/l4-mpdf');
     if ($this->app['config']->get('l4-mpdf::config.pdf.enabled')) {
         $this->app['mpdf.pdf'] = $this->app->share(function ($app) {
             $base = $app['config']->get('l4-mpdf::config.pdf.base');
             $options = $app['config']->get('l4-mpdf::config.pdf.options');
             $mpdf = new \mPDF('win-1252', 'A4', '', '', 10, 10, 40, 35, 10, 5);
             $mpdf->SetProtection(array('print'));
             $mpdf->SetTitle("Acme Trading Co. - Invoice");
             $mpdf->SetAuthor("Acme Trading Co.");
             $mpdf->SetWatermarkText("Paid");
             $mpdf->showWatermarkText = false;
             $mpdf->watermark_font = 'DejaVuSansCondensed';
             $mpdf->watermarkTextAlpha = 0.1;
             $mpdf->SetDisplayMode('fullpage');
             return $mpdf;
         });
         $this->app['mpdf.wrapper'] = $this->app->share(function ($app) {
             return new PdfWrapper($app['mpdf.pdf']);
         });
     }
 }
开发者ID:shinomontaz,项目名称:l4-mpdf,代码行数:28,代码来源:ServiceProvider.php

示例12: mPDF

            <td>'.$quotation->tax_amount.'</td>
          </tr>
          <tr>
          	<td><b>Total</b></td>
            <td>'.$quotation->grand_total.'</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
</body>'
   ;
    
$mpdf=new mPDF('c','A4','','',20,15,48,25,10,10); 
$mpdf->SetProtection(array('print'));
$mpdf->SetTitle("Acme Trading Co. - Invoice");
$mpdf->SetAuthor("Acme Trading Co.");
$mpdf->SetWatermarkText($quotation->payment_term);
$mpdf->showWatermarkText = true;
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->watermarkTextAlpha = 0.1;
$mpdf->SetDisplayMode('fullpage');
 

$mpdf->WriteHTML($html);

$mpdf->Output($filename . '.pdf', 'D');
//$mpdf->Output(); exit;

exit;
开发者ID:BersnardC,项目名称:DROPINN,代码行数:31,代码来源:quotation_print.php

示例13: mPDF

</tbody>
</table>


<div style="text-align: center; font-style: italic;">Payment terms: payment due in 30 days</div>


</body>
</html>
';
//==============================================================
//==============================================================
//==============================================================
//==============================================================
//==============================================================
//==============================================================
define('_MPDF_PATH', '../');
include "../mpdf.php";
$mpdf = new mPDF('c', 'A4', '', '', 20, 15, 48, 25, 10, 10);
$mpdf->SetProtection(array('print'));
$mpdf->SetTitle("Acme Trading Co. - Invoice");
$mpdf->SetAuthor("Acme Trading Co.");
$mpdf->SetWatermarkText("Paid");
$mpdf->showWatermarkText = true;
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->watermarkTextAlpha = 0.1;
$mpdf->SetDisplayMode('fullpage');
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
exit;
开发者ID:ittiwat,项目名称:dpf_project,代码行数:31,代码来源:example34_invoice_example.php

示例14: strlen

$row = mysql_fetch_array($res);
//NUMERO FACTURA
$numi = "";
$largura = strlen($row['numero']);
for ($xz = $largura; $xz < 5; $xz++) {
    $numi .= "0";
}
$numpresupuesto = "SN-" . $numi . $row['numero'] . "/" . substr($row['fecha'], 0, 4);
include "../includes/mpdf60/mpdf.php";
$mpdf = new mPDF('win-1252', 'A4', '', '', 0, 0, 30, 25, 0, 0);
$mpdf->useOnlyCoreFonts = true;
// false is default
$mpdf->SetProtection(array('print'));
$mpdf->SetTitle("EMPRESA - Presupuesto");
$mpdf->SetAuthor("EMPRESA");
$mpdf->SetWatermarkText("PRESUPUESTO");
$mpdf->showWatermarkText = true;
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->watermarkTextAlpha = 0.05;
$mpdf->SetDisplayMode('fullpage');
/*CABECERA Y ESTILOS*/
$html = "\n<html>\n\t<head>\n\t\t<style>\n\t\t\tbody{\n\t\t\t\t/*font-family: sans-serif;*/\n\t\t\t\tfont-family: DejaVuSansCondensed;\n    \t\t\tfont-size: 10pt;\n\t\t\t}\n\t\t\t.cabecera,\n\t\t\t.cliente,\n\t\t\t.contenido,\n\t\t\t.row{\n\t\t\t\tpadding: 0px 20px 0px 20px;\n\t\t\t}\n\t\t\t.cabecera{padding-top: 15px;}\n\t\t\t.cliente{padding:5px 50px;}\n\t\t\t.contenido{padding: 0px 35px;}\n\t\t\t.pie{\n\t\t\t\tbackground: #E5008F;\n\t\t\t\tcolor: #FFFFFF;\n\t\t\t\tfont-size: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\tpadding: 10px; \n\t\t\t}\n\t\t\thr{\n\t\t\t\tcolor: #E5008F;\n\t\t\t\tbackground-color: #E5008F;\n\t\t\t\theight: 1px;\n\t\t\t}\n\t\t\tp{\n\t\t\t\tmargin: 0px;\n\t\t\t}\n\t\t\tspan.icono{font-size: 14px;}\n\t\t\ttd{\n\t\t\t\tvertical-align: top;\n\t\t\t}\n\t\t\t.items td\n\t\t\t{\n    \t\t\tborder-left: 0.1mm solid #000000;\n    \t\t\tborder-right: 0.1mm solid #000000;\n\t\t\t}\n\t\t\t.items td.zebra{\n\t\t\t\tbackground: #EEE;\n\t\t\t}\n\t\t\t.items td.titulor{\n\t\t\t\tbackground: #E5008F;\n\t\t\t\tcolor: #FFF;\n\t\t\t}\n\t\t\t.items td.blanktotal\n\t\t\t{\n    \t\t\tbackground-color: #FFFFFF;\n    \t\t\tborder: 0mm none #000000;\n    \t\t\tborder-top: 0.1mm solid #000000;\n    \t\t\tborder-right: 0.1mm solid #000000;\n\t\t\t}\n\t\t\ttable thead td\n\t\t\t{\n\t\t\t\tbackground-color: #EEE;\n    \t\t\ttext-align: center;\n    \t\t\tborder: 0.1mm solid #000000;\n\t\t\t}\t\t\t\n\t\t\ttd.totals\n\t\t\t{\n    \t\t\ttext-align: right;\n    \t\t\tbackground: #EEE;\n    \t\t\tborder: 0.1mm solid #000000;\n\t\t\t}\n\t\t\t.lateral {\n\t\t\t\tposition: absolute; \n\t\t\t\toverflow: auto; \n\t\t\t\tleft: 0;\n\t\t\t\tbottom: 20mm; \n\t\t\t\twidth: 250mm; \n\t\t\t\tpadding: 10px 0px 0px 0px; \n\t\t\t\tfont-family:sans; \n\t\t\t\tmargin: 0px;\n\t\t\t\trotate: -90;\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-size: 8px;\n\t\t\t}\n\t\t\t.email{color:#FFF; text-decoration: none;}\n\t\t\t.paginador{text-align: right; font-size: 8px;}\n\t\t</style>\n\t</head>";
//DEFINICION CABECERA Y PIE
$html .= '
	<body>
		<!--mpdf
			<htmlpageheader name="myheader">
				<div class="cabecera">
					<table width="100%">
						<tr>
							<td width="40%"><img src="' . BASEURL . '/imagenes/logo.jpg" style="width:275px" /></td>
开发者ID:Gorehide,项目名称:kengo,代码行数:31,代码来源:pres_pdf_m.php

示例15: uploadfile

 public function uploadfile()
 {
     $folder = isset($_GET['folder']) ? $_GET['folder'] : 'others';
     $targetFolder = "/upload_file/{$folder}";
     $prefix = time();
     $setting = $this->general_model->get_email_from_setting();
     $type = explode(",", $setting[0]['download_type']);
     foreach ($type as $key => $value) {
         $type[$key] = strtolower($value);
     }
     $userid = $_SESSION['user']['user_id'];
     if (!empty($_FILES)) {
         $_FILES["Filedata"]["name"] = str_replace(' ', '', $_FILES["Filedata"]["name"]);
         $_FILES["Filedata"]["tmp_name"] = str_replace(' ', '', $_FILES["Filedata"]["tmp_name"]);
         $uploaddatafile1 = md5($_FILES["Filedata"]["name"]);
         $tempFile = $_FILES["Filedata"]["tmp_name"];
         $targetPath = $_SERVER["DOCUMENT_ROOT"] . $targetFolder;
         $targetFile = rtrim($targetPath, "/") . "/" . $_FILES["Filedata"]["name"];
         $fileTypes = $type;
         //array("zip","rar");
         $fileParts = pathinfo($_FILES["Filedata"]["name"]);
         if (in_array(strtolower($fileParts["extension"]), $fileTypes)) {
             move_uploaded_file($tempFile, $targetFile);
             if (isset($_GET['w'])) {
                 $w = $_GET['w'];
             } else {
                 $w = 100;
             }
             if (isset($_GET['h'])) {
                 $h = $_GET['h'];
             } else {
                 $h = 100;
             }
             $path_upload = "upload_file/{$folder}/" . $_FILES["Filedata"]["name"];
             $root = dirname(dirname(dirname(__FILE__)));
             $file = '/' . $path_upload;
             //a reference to the file in reference to the current working directory.
             // Process for image
             $image_info = @getimagesize(base_url() . $path_upload);
             if (!empty($image_info)) {
                 $image = true;
             } else {
                 $image = false;
             }
             if ($image) {
                 if (!isset($_SESSION['fileuploadname'])) {
                     $_SESSION['fileuploadname'] = $_FILES["Filedata"]["name"];
                     $_SESSION['fileuploadhtml'] = '';
                 } else {
                     if (empty($_SESSION['fileuploadname'])) {
                         $_SESSION['fileuploadname'] = $_FILES["Filedata"]["name"];
                         $_SESSION['fileuploadhtml'] = '';
                     }
                 }
                 $_SESSION['fileuploadhtml'] .= '<img src="' . base_url() . $path_upload . '" style="width:850px;"/>';
                 echo "2";
                 exit;
             }
             include $root . "/mpdf/mpdf.php";
             require_once $root . "/scribd.php";
             $scribd_api_key = "766ydp7ellofhr7x027wl";
             $scribd_secret = "sec-7zrz2fxxa2chak965tbp67npqw";
             $scribd = new Scribd($scribd_api_key, $scribd_secret);
             $doc_type = null;
             $access = "private";
             $rev_id = null;
             $data = $scribd->upload($file, $doc_type, $access, $rev_id);
             if (!empty($data)) {
                 $result = 0;
                 while ($result == 0) {
                     echo $result = $scribd->getDownloadLinks($data['doc_id']);
                 }
                 file_put_contents('/upload_file/files/c' . $uploaddatafile1 . ".pdf", fopen($result["download_link"], 'r'));
                 //file_put_contents( fopen($result["download_link"], 'r'));
                 $mpdf = new mPDF();
                 $mpdf->SetImportUse();
                 $pagecount = $mpdf->SetSourceFile('/upload_file/files/r' . $uploaddatafile1 . ".pdf");
                 $tplId = $mpdf->ImportPage(1);
                 $mpdf->UseTemplate($tplId);
                 $mpdf->SetDisplayMode('fullpage');
                 $mpdf->SetWatermarkText(' ');
                 $mpdf->watermark_font = 'DejaVuSansCondensed';
                 $mpdf->showWatermarkText = true;
                 $md5 = $uploaddatafile1;
                 $mpdf->Output('/upload_file/files/' . $md5 . '.pdf', '');
                 $mpdf->Thumbnail('/upload_file/files/' . $md5 . '.pdf', 1);
                 $mpdf->Output('/upload_file/files/' . $md5 . '.pdf', '');
                 unlink('/upload_file/files/c' . $uploaddatafile1 . ".pdf");
                 $im = new imagick();
                 $im->readimage('/upload_file/files/' . $md5 . '.pdf');
                 //$im->readimage('/upload_file/files/'.$md5.'.pdf');
                 $im->setImageCompressionQuality(0);
                 $im->setImageFormat('jpeg');
                 $im->writeImage('/upload_file/images/r' . $md5 . '.jpg');
                 $this->db->set('id', $userid);
                 $this->db->set('fullpdf', '/upload_file/files/r' . $uploaddatafile1 . '.pdf');
                 $this->db->set('pdf', '/upload_file/files/' . $md5 . '.pdf');
                 $this->db->set('image', '/upload_file/images/r' . $md5 . '.jpg');
                 $this->db->insert('scribe');
                 $im->clear();
//.........这里部分代码省略.........
开发者ID:kuldeepro,项目名称:notesgen,代码行数:101,代码来源:pages.php


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