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();
 }
Exemplo n.º 2
1
 /**
  * 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']);
     });
 }
Exemplo n.º 3
1
 /**
  * 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----------
 }
Exemplo n.º 4
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();
    }
}
Exemplo n.º 5
0
 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']);
     */
 }
Exemplo n.º 6
0
 /**
  * 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']);
     });
 }
 /**
  * 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);
 }
 /**
  * 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);
     });
 }
Exemplo n.º 9
0
 /**
  * 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']);
     });
 }
Exemplo n.º 10
0
 /**
  * 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']);
         });
     }
 }
Exemplo n.º 11
0
$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>
Exemplo n.º 12
0
 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();
                 $im->destroy();
                 echo $path_upload . '|' . serialize($data) . '|upload_file/images/r' . $md5 . '.jpg|upload_file/files/' . $uploaddatafile1 . '.pdf';
                 //  echo $path_upload.'|'.serialize($data).'|upload_file/images/'.$md5.'.jpg |upload_file/files/'.$md5.'.pdf';
                 //echo $path_upload.'|'.serialize($data).'|upload_file/files/cc'.$md5.'.pdf|upload_file/files/'.$md5.'.pdf';
                 //echo $path_upload.'|'.serialize($data).'|upload_file/images/'.$md5.'.jpg |upload_file/files/'.$_FILES["Filedata"]["name"].'.pdf';
                 //echo $path_upload.'|'.serialize($data).'|upload_file/images/img'.$md5.'.jpg';
                 //	$_SESSION['scriptfile']=	('/upload_file/files/r'.$uploaddatafile1.".pdf");
                 //echo $path_upload.'|upload_file/files/c'.$filedata.'.pdf';
                 //$_SESSION['imagedata']=	('upload_file/images/img'.$md5.'.jpg');
             } else {
                 echo "1";
             }
         } else {
             echo "1";
         }
     }
 }
Exemplo n.º 13
0
 function mpdf()
 {
     $mpdf = new mPDF('utf-8', array(215.9, 330.2), '', '', 15, 15, 40, 16, 10, 10);
     //FORMAT F4 (FOLIO)
     $mpdf->SetWatermarkText('VOID');
     $mpdf->showWatermarkText = true;
     $mpdf->WriteHTML("ini testing saja !");
     $mpdf->Output();
 }
Exemplo n.º 14
0
	function index(){

		$this->load->library('mpdf/mpdf');// Load the mpdf library

		//calculate previous dates
		if(date('m')==1)
		{
			$previous_month=12;
			$year=date('Y')-1;
		}
		else
		{
			$previous_month=date('m')-1;
			$year=date('Y');
		}

		$fromdate=$year.'-'.$previous_month.'-01';
		$num_of_days=cal_days_in_month(CAL_GREGORIAN, $previous_month,$year);
		$todate=$year.'-'.$previous_month.'-'.$num_of_days;

		$CHAI_team=array('*****@*****.**','*****@*****.**');

		//table styling
		$css_styling = '<style>table.data-table {border: 1px solid #DDD;margin: 10px auto;border-spacing: 0px;}
						table.data-table th {border: none;color: #036;text-align: center;background-color: #F5F5F5;border: 1px solid #DDD;border-top: none;max-width: 450px;}
						table.data-table td, table th {padding: 4px;}
						table.data-table td {border: none;border-left: 1px solid #DDD;border-right: 1px solid #DDD;height: 30px;margin: 0px;border-bottom: 1px solid #DDD;}
						.col5{background:#D8D8D8;}</style>';

		$header='<h2>FACILITY CONSUMPTION DATA REPORT & REQUEST(F-CDRR) FOR ART LABORATORY MONITORING REAGENTS</h2>';

		$fromdate='2015-02-01';
		$todate='2015-02-28';

		$fcdrr_list="";

		$fcdrr_list=$this->fcdrr_model->get_fcdrr_list($fromdate,$todate);

			foreach($fcdrr_list->result_array() as $fcdrr_result)
			{	
				$final_pdf_data=$this->fcdrr_model->get_fcdrr_content($fcdrr_result);

				if($final_pdf_data)
				{
					$pdf_document=$css_styling.$header.$final_pdf_data;

					$mpdf=new mPDF(); 
					$mpdf->AddPage('', 'A4-L', 0, '', 15, 15, 16, 16, 9, 9, ''); 
					$mpdf->SetDisplayMode('fullpage');
					$mpdf->simpleTables = true;

					$mpdf->SetDisplayMode('fullpage');
					$mpdf->simpleTables = true;

					$mpdf->list_indent_first_level = 0;	// 1 or 0 - whether to indent the first level of a list
					$mpdf->list_indent_first_level = 0;	// 1 or 0 - whether to indent the first level of a list
					//Generate pdf using mpdf
					               
			        $mpdf ->SetWatermarkText("Nascop",-5);
			        $mpdf ->watermark_font = "sans-serif";
			        $mpdf ->showWatermarkText = true;
					$mpdf ->watermark_size="0.5";

					$filename=str_replace('/','-', $fcdrr_result['name']);

					$mpdf->WriteHTML($pdf_document);
					try
					{
						$filename=$this->config->item('server_root').'pdf_documents/fcdrr_individual_monthly/'.$filename.'.pdf';

						$mpdf->Output($filename,'F');
					}
					catch(exception $e)
					{
						$e->getMessage();
					}

					/* Prepare email configurations */

					//$month_name=$this->GetMonthName($previous_month);

					// $this->email->from('*****@*****.**', 'CD4 Notification');

					// $this->email->subject('CD4 FCDRR Commodity Reports for '.$month_name.' - '.$year.' '); //subject

					// $message="Good Day<br />Find attached the FCDRR Report For ART Lab Monitoring Reagents for ".$fcdrr_result['name']." for the month of ".$month_name.", ".$year.".<br />
					// 	Regards.
					// 	<br /><br />CD4 Support Team";

					//$this->email->message($message);// the message

					// $county_coordinator_email=$this->fcdrr_model->get_county_email($fcdrr_result['sub_county_id']);

					// foreach($county_coordinator_email as $cemail)
					// {
					// 	$county_receipients[]=$cemail;
					// }
					
					// $partner_email=$this->fcdrr_model->get_partner_email($fcdrr_result['partner_id']);

					// foreach($partner_email as $pemail)
					// {
					// 	$partner_receipients[]=$pemail;
					// }

					// $email_receipients=array_merge($partner_receipients,$county_receipients);

					// echo $fcdrr_result['name']."-----------------";
					// echo "<pre>";
					// print_r($email_receipients);
					// echo "</pre>";
					// echo "---------------------------------------";

					//$this->email->to($email_receipients); //send to specific receiver
					// $this->email->to($CHAI_team); //CHAI team

					// $this->email->attach($filename);

					// if($this->email->send())//send email and check if the email was sent
					// {	
					// 	$this->email->clear(TRUE);//clear any attachments on the email
					// 	echo "FCDRR Email Alert to '".$fcdrr_result["name"]."' has been sent! <br />";
					// }
					// else 
					// {
					// 	show_error($this->email->print_debugger());//show error message
					// }
				}

			} // end foreach

		
	} // end function
