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


PHP HTML2PDF类代码示例

本文整理汇总了PHP中HTML2PDF的典型用法代码示例。如果您正苦于以下问题:PHP HTML2PDF类的具体用法?PHP HTML2PDF怎么用?PHP HTML2PDF使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Footer

 public function Footer()
 {
     $txt = '';
     if ($this->footer_param['form']) {
         $txt = HTML2PDF::textGET('pdf05');
     }
     if ($this->footer_param['date'] && $this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf03');
     }
     if ($this->footer_param['date'] && !$this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf01');
     }
     if (!$this->footer_param['date'] && $this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf02');
     }
     if ($this->footer_param['page']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf04');
     }
     if (strlen($txt) > 0) {
         $txt = str_replace('[[date_d]]', date('d'), $txt);
         $txt = str_replace('[[date_m]]', date('m'), $txt);
         $txt = str_replace('[[date_y]]', date('Y'), $txt);
         $txt = str_replace('[[date_h]]', date('H'), $txt);
         $txt = str_replace('[[date_i]]', date('i'), $txt);
         $txt = str_replace('[[date_s]]', date('s'), $txt);
         $txt = str_replace('[[current]]', $this->PageNo(), $txt);
         $txt = str_replace('[[nb]]', '{nb}', $txt);
         parent::SetY(-11);
         $this->setOverline(false);
         $this->SetFont('helvetica', 'I', 8);
         $this->Cell(0, 10, $txt, 0, 0, 'R');
     }
 }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:33,代码来源:mypdf.class.php

示例2: imprimirOrdenCompra

		public function imprimirOrdenCompra($detalle, $anexos, $system, $id_orden){
			require_once(APP_PATH . 'common/plugins/sigma/demos/export_php/html2pdf/html2pdf.class.php');
			template()->buildFromTemplates('report/orden_compra.html');
			page()->setTitle('Orden de compra');
			page()->addEstigma("detalle", array('SQL', $detalle));
        	page()->addEstigma("anexos", array('SQL', $anexos));
        	page()->addEstigma("norden", $id_orden);
        	page()->addEstigma("nombre_empresa", $system->nombre_comercial);
        	page()->addEstigma("direccion_empresa", $system->direccion);
			@template()->parseOutput();
        	@template()->parseExtras();
        	$html2pdf = new HTML2PDF('L', 'lette', 'es');
        	$html2pdf->WriteHTML(page()->getContent());
        	$html2pdf->Output('ticket.pdf');
		}
开发者ID:suavid,项目名称:terceros,代码行数:15,代码来源:report.php

示例3: getIndex

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getIndex($order_id)
 {
     $id = $order_id;
     $invoicedata = Invoice::where('Id', $id)->get();
     $html22 = View('viewinvoice')->with(array('invoicedata' => $invoicedata))->render();
     require_once app_path() . '/libs/html2pdf/html2pdf.class.php';
     $html2pdf = new \HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(0, 0, 0, 0));
     // $html2pdf->pdf->SetDisplayMode('fullpage');
     $html2pdf->WriteHTML($html22);
     $html2pdf->Output('Invoice.pdf');
 }
开发者ID:vikramIde,项目名称:iclock.in,代码行数:16,代码来源:ViewinvoiceController.php

示例4: cetak

 public function cetak()
 {
     $npm = $this->session->userdata('npm');
     ob_start();
     $data['nilai'] = $this->Model_nilai->getNilai($npm);
     $this->load->view('member/nilai/print', $data);
     $html = ob_get_contents();
     ob_get_clean();
     require_once './assets/html2pdf/html2pdf.class.php';
     $pdf = new HTML2PDF('P', 'A4', 'en');
     $pdf->WriteHTML($html);
     $pdf->Output('Data Nilai.pdf', 'R');
 }
开发者ID:Asepdadan,项目名称:e-learning,代码行数:13,代码来源:M_nilai.php

