本文整理汇总了PHP中HTML2PDF::WriteHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML2PDF::WriteHTML方法的具体用法?PHP HTML2PDF::WriteHTML怎么用?PHP HTML2PDF::WriteHTML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML2PDF
的用法示例。
在下文中一共展示了HTML2PDF::WriteHTML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: 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');
}
示例3: 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();
}
示例4: 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);
}
示例5: 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');
}
示例6: 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
}
示例7: cetak_formulir_pendaftaran_KKM_2016
public function cetak_formulir_pendaftaran_KKM_2016()
{
ob_start();
$bc['nim'] = $this->session->userdata('nim');
$data['data'] = $this->Daftar_kkm_model->get_by_nim($bc['nim']);
$this->load->view('mahasiswa/print', $data);
$html = ob_get_contents();
ob_end_clean();
require_once './assets/html2pdf/html2pdf.class.php';
$pdf = new HTML2PDF('P', 'F4', 'en');
$pdf->WriteHTML($html);
$pdf->Output('Pendaftaran KKM 2016.pdf', 'fr');
}
示例8: 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');
}
}
示例9: 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');
}
示例10: 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);
}
示例11: convertHtmlToFormat
public function convertHtmlToFormat($orientation = 'P')
{
require_once 'html2pdf/html2pdf.class.php';
$html2pdf = new HTML2PDF($orientation, 'A4', 'fr');
$html2pdf->setDefaultFont('times');
$html2pdf->WriteHTML($this->docTemplate->render());
$this->doc = $html2pdf->Output(NULL, 'S');
}
示例12: html2pdf
/**
* @throws HTML2PDF_exception
*/
public function html2pdf()
{
$content = "\n\t\t<page>\n\t\t <h1>Exemple d'utilisation</h1>\n\t\t <br>\n\t\t Ceci est un <b>exemple d'utilisation</b>\n\t\t de <a href='http://html2pdf.fr/'>HTML2PDF</a>.<br>\n\t\t</page>";
//require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'A4', 'fr');
$html2pdf->WriteHTML(file_get_contents($this->load->view('htmlpdf')));
$html2pdf->Output('exemple.pdf');
}
示例13: setOrderPdf
/**
* Recieve the html and generate the pdf
* @param string $html
*/
function setOrderPdf($html, $fileName)
{
ob_end_clean();
$html2pdf = new HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(mL, mT, mR, mB));
//$html2pdf->addFont("times");
$html2pdf->WriteHTML($html);
$html2pdf->Output($fileName . '.pdf');
die;
}
示例14: printInvoice
public function printInvoice($id)
{
$data = $this->payment_model->get($id);
if (!$data) {
echo "Not data";
die;
} else {
//echo $id;
$this->template = new View('admin_invoice/invoice', true);
$this->template->set(array('test' => $this->test_model->get($data['test_uid']), 'member' => $this->member_model->get($data['member_uid']), 'mr' => $data));
require Kohana::find_file('vendor/html2pdf', 'html2pdf');
$html2pdf = new HTML2PDF();
//$html2pdf->HTML2PDF('L','A4', 'en', array(10, 10, 10, 10));
$html2pdf->HTML2PDF('P', 'letter', 'en', array(10, 10, 10, 10));
$html2pdf->WriteHTML($this->template, false);
echo $html2pdf->Output('Sales_Order_' . $data['uid'] . '.pdf');
}
}
示例15: viewAction
public function viewAction()
{
$order_id = (int) $this->getRequest()->getParam('order_id');
if (!$order_id || !($order = Mage::getModel('sales/order')->load($order_id))) {
$this->_forward('noRoute');
return false;
}
$standard = Mage::getModel('boleto_ultimate/standard');
if ($standard->isAvailablePrint($order->getStatus())) {
try {
Mage::register('current_order', $order);
$dadosboleto = $standard->prepareValues($order);
foreach ($dadosboleto as $key => $value) {
$dadosboleto[$key] = utf8_decode($value);
}
$additional_data = unserialize($order->getPayment()->getAdditionalData());
$code_banco = $additional_data['code_banco'];
$path = BP . DS . 'lib' . DS . 'boleto_ultimate' . DS . 'layouts' . DS;
ob_start();
require_once $path . 'funcoes_' . $code_banco . '.php';
require_once $path . 'layout_' . $code_banco . '.php';
$content = ob_get_clean();
ob_end_clean();
$html2pdf = new HTML2PDF('P', 'A4', 'pt', false, 'ISO-8859-1', array(15, 5, 5, 8));
$html2pdf->pdf->setFont('arial');
$html2pdf->WriteHTML($content);
$html2pdf->Output(time() . '.pdf');
exit;
} catch (Exception $e) {
Mage::log($order->getIncrementId() . ' => ' . $e->getMessage(), null, 'boleto_ultimate_view.log', true);
$this->_forward('noRoute');
return false;
}
}
$this->_forward('noRoute');
return false;
}