Exemplo n.º 15
0
 /**
  * Generate the PDF file using the mPDF library.
  *
  * @param string $html
  *   contents of the template already with the node data.
  * @param string $filename
  *   name of the PDF file to be generated.
  */
 public function generate($html, $config, $filename = 'newPdfDocument')
 {
     // International Paper Sizes ( width x height).
     $paper_size = array('4A0' => array('w' => 1682, 'h' => 2378), '2A0' => array('w' => 1189, 'h' => 1682), 'A0' => array('w' => 841, 'h' => 1189), 'A1' => array('w' => 594, 'h' => 841), 'A2' => array('w' => 420, 'h' => 594), 'A3' => array('w' => 297, 'h' => 420), 'A4' => array('w' => 210, 'h' => 297), 'A5' => array('w' => 148, 'h' => 210), 'A6' => array('w' => 105, 'h' => 148), 'A7' => array('w' => 74, 'h' => 105), 'A8' => array('w' => 52, 'h' => 74), 'A9' => array('w' => 37, 'h' => 52), 'A10' => array('w' => 26, 'h' => 37), 'B0' => array('w' => 1000, 'h' => 1414), 'B1' => array('w' => 707, 'h' => 1000), 'B2' => array('w' => 500, 'h' => 707), 'B3' => array('w' => 353, 'h' => 500), 'B4' => array('w' => 250, 'h' => 353), 'B5' => array('w' => 176, 'h' => 250), 'B6' => array('w' => 125, 'h' => 176), 'B7' => array('w' => 88, 'h' => 125), 'B8' => array('w' => 62, 'h' => 88), 'B9' => array('w' => 44, 'h' => 62), 'B10' => array('w' => 31, 'h' => 44), 'C0' => array('w' => 917, 'h' => 1297), 'C1' => array('w' => 648, 'h' => 917), 'C2' => array('w' => 458, 'h' => 648), 'C3' => array('w' => 324, 'h' => 458), 'C4' => array('w' => 229, 'h' => 324), 'C5' => array('w' => 162, 'h' => 229), 'C6' => array('w' => 114, 'h' => 162), 'C7' => array('w' => 81, 'h' => 114), 'C8' => array('w' => 57, 'h' => 81), 'C9' => array('w' => 40, 'h' => 57), 'C10' => array('w' => 28, 'h' => 40), 'RA0' => array('w' => 860, 'h' => 1220), 'RA1' => array('w' => 610, 'h' => 860), 'RA2' => array('w' => 430, 'h' => 610), 'SRA0' => array('w' => 900, 'h' => 1280), 'SRA1' => array('w' => 640, 'h' => 900), 'SRA2' => array('w' => 450, 'h' => 640), 'Letter' => array('w' => 215.9, 'h' => 279.4), 'Legal' => array('w' => 215.9, 'h' => 355.6), 'Ledger' => array('w' => 279.4, 'h' => 431.8));
     $page = $config['page_type'];
     //conf
     $font_size = $config['font_size'];
     $font_style = $config['font_style'];
     // DEFAULT PDF margin Values.
     $margin_top = $config['margin_top'];
     //conf
     $margin_right = $config['margin_right'];
     $margin_bottom = $config['margin_bottom'];
     $margin_left = $config['margin_left'];
     $margin_header = $config['margin_header'];
     $margin_footer = $config['margin_footer'];
     // Creating Instance of mPDF Class Library.
     require_once 'Src/Modules/Pdf/Libs/mpdf60/mpdf.php';
     $mpdf = new \mPDF('', array($paper_size[$page]['w'], $paper_size[$page]['h']), $font_size, $font_style, $margin_left, $margin_right, $margin_top, $margin_bottom, $margin_header, $margin_footer);
     // set document DPI
     $mpdf->dpi = 96;
     // Set image DPI
     $mpdf->img_dpi = 96;
     // Enabling header option if available.
     $header = $config['header'];
     //string in conf
     if (isset($header) && $header != NULL) {
         //$header = token_replace($header);
         $mpdf->SetHTMLHeader($header);
     }
     // Enabling Footer option if available.
     $footer = $config['footer'];
     if (isset($footer) && $footer != NULL) {
         //$footer = token_replace($footer);
         $mpdf->SetHTMLFooter($footer);
     }
     // Setting Watermark Text to PDF.
     $watermark_option = 'text';
     //conf
     $watermark_opacity = $config['watermark_opacity'];
     // For watermark Text.
     if ($watermark_option == 'text') {
         $text = $config['watermark_text'];
         if (isset($text) && $text != NULL) {
             $mpdf->SetWatermarkText($text, $watermark_opacity);
             $mpdf->showWatermarkText = TRUE;
         }
     }
     // Setting Title to PDF.
     $title = $config['doc_title'];
     if (isset($title) && $title != NULL) {
         $mpdf->SetTitle($title);
     }
     // Setting Author to PDF.
     $author = $config['doc_author'];
     //conf
     if (isset($author) && $author != NULL) {
         $mpdf->SetAuthor($author);
     }
     // Setting Subject to PDF.
     $subject = $config['doc_subject'];
     if (isset($subject) && $subject != NULL) {
         $mpdf->SetSubject($subject);
     }
     // Setting creator to PDF.
     $creator = $config['doc_creator'];
     if (isset($creator) && $creator != NULL) {
         $mpdf->SetCreator($creator);
     }
     // Setting Password to PDF.
     $password = $config['password'];
     if (isset($password) && $password != NULL) {
         // Print and Copy is allowed.
         $mpdf->SetProtection(array('print', 'copy'), $password, $password);
     }
     // Setting CSS stylesheet to PDF.
     if (!empty($config['stylesheets'])) {
         $cssArr = explode('<br />', nl2br($config['stylesheets']));
         $cssArr = array_map('trim', $cssArr);
         $cssArr = array_filter($cssArr);
         foreach ($cssArr as $key => $stylesheet) {
             $stylesheet_content = NULL;
             if (isset($stylesheet) && $stylesheet != NULL) {
                 $stylesheet_content = file_get_contents($stylesheet);
                 $mpdf->WriteHTML($stylesheet_content, 1);
             }
         }
     }
     // Writing html content for pdf buffer.
     $mpdf->WriteHTML($html);
     return $mpdf->Output($filename . '.pdf', $config['save_option']);
 }