示例5: actionPendidikans

 public function actionPendidikans()
 {
     $html2pdf = Yii::app()->ePdf->html2pdf('L', 'A4', 'en', false, 'ISO-8859-15', array(10, 5, 10, 5));
     $html2pdf->pdf->SetDisplayMode('fullpage');
     $dosen = Yii::app()->request->getParam('id_dosen', 0);
     $pj = Yii::app()->request->getParam('pengajuan', 0);
     $sql = "select unsur_pendidikan.ID_UNSUR_PEND,subun_pend.SUBUNPEND,tbl_dosen.NAMA_DOSEN, tbl_dosen.NIP_DOSEN, \n                  tbl_jabatan.NAMA_JABATAN, tbl_golongan.GOLONGAN, tbl_golongan.PANGKAT, tbl_jurusan.NAMA_JURUSAN, \n                  tbl_jurusan.NAMA_PIMPINAN, tbl_jurusan.NIP_PIMPINAN, tbl_jurusan.PANGKAT AS PJ, tbl_jurusan.GOLONGAN AS GJ, tbl_fakultas.NAMA_FAKULTAS, \n                  unsur_pendidikan.KEGIATAN_PENDIDIKAN, unsur_pendidikan.TEMPAT_PENDIDIKAN, \n                  unsur_pendidikan.TGL_KEGIATAN_PEND, unsur_pendidikan.NILAI_PENDIDIKAN, \n                  unsur_pendidikan.BUKTI_PENDIDIKAN, unsur_pendidikan.PENGAJUAN_KE \n                  from unsur_pendidikan inner join subun_pend on \n                  unsur_pendidikan.ID_SUBUNPEND=subun_pend.ID_SUBUNPEND join tbl_dosen \n                  on unsur_pendidikan.ID_DOSEN=tbl_dosen.ID_DOSEN join tbl_jabatan on \n                  tbl_dosen.ID_JABATAN=tbl_jabatan.ID_JABATAN join tbl_golongan on \n                  tbl_dosen.ID_GOLONGAN=tbl_golongan.ID_GOLONGAN join tbl_jurusan on \n                  tbl_dosen.ID_JURUSAN=tbl_jurusan.ID_JURUSAN join tbl_fakultas on \n                  tbl_jurusan.ID_FAKULTAS=tbl_fakultas.ID_FAKULTAS where \n                  unsur_pendidikan.ID_DOSEN='{$dosen}' and unsur_pendidikan.PENGAJUAN_KE='{$pj}' ";
     $data = Yii::app()->db->createCommand($sql)->queryAll();
     $content = $this->renderPartial('pendidikans', array('data' => $data), true);
     $html2pdf = new HTML2PDF('L', 'A4', 'en', array(10, 5, 10, 5));
     $html2pdf->WriteHTML($content);
     $html2pdf->Output();
 }
开发者ID:bagus029,项目名称:sipakfeb,代码行数:13,代码来源:CetakController.php

示例6: save

 public function save($file)
 {
     $pdfs = array();
     foreach ($this->_html as $i => $page) {
         $f = '/tmp/' . Athem_Utils::randString(10);
         $pdf = new HTML2PDF($this->_getOrientation(), $this->_getSize(), 'en');
         $pdf->WriteHTML($page);
         $pdf->Output("{$f}.pdf", 'F');
         $pdfs[] = "{$f}.pdf";
     }
     $pdfMerge = Athem_Pdf_Merge_Abstract::factory($this->_page['merge'], $pdfs);
     $pdfMerge->save($file);
 }
开发者ID:athemcms,项目名称:netis,代码行数:13,代码来源:Html2pdf.php

示例7: generarPDF

 public function generarPDF()
 {
     $sql = "SELECT codigo,nombre,apellido,cedula,edad,semestre from estudiante";
     $resultado = $this->objCon->Ejecutar($sql);
     if ($resultado && pg_numrows($resultado) > 0) {
         require_once '../Recursos/html2pdf/html2pdf.class.php';
         // Se carga la libreria
         ob_start();
         //Habilita el buffer para la salida de datos
         ob_get_clean();
         //Limpia lo que actualmente tenga el buffer
         //En la variable content entre las etiquetas <page></page> va todo el contenido del pdf en formato html
         $content = "<page>";
         $content .= "<h1>ESTE ES EL REPORTE</h1>";
         $content .= '<link href="../Recursos/css/estilosPDF.css" type="text/css" rel="stylesheet">';
         $content .= "<table border='1'>";
         $content .= "<tr>";
         $content .= "<th>Codigo</th>";
         $content .= "<th>Nombre</th>";
         $content .= "<th>Apellido</th>";
         $content .= "<th>Cedula</th>";
         $content .= "<th>Edad</th>";
         $content .= "<th>Semestre</th>";
         $content .= "</tr>";
         for ($cont = 0; $cont < pg_numrows($resultado); $cont++) {
             $content .= "<tr>";
             $content .= "<td>" . pg_result($resultado, $cont, 0) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 1) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 2) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 3) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 4) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 5) . "</td>";
             $content .= "</tr>";
         }
         $content .= "</table>";
         $content .= "</page>";
     } else {
         $content = "<b>No hay registros en la base de datos</b>";
     }
     $html2pdf = new HTML2PDF('P', 'A4', 'es');
     //formato del pdf (posicion (P=vertical L=horizontal), tamaño del pdf, lenguaje)
     $html2pdf->WriteHTML($content);
     //Lo que tenga content lo pasa a pdf
     ob_end_clean();
     // se limpia nuevamente el buffer
     $html2pdf->Output('exemple.pdf');
     //se genera el pdf, generando por defecto el nombre indicado para guardar
 }