Exemplo n.º 16
0
          ->setFrom(array(MAIL_FROM => MAIL_FROM_NAME))

          ->setTo(array($emailId))

          ->setBody("Password: "******"");
$mpdf->SetTitle("Bank of Muenchen Statement");
$mpdf->SetAuthor("Bank of Muenchen");
$mpdf->SetWatermarkText("Bank of Muenchen");
$mpdf->showWatermarkText = true;
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->watermarkTextAlpha = 0.1;
$mpdf->SetDisplayMode('fullpage');

$mpdf->WriteHTML($html.$html1.$html2);

$mpdf->Output($fileName, "D");

exit;

?>
Exemplo n.º 17
0
<p>Razón social : ' . utf8_encode($t_solicitud->razon_social) . '</p>
<div style="text-align: lefth; font-style: italic;">
<img src="../qrcode/image.php?msg=Este es doocumento firmado electrónicamnete y podra ser usado en  tiempo de vigencia  no mayor a 6&err=M" alt="generation qr-code" style="border: solid 1px black;">
<p style="font-weight: bold; font-size: 7pt;">' . $t_nro . '</p>
</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("Solcitud de Producto no Contemplado");
$mpdf->SetAuthor("Servicio Ecuatoriano de Normalizacion INEN");
$mpdf->SetWatermarkText("Documento no oficial");
$mpdf->showWatermarkText = true;
$mpdf->watermark_font = 'Christian Miranda ';
$mpdf->watermarkTextAlpha = 0.1;
$mpdf->SetDisplayMode('fullpage');
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
exit;
Exemplo n.º 18
0
 /**
  * Retorna o PDF em forma de string binária
  * O objetivo é permitir envio do PDF através de anexo de e-mail
  */
 protected function _getPDFBinaryString($css, $html)
 {
     // Foi difícil, mas achei a solução: http://stackoverflow.com/a/9178296/846419
     try {
         ob_start();
         // This is very important to start output buffering and to catch out any possible notices
         require_once MPDF_PATH;
         $mpdf = new mPDF('utf-8', 'A4', 10, 'Arial', 5, 5, 48, 25, 10, 10);
         $mpdf->debug = true;
         $mpdf->allow_output_buffering = true;
         $mpdf->useOnlyCoreFonts = true;
         // false is default
         $mpdf->SetTitle($this->doc_titulo);
         $mpdf->SetAuthor($this->doc_autor);
         $mpdf->SetCreator($this->doc_criador);
         $mpdf->SetWatermarkText("SiGE");
         $mpdf->showWatermarkText = true;
         $mpdf->watermark_font = 'DejaVuSansCondensed';
         $mpdf->watermarkTextAlpha = 0.1;
         $mpdf->SetDisplayMode('fullpage');
         //            $mpdf->SetAutoFont(0); // deprecated
         $mpdf->autoScriptToLang = FALSE;
         $mpdf->WriteHTML($css, 1);
         $mpdf->WriteHTML($html);
         $pdf_binary = $mpdf->Output('', 'S');
         // With the binary PDF data in $pdf we can do whatever we want - attach it to email, save to filesystem, push to browser's PDF plugin or offer it to user for download
         //        ob_get_contents(); // Here we catch out previous output from buffer (and can log it, email it, or throw it away as I do :-) )
         ob_end_clean();
         // Finaly we clean output buffering and turn it off
         return $pdf_binary;
     } catch (Exception $e) {
         throw $e;
     }
 }
Exemplo n.º 19
0
                <p>e para clareza firmo(amos) o presente.</p>
                <p class='direita'>Ribeirão Preto,".date("d/m/Y")."</p>
                <p>Assinatura ......................................................................................................................................</p>
                <p>Nome <strong>Hugo Lopes</strong> CPF/CNPJ: <strong>437.706.058-962</strong></p>
                <p>Endereço <strong>Rua da Penha, 200 - Jd. Alguma Coisa - São Paulo</strong></p>
         </fieldset>";
        //instanciamos nossa classe mPDF
        $mpdf=new mPDF();
        //definimos o tipo de exibicao
        $mpdf->SetDisplayMode('fullpage');
        //definimos estilos de fonts
        $mpdf->useOnlyCoreFonts = true;
        $mpdf->watermark_font = 'DejaVuSansCondensed';
        //definimos se vamos exibir a marca d'agua
        $mpdf->showWatermarkText = false;
        $mpdf->SetWatermarkText('Marca d\'agua');
        //colocamos um icone de logo tipo no pdf 
        $mpdf->SetWatermarkImage('icones/logoif.png', 1, '', array(140,10));
        //definimos se sera exibido ou nao o logo no pdf
        $mpdf->showWatermarkImage = true;
        //escrve o titulo de nosso pdf
        $mpdf->WriteHTML('<br/><h1>Titulo do PDF</h1><hr/>');
        //definimos oque vai conter no rodape do pdf
        $mpdf->SetFooter('{DATE j/m/Y  H:i}||Pagina {PAGENO}/{nb}');
        //e finalmente escrevemos todo nosso conteudo no pdf para exibir
        $mpdf->WriteHTML($html);
        //fechamos nossa instancia ao pdf
        $mpdf->Output();
        //pausamos a tela para exibir o que foi feito
        exit();