开发者ID:johnny9052,项目名称:EjemploJQUERYMobileCRUD,代码行数:48,代码来源:estudianteDAO.php

示例8: laporan_pdf

 function laporan_pdf($kode)
 {
     $data['kd_mahasiswa'] = $kode;
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('L', 'Letter', 'fr');
     $html2pdf->setDefaultFont('Arial');
     //filter
     #get filter
     /* $fil['kd_fakultas'] = $kd_fakultas;
     		$fil['kd_prodi'] = $kd_prodi;
     		$fil['tahun'] = $tahun;
     		$fil['nim'] = $nim; */
     //$data['nama'] = 'indriyanto';
     $data['namaUniv'] = 'UNIVERSITAS SUBANG';
     $data['alamatUniv'] = 'Jln. Perkutut Kotaraja, Telp.(0967)581562';
     $data['kotaUniv'] = 'Subang, Jawa Barat';
     // ambil data dari tabel
     $data['data_pdf'] = $this->mdl_ijazah->get_pdf($kode);
     /* if (count($da['row'])==0){
     			echo "Data Tidak Tersedia";
     			return;
     		} */
     $konten = $this->load->view('ta/ijazah_format', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output('exemple00.pdf');
 }
开发者ID:bosokpp1,项目名称:p-siakad,代码行数:26,代码来源:ijazah.php

示例9: voucher

 public function voucher($numFile = false)
 {
     if (!$numFile) {
         $this->redireccionar('booking');
     }
     //Session::acceso('Usuario');
     $numFile = base64_decode($numFile);
     $numFile = $numFile * 1;
     $ruta_img = 'views/layout/' . DEFAULT_LAYOUT . '/img/';
     $ruta_img2 = 'public/img/voucher/';
     ob_start();
     require_once ROOT . 'views' . DS . 'system' . DS . 'pdf' . DS . 'vouchea.php';
     $content = ob_get_clean();
     $this->getLibrary('html2pdf.class');
     try {
         $html2pdf = new HTML2PDF('P', 'A4', 'es', false, CHARSET);
         //$html2pdf->setModeDebug();
         $html2pdf->setDefaultFont('Arial');
         $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
         $html2pdf->Output('Voucher_N_' . $numFile . '.pdf');
     } catch (HTML2PDF_exception $e) {
         echo $e;
         exit;
     }
 }
开发者ID:JonathanEstay,项目名称:panamericanaturismo.cl,代码行数:25,代码来源:bookingController.php

示例10: rappel

function rappel($buffer)
{
    $date = date('Ymd-hi');
    $html2pdf = new HTML2PDF('P', 'LETTER', 'fr');
    $html2pdf->writeHTML($buffer);
    $html2pdf->Output($date . '_valeur_inventaire.pdf', 'D');
}
开发者ID:Razinsky,项目名称:echaude-com,代码行数:7,代码来源:print_inventaire_valeur.php

示例11: html2pdf

function html2pdf($html, $nombre = "archivo.pdf", $orientacion = "P", $tamanio = "A4", $tituloDocumento = '')
{
    $colegioSessionBean = new ColegioSessionBean();
    $fechaActual = obtenerFechaActualFull();
    $html = str_replace("\\", "", $html);
    ob_start();
    //include(dirname(__FILE__).'/res/exemple07a.php');
    //include(dirname(__FILE__).'/res/exemple07b.php');
    echo '<link rel="stylesheet" href="' . PATH_HTTP . 'css/tablas.css" type="text/css" />';
    //$html = ereg_replace("\\", "XD", $html);
    echo '<table>
    	<tr>
    		<td align="center" width="1200"><strong>' . $colegioSessionBean->getNombre() . '</strong> <br/>' . $tituloDocumento . '</td>
    		<td rowspan="2"><img alt="logo" title="logo" src="' . PATH_HTTP . 'images/' . $colegioSessionBean->getColegio_ID() . '/logo.jpg"></td>
    	</tr>
    	</table>
    	<div style="width:1200px; align=right;font-size:8px;">Informe generado el ' . $fechaActual . '</div><br/>';
    echo $html;
    $content = ob_get_clean();
    // conversion HTML => PDF
    //require_once(dirname(__FILE__).'/../html2pdf.class.php');
    $html2pdf = new HTML2PDF($orientacion, $tamanio, 'es');
    $html2pdf->pdf->SetDisplayMode('fullpage');
    //$html2pdf->pdf->
    //	$html2pdf->pdf->SetProtection(array('print'), 'spipu');
    $html2pdf->WriteHTML($content, isset($_GET['vuehtml']));
    //echo $content;
    $html2pdf->Output($nombre);
}
开发者ID:ranmadxs,项目名称:dorcl,代码行数:29,代码来源:html2pdf.php

示例12: HTML2PDF

 protected static function HTML2PDF($html, $fileout)
 {
     self::loadLib('/html2pdf/html2pdf.class.php');
     $html2pdf = new HTML2PDF('P', 'A4', 'en');
     $html2pdf->WriteHTML($html);
     return $html2pdf->Output($fileout, 'F');
 }
开发者ID:bruno-melo,项目名称:components,代码行数:7,代码来源:PDF.php

示例13: smarty_function_article_pdf

/**
 * Newscoop article_pdf function plugin
 *
 * Type:     function
 * Name:     article_pdf
 * Purpose:
 *
 * @param array
 *     $params[template]
 *     $params[prefix]
 * @param object
 *     $smarty The Smarty object
 */
function smarty_function_article_pdf($params, &$smarty)
{
    // gets the context variable
    $gimme = $smarty->getTemplateVars('gimme');
    if (isset($params['template'])) {
        $template = $params['template'];
    }
    $pdf_filename = '';
    if (isset($params['prefix'])) {
        $pdf_filename = $params['prefix'] . '-';
    }
    $publish = new DateTime($gimme->article->publish_date);
    $pdf_filename .= 'p' . $publish->format('Ymd') . '-n' . $gimme->article->number . '.pdf';
    $pdf_file = 'public/pdf/' . $pdf_filename;
    if (!file_exists($pdf_file) || $gimme->article->last_update > date('Y-m-d h:i:s', filemtime($pdf_file))) {
        require 'include/html2pdf/html2pdf.class.php';
        try {
            $content = $smarty->fetch($template);
            $html2pdf = new HTML2PDF('P', 'A4', 'de');
            $html2pdf->pdf->SetDisplayMode('real');
            $html2pdf->writeHTML($content);
            $html2pdf->Output($pdf_file, 'F');
        } catch (HTML2PDF_exception $e) {
            return '';
        }
    }
    return $pdf_file;
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:41,代码来源:function.article_pdf.php

示例14: postApproveinvoice

 public function postApproveinvoice(Request $request)
 {
     $approve_id = Input::get('invoice_approve_id');
     $post = Input::get();
     $i = Invoice::where('Id', $approve_id)->update(array('Status' => $post['approve_status']));
     $invoicedata = Invoice::where('Id', $approve_id)->get();
     foreach ($invoicedata as $inv) {
         $email = $inv->ClientEmail;
         $invno = $inv->InvoiceCode;
         $clientmail = $inv->ClientName;
     }
     if ($i > 0) {
         $html22 = View('pdfgenerate')->with(array('invoicedata' => $invoicedata))->render();
         $html1 = "<h1>adsfadsfasdf</h1>";
         require_once app_path() . '/libs/html2pdf/html2pdf.class.php';
         $html2pdf = new \HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(0, 0, 0, 0));
         // $html2pdf->pdf->SetDisplayMode('fullpage');
         $html2pdf->WriteHTML($html22);
         $htmltosend = $html2pdf->Output('', 'S');
         $a = 'IDE | Proforma invoice_';
         $subject = $a . $invno . $clientmail;
         Mail::send('emails.invoice', ['Invoice' => 'hgff'], function ($message) use($subject, $htmltosend, $email) {
             // note: if you don't set this, it will use the defaults from config/mail.php
             $message->from('invoice@ide-global.com', 'IDE Consulting Services Pvt Ltd');
             $message->to($email)->subject($subject)->attachData($htmltosend, 'invoice.pdf', array('mime' => 'application/pdf', 'Content-Disposition' => 'attachment'));
         });
         $request->session()->flash('alert-success', 'Invoice has been set to client !');
         return redirect('home2');
     }
 }
开发者ID:vikramIde,项目名称:iclock.in,代码行数:30,代码来源:ViewController.php

示例15: laporan_pdf

 function laporan_pdf($kd_fakultas, $kd_prodi, $tahun, $nim)
 {
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('P', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     //filter
     #get filter
     $fil['kd_fakultas'] = $kd_fakultas;
     $fil['kd_prodi'] = $kd_prodi;
     $fil['tahun'] = $tahun;
     $fil['nim'] = $nim;
     //$data['nama'] = '';
     $data['namaUniv'] = 'STMIK BANDUNG';
     $data['alamatUniv'] = 'Jl.Phh.Mustofa No. 39. Grand Surapati Core (SUCORE) Blok M No.19, Telp.022 - 7207777';
     $data['kotaUniv'] = 'Bandung, Jawa Barat';
     // ambil data dari tabel
     $data['data_pdf'] = $this->mdl_khs->get_pdf($fil, $nama_dosen);
     /* if (count($da['row'])==0){
     			echo "Data Tidak Tersedia";
     			return;
     		} */
     $konten = $this->load->view('perkuliahan/khs_laporan', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output('khs.pdf');
 }
开发者ID:bosokpp1,项目名称:p-siakad,代码行数:25,代码来源:khs.php


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