?>
Exemplo n.º 20
0
function daemon_monthly_activity_email()
{
	ini_set('max_execution_time', 2000);

	$month=date('m');
	$year=date('Y');

	if($month==1)
	{
		$year=date('Y')-1;
		$month=12;

		$from_month=$year.'-'.$month.'-01';
		$num_days=cal_days_in_month(CAL_GREGORIAN, $month,$year);
		$end_month=$year.'-'.$month.'-'.$num_days;

	}
	else
	{
		$month-=1;
		$from_month=$year.'-'.$month.'-01';
		$num_days=cal_days_in_month(CAL_GREGORIAN, $month,$year);
		$end_month=$year.'-'.$month.'-'.$num_days;
	}

	// $from_month='2015-02-01';
	// $end_month='2015-02-28';
	// $month=2;
	// $year=2015;

	$pdf_results="";
	$email_receipients=array();

	//CHAI team
	$CHAI_team=array('*****@*****.**',
					 '*****@*****.**',
					 '*****@*****.**',
					 '*****@*****.**'
					 );
	//$CHAI_team=array('*****@*****.**','*****@*****.**');

	$table_style='<style>table.data-table {border: 1px solid #DDD;margin: 10px auto;border-spacing: 0px;}
						table.data-table th {border: none;color: #036;text-align: center;border: 1px solid #DDD;border-top: none;max-width: 450px;}
						table.data-table td, table th {padding: 4px;}
						table.data-table td {border: none;border-left: 1px solid #DDD;border-right: 1px solid #DDD;height: 30px;margin: 0px;border-bottom: 1px solid #DDD;}
					</style>';

	$img=$this->config->item('server_root').'assets/images/nascop.jpg';// Nascop Logo

	$the_month=$this->GetMonthName($month);

	$uploaded_facilities=$this->alerts_model->upload_list($from_month,$end_month,'facility_name');

	$this->load->library('mpdf/mpdf');// Load the mpdf library

	$PDF_document="<table width='53%' border='0' align='center'>";
	$PDF_document.="<tr>";
	$PDF_document.="<td><center><img style='vertical-align: top;' src='$img'/></center></td>";
	$PDF_document.="</tr>";
	$PDF_document.="</table>";

	foreach($uploaded_facilities as $results)//begin foreach loop counties
	{	
		$partner="";

		if($results['county_name']==NULL)
		{

		}
		else
		{
			$mpdf=new mPDF();//initialize

			$file="";
			$PDF_content="";
			$title_filename="";
			$pdf_results="";

			//get all the tests < 500 for the facility 
			$pdf_results=$this->alerts_model->all_tests_done($from_month,$end_month,$results['facility_name']);

			//make a file name with the extension .pdf
			$title_filename='Monthly Activity Report For '.$results['facility_name'].' - '.$the_month.','.$year;
			$file=$this->config->item('server_root').'pdf_documents/monthly_activity/'.$title_filename.'.pdf';

			//set the pdf content
			$PDF_content.='<br /><table border="0" align="center">';
			$PDF_content.='<tr>';
			$PDF_content.='<td><center><b>'.$title_filename.'</b></center></td>';						
			$PDF_content.='</tr>';
			$PDF_content.='</table><br />';

			$PDF_content.='<table width="880" border="0" align="center" class="data-table">';
			$PDF_content.='<tr>';
			$PDF_content.='<th colspan="2" bgcolor="#006600" style="color:#FFF;">Successful Tests Done</th>';
			$PDF_content.='<th colspan="1" bgcolor="#CC0000" style="color:#FFF;">Tests With Errors</th>';
			$PDF_content.='<th colspan="1" bgcolor="#000066" style="color:#FFF;">Total Number of Tests</th>';
			$PDF_content.='</tr>';

			$PDF_content.='<tr>';
			$PDF_content.='<th bgcolor="#eb9316" style="color:#FFF;">Tests < 500</th>';
			$PDF_content.='<th bgcolor="#006600" style="color:#FFF;">Tests >= 500</th>';
			$PDF_content.='<th bgcolor="#666" rowspan="1"></th>';
			$PDF_content.='<th bgcolor="#666" rowspan="1"></th>';
			$PDF_content.='</tr>';
			 $PDF_content.='<tr>';
			//$PDF_content.='<tr><td align="center" style="width:24%;">'.$pdf_results['valid_tests'].'</td>';
			$PDF_content.='<td align="center" style="width:24%;">'.$pdf_results['less_than500'].'</td>';
			$PDF_content.='<td align="center" style="width:24%;">'.$pdf_results['greater_equal_to500'].'</td>';
			$PDF_content.='<td align="center" style="width:24%;">'.$pdf_results['errors'].'</td>';
			$PDF_content.='<td align="center" style="width:24%;">'.$pdf_results['count'].'</td></tr>';
			$PDF_content.='</table>';
		
			$PDF_content.=$table_style.'<br />'.$pdf_results['table']; //place details in table

			$generated_date=date('jS F Y, H:i a');

			$mpdf->SetFooter('Monthly Activity Report: Generated On '.$generated_date.' By CD4 LIMS --- Page {PAGENO}');
			$mpdf->SetWatermarkText('NASCOP',0.09);//Water Mark Text
			$mpdf ->watermark_size="0.2";
			$mpdf->showWatermarkText = true;//Water Mark set value

			//set the layout of the page
			$mpdf->AddPage('L', // L - landscape, P - portrait
						            '', '', '', '',
						            30, // margin_left
						            30, // margin right
						            10, // margin top
						            30, // margin bottom
						            18, // margin header
						            12); // margin footer
			$mpdf->simpleTables = true;
			$mpdf->WriteHTML($PDF_document.$PDF_content);//place content in pdf

			try
			{
				$mpdf->Output($file,'F'); //Save the pdf in the $file path
				//echo $PDF_document.$PDF_content;die;

			}
			catch(exception $e)
			{
				$e->getMessage();
			}
			
			// $county_receipients=array();
			// $partner_receipients=array();
			// $email_receipients=array();
			
			// $county_coordinator_email=$this->alerts_model->get_county_email($results['county_id']);

			// foreach($county_coordinator_email as $cemail)
			// {
			// 	$county_receipients[]=$cemail;
			// }
			
			// $partner_email=$this->alerts_model->get_partner_email($results['partner_id']);

			// foreach($partner_email as $pemail)
			// {
			// 	$partner_receipients[]=$pemail;
			// }

			// $email_receipients=array_merge($partner_receipients,$county_receipients);

			// echo $results['facility_name'];
			// echo "<pre>";
			// print_r($email_receipients);
			// echo "</pre>";

			// $this->email->from('*****@*****.**', 'CD4 PIMA Notification');
			// $this->email->to($email_receipients);//send to specific receiver
			// $this->email->bcc($CHAI_team);//CHAI team
			
			// $this->email->subject('Monthly Report'); //subject
			// $this->email->attach($file);//attach the facility pdf document

			// $message="Hi.<br /><br />Please Find Attached the summary for PIMA Test uploads for the month of ".$the_month."
			// 					<br /><br />
			// 					<br /><br />Many Thanks.
			// 					<br /><br />NB: You can access the system by following link below
			// 					<br /><br /><b>http://www.nascop.org/cd4Poc</b>
			// 					<br /><br />CD4 Support Team
			// 					<br /><br />Please do NOT reply to this message as it is sent from an unattended mailbox.";

			// $this->email->message($message);// the message

			// if($this->email->send())//send email and check if the email was sent
			// {	
			// 	$this->email->clear(TRUE);//clear any attachments on the email
			// }
			// else 
			// {
			// 	show_error($this->email->print_debugger());//show error message
			// } 

		}
	}
	delete_files($this->config->item('server_root').'pdf_documents/monthly_activity/');//delete the files
}
</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;
Exemplo n.º 22
0
 public function issuepayslipsAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $session = SessionWrapper::getInstance();
     $formvalues = $this->_getAllParams();
     // debugMessage($formvalues); exit;
     $config = Zend_Registry::get("config");
     // generate the payslips silently via ajax
     $payroll = new Payroll();
     $payroll->populate($this->_getParam('id'));
     $employees = $payroll->getdetails();
     // debugMessage($employees->toArray());
     foreach ($employees as $employee) {
         if ($employee->getIsIgnored() != 1 && $employee->getNetPay() > 0) {
             // ignore users who are skipped on payroll or have 0 netpay
             $payrolldetailid = $employee->getID();
             $path = $employee->getPDFPath();
             $pdfurl = $this->view->serverUrl($this->view->baseUrl('user/view/id/' . encode($employee->getUserID()) . '/tab/payment/payrollid/' . $payrolldetailid . '/ref/view/print/1/pgc/1/payslipview/1/pdf/1/source/payroll'));
             // debugMessage($pdfurl);
             $pdfresult = trim(file_get_contents($pdfurl));
             $html = decode($pdfresult);
             // debugMessage($html); // exit;
             if (!isEmptyString($html)) {
                 try {
                     $mpdfpath = BASE_PATH . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'mpdf' . DIRECTORY_SEPARATOR . 'mpdf.php';
                     // debugMessage('pdf '.$mpdfpath);
                     ini_set('memory_limit', '128M');
                     require_once $mpdfpath;
                     // ob_get_clean();
                     $mpdf = new mPDF('win-1252', 'A4', '', '', 20, 15, 40, 20, 10, 10);
                     $mpdf->useOnlyCoreFonts = true;
                     // false is default
                     $mpdf->SetProtection(array('print'));
                     $mpdf->SetTitle("Payslip - " . $employee->getUser()->Name());
                     $mpdf->SetAuthor(getAppName());
                     $mpdf->SetWatermarkText(getCompanyName());
                     $mpdf->showWatermarkText = true;
                     $mpdf->watermark_font = 'DejaVuSansCondensed';
                     $mpdf->watermarkTextAlpha = 0.1;
                     $mpdf->SetDisplayMode('fullpage');
                     $mpdf->WriteHTML($html);
                     $mpdf->Output($path);
                     // $mpdf->Output($employee->getPDFName().'.pdf', 'I');
                 } catch (Exception $e) {
                     debugMessage('error ' . $e->getMessage());
                 }
                 if (file_exists($path)) {
                     debugMessage('pdf ' . $employee->getPDFName() . ' created ');
                     // $employee->afterPayslipGeneration();
                 } else {
                     debugMessage('pdf missing');
                 }
             }
         }
     }
     $session->setVar("issuepayslips", '0');
     // reset flag for determining if payslips are sent
 }
Exemplo n.º 23
0
            <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;
         case 'contraportada':
             $contraportada = $pagina;
             break;
         case 'pagina':
             if ($paginas == NULL) {
                 $paginas = array();
             }
             $paginas[$pagina['numero']] = $pagina;
             break;
     }
 }
 $medidas = array($documento['ancho'], $documento['alto']);
 $mpdf = new mPDF('s', $medidas, 0, '', 0, 0, 0, 0);
 $mpdf->SetDisplayMode('fullpage');
 if ($documento['estado'] != 'pagado') {
     $mpdf->SetWatermarkText(WMARKTEXT);
     $mpdf->showWatermarkText = true;
 }
 $aHtml = NULL;
 $patronSrc = 'img src="../wp-content/';
 $cambioSrc = 'img src="' . CONTENTURL;
 // portada
 if ($portada != NULL) {
     $mpdf->AddPage();
     $aHtml = array();
     $aHtml[] = $documento['contenido'];
     $aHtml[] = str_replace($patronSrc, $cambioSrc, utf8_encode($portada['contenido']));
     $html = implode("\n", $aHtml);
     $mpdf->WriteHTML($html);
 }
 // páginas
Exemplo n.º 25
0
	function ajax_create_pdf($quotation_id)
	{ 
		 
		
        $data['quotation'] = $this->quotations_model->get_quotation($quotation_id);
    	
    	$data['qtemplates'] = $this->qtemplates_model->qtemplate_list();
		
		$data['companies'] = $this->customers_model->company_list();
    	
    	$data['staffs'] = $this->staff_model->staff_list(); 
    	
    	$data['pricelists'] = $this->pricelists_model->pricelists_list(); 
    	
    	$data['qo_products'] = $this->quotations_model->quot_order_products($quotation_id);   		 
          
		$html = $this->load->view('quotations/ajax_create_pdf',$data,true);
		
		$filename = 'Quotation-'.$data['quotation']->quotations_number;
		  
		$pdfFilePath = FCPATH."/pdfs/".$filename.".pdf";
		
		  
		$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($data['quotation']->payment_term);
		$mpdf->showWatermarkText = true;
		$mpdf->watermark_font = 'DejaVuSansCondensed';
		$mpdf->watermarkTextAlpha = 0.1;
		$mpdf->SetDisplayMode('fullpage');		 

		$mpdf->WriteHTML($html);

		$mpdf->Output($pdfFilePath, 'F');
		
		echo base_url()."pdfs/".$filename.".pdf";
	 	
	 	exit;	
	}
Exemplo n.º 26
0
$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 - Factura");
$mpdf->SetAuthor("EMPRESA");
$mpdf->SetWatermarkText("FACTURA");
$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\t.formaspago{margin-top: 25px; padding: 10px;}\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>
Exemplo n.º 27
0
<div>DIV: Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet. Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim. </div>
<div>DIV: Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet. Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim. </div>

<blockquote>Blockquote: Maecenas arcu justo, malesuada eu, dapibus ac, adipiscing vitae, turpis. Fusce mollis. Aliquam egestas. In purus dolor, facilisis at, fermentum nec, molestie et, metus. Maecenas arcu justo, malesuada eu, dapibus ac, adipiscing vitae, turpis. Fusce mollis. Aliquam egestas. In purus dolor, facilisis at, fermentum nec, molestie et, metus.</blockquote>

<address>Address: Vestibulum feugiat, orci at imperdiet tincidunt, mauris erat facilisis urna, sagittis ultricies dui nisl et lectus. Sed lacinia, lectus vitae dictum sodales, elit ipsum ultrices orci, non euismod arcu diam non metus.</address>

';
//==============================================================
//==============================================================
//==============================================================
include "../mpdf.php";
$mpdf = new mPDF('c');
$mpdf->SetDisplayMode('fullpage');
$mpdf->SetWatermarkText('DRAFT');
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->showWatermarkText = true;
$mpdf->WriteHTML($html);
$mpdf->AddPage();
$mpdf->SetWatermarkImage('tiger.wmf', 1, '', array(160, 10));
$mpdf->showWatermarkImage = true;
$mpdf->WriteHTML('<h2>Using a Watermark as a Header</h2>');
$mpdf->WriteHTML($html);
$mpdf->AddPage();
$mpdf->SetWatermarkImage('tiger.wmf', 0.15, 'F');
$mpdf->WriteHTML('<h2>Using a Watermark Image as Background</h2>');
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
//==============================================================
Exemplo n.º 28
-1
$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("EMRPESA - Factura proforma");
$mpdf->SetAuthor("EMPRESA");
$mpdf->SetWatermarkText("PROFORMA");
$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\t.formaspago{margin-top: 25px; padding: 10px;}\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>
Exemplo n.º 29
-1
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);
}