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


PHP HTML2PDF::setDefaultFont方法代码示例

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


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

示例1: date

 function laporan_pdf($id_po)
 {
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('P', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     $data['data_pdf'] = $this->mdl_purchase_order->report($id_po);
     $konten = $this->load->view('purchase_order/po_report', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output("po_" . date('d-m-y') . "_" . $id_po . ".pdf");
 }
开发者ID:bosokpp1,项目名称:purlog,代码行数:10,代码来源:purchase_order.php

示例2: date

 function laporan_pdf($id_transfer)
 {
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('L', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     //filter
     //get filter
     //$fil['kd_prodi'] = $kd_prodi;
     //$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_transfer->get_pdf($id_transfer);
     /* if (count($da['row'])==0){
        echo "Data Tidak Tersedia";
        return;
        } */
     $konten = $this->load->view('transfer/transfer_laporan', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output("transfer_" . date('d-m-y') . "_" . $id_transfer . ".pdf");
 }
开发者ID:bosokpp1,项目名称:purlog,代码行数:22,代码来源:transfer.php

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

示例4:

 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

示例5: Core

 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

示例6: generatePdf

 public function generatePdf(PdfEvent $event)
 {
     $html2pdf = new \HTML2PDF($event->getOrientation(), $event->getFormat(), $event->getLang(), $event->getUnicode(), $event->getEncoding(), $event->getMarges());
     $html2pdf->setDefaultFont($event->getFontName());
     $html2pdf->pdf->SetDisplayMode('real');
     $html2pdf->writeHTML($event->getContent());
     $event->setPdf($html2pdf->output(null, 'S'));
 }
开发者ID:margery,项目名称:thelia,代码行数:8,代码来源:Pdf.php

示例7: 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');
 }
开发者ID:sgdoc,项目名称:sgdoce-codigo,代码行数:8,代码来源:Pdf.php

示例8:

 function laporan_pdf($date_1, $date_2)
 {
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('P', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     $data['data_pdf'] = $this->mdl_report_delivery->report_delivery_pdf($date_1, $date_2);
     $konten = $this->load->view('report_delivery/delivery_report', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output("Report_delivery_" . $date_1 . " To " . $date_2 . ".pdf");
 }
开发者ID:bosokpp1,项目名称:purlog,代码行数:10,代码来源:laporan_delivery.php

示例9: create_new_pdf_writer

 /**
  * Creates a new HTML2PDF object. 
  * Can be overridden to create renderers with non-default options.
  */
 protected static function create_new_pdf_writer($orientation = self::ORIENTATION_PORTRAIT, $paper_size = self::PAPER_LETTER, $language = self::LANGUAGE_ENGLISH)
 {
     //create a new HTML2PDF object
     $pdf = new HTML2PDF($orientation, $paper_size, $language, false, 'ISO-8859-1');
     //true, 'UTF-8');
     //$pdf =  new HTML2PDF($orientation, $paper_size, $language, true, 'UTF-8');
     //set the font
     $pdf->setDefaultFont('Times');
     return $pdf;
 }
开发者ID:advancingdesign,项目名称:moodle-theme_pdf,代码行数:14,代码来源:core_pdf_renderer.php

示例10: convert

 /**
  * @return  self
  */
 public function convert($filePathIn, $filePathOut, $formats = ['html', 'pdf'])
 {
     $output = ['html' => '', 'pdf' => ''];
     $replace = ['content' => '', 'js' => '', 'css' => ''];
     try {
         $tpl = TemplatesRegistry::get($this->usedTemplate);
         foreach (['js', 'css'] as $type) {
             foreach ($tpl[$type] as $file) {
                 if (!is_readable($file)) {
                     throw new \Exception("Cannot load file {$file}.");
                 }
                 $file = file_get_contents($file);
                 $replace[$type] .= $file . "\n";
             }
         }
         if (file_exists("{$filePathOut}.html")) {
             unlink("{$filePathOut}.html");
         }
         $replace['content'] = $this->mdParser->parse(file_get_contents($filePathIn));
         $output['html'] = $this->latte->renderToString($tpl['layout'], $replace);
         $this->fs->write("{$filePathOut}.html", $output['html']);
         if (in_array('pdf', $formats)) {
             try {
                 $html2pdf = new \HTML2PDF('P', 'A4', 'cs');
                 $html2pdf->setDefaultFont('dejavusans');
                 //$html2pdf->addFont('dejavusans');
                 $html2pdf->pdf->SetDisplayMode('real');
                 $output['html'] = str_replace('\\xe28087', "  ", $output['html']);
                 $html2pdf->writeHTML($output['html']);
                 $pdf = $html2pdf->Output("{$filePathOut}.pdf", 'S');
                 $this->fs->write("{$filePathOut}.pdf", $pdf);
             } catch (Html2PdfException $e) {
                 $formatter = new ExceptionFormatter($e);
                 echo "PDF: " . $formatter->getHtmlMessage();
             }
         }
         if (!in_array('html', $formats)) {
             //unlink("{$filePathOut}.html");
         }
     } catch (\InvalidArgumentException $e) {
         echo $e->getMessage(), "\n";
     }
     return $this;
 }
开发者ID:mdox,项目名称:engine,代码行数:47,代码来源:Convertor.php

示例11: Core

 function laporan_pdf($PMBPeriodID)
 {
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('L', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     //filter
     #get filter
     $fil['PMBPeriodID'] = $PMBPeriodID;
     //$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_lap_peserta->get_pdf($fil);
     /* if (count($da['row'])==0){
     			echo "Data Tidak Tersedia";
     			return;
     		} */
     $konten = $this->load->view('pmb/peserta_laporan', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output('peserta_pmb.pdf');
 }
开发者ID:bosokpp1,项目名称:p-siakad,代码行数:22,代码来源:lap_peserta.php

示例12: cetak

 public function cetak()
 {
     $date = new DateTime('now', new DateTimeZone('Asia/Jakarta'));
     $today = $date->format('d-m-Y');
     $this->load->model('crud_model');
     $data['data'] = $this->crud_model->reportUsers();
     ob_start();
     $content = $this->load->view('reportUser', $data);
     $content = ob_get_clean();
     $filename = "Lap_user" . $today . ".pdf";
     //nama file pdf
     $this->load->library('html2pdf');
     try {
         $html2pdf = new HTML2PDF('P', 'A4', 'en', false, 'ISO-8859-15', array(20, 10, 10, 10));
         //$html2pdf->pdf->SetDisplayMode('fullpage');
         $html2pdf->setDefaultFont('Arial');
         $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
         $html2pdf->Output($filename);
     } catch (HTML2PDF_exception $e) {
         echo $e;
         exit;
     }
 }
开发者ID:mutaqin07,项目名称:php,代码行数:23,代码来源:crud.php

示例13: createPdf

    public function createPdf()
    {
        $salesPersonId = JFactory::getSession()->get('salesPersonId');
        //$filter = JRequest::getVar('filter', array('name' => "", 'code' => "", 'merchant_id' => "", 'fromdate' => "", 'todate' => ""));
        //$filter = JRequest::getVar('filter',array(),'post','array');
        $currency_prefix = JModel::getInstance('setting', 'enmasseModel')->getCurrencyPrefix();
        $dealList = JModel::getInstance('deal', 'enmasseModel')->searchBySaleReports($salesPersonId, JRequest::getVar('name'), JRequest::getVar('merchant_id'), JRequest::getVar('fromdate'), JRequest::getVar('todate'), JRequest::getVar('code'));
        if (empty($dealList)) {
            return null;
        }
        $result = '<table style="border:1px dotted #D5D5D5; border-collapse: collapse;"><tr valign="middle"><th style="border:1px dotted #D5D5D5;" align="center" width="50">' . JText::_("No") . '</th><th style="border:1px dotted #D5D5D5;" width="150">' . JText::_("Deal Code") . '</th><th style="border:1px dotted #D5D5D5;" width="150">' . JText::_("Deal Name") . '</th><th style="border:1px dotted #D5D5D5;" width="100">' . JText::_("Merchant") . '</th><th style="border:1px dotted #D5D5D5;" align="center" width="80">' . JText::_("Qty Sold") . '</th><th style="border:1px dotted #D5D5D5;" align="center" width="80">' . JText::_("Unit Price") . '</th><th style="border:1px dotted #D5D5D5;" align="center" width="80">' . JText::_("Total Sales") . '</th></tr>';
        $i = 0;
        foreach ($dealList as $row) {
            $i++;
            $merchant_name = JModel::getInstance('merchant', 'enmasseModel')->retrieveName($row->merchant_id);
            $total_sales = $row->price * $row->cur_sold_qty;
            $result .= '<tr>
				<td style="border:1px dotted #D5D5D5;" align="center">' . $i . '</td>
				<td style="border:1px dotted #D5D5D5;">' . $row->deal_code . '</td>
				<td style="border:1px dotted #D5D5D5;">' . $row->name . '</td>
				<td style="border:1px dotted #D5D5D5;">' . $merchant_name . '</td>
				<td style="border:1px dotted #D5D5D5;" align="center">' . $row->cur_sold_qty . '</td>
				<td style="border:1px dotted #D5D5D5;" align="center">' . $currency_prefix . $row->price . '</td>
				<td style="border:1px dotted #D5D5D5;" align="center">' . $currency_prefix . $total_sales . '</td></tr>';
            $total_amount += $total_sales;
        }
        $result .= '<tr><td style="border:1px dotted #D5D5D5;" colspan="6" style="text-align:right" >Total Amount: </td>
					<td style="border:1px dotted #D5D5D5;" align="center">' . $currency_prefix . $total_amount . '</td></tr></table>';
        //todo
        require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_enmasse' . DS . 'helpers' . DS . 'html2pdf' . DS . 'html2pdf.class.php';
        $html2pdf = new HTML2PDF('P', 'A4', 'en');
        $html2pdf->setDefaultFont('Arial');
        $html2pdf->writeHTML($result);
        $outFileName = 'report-' . DatetimeWrapper::getDateOfNow() . '.pdf';
        $html2pdf->Output($outFileName, 'I');
        die;
    }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:37,代码来源:salereports.php

示例14: isset

/**
 * HTML2PDF Library - example
 *
 * HTML => PDF convertor
 * distributed under the LGPL License
 *
 * @package   Html2pdf
 * @author    Laurent MINGUET <webmaster@html2pdf.fr>
 * @copyright 2016 Laurent MINGUET
 *
 * isset($_GET['vuehtml']) is not mandatory
 * it allow to display the result in the HTML format
 */
date_default_timezone_set('America/Caracas');
// get the HTML
ob_start();
include 'formato.php';
$content = ob_get_clean();
// convert in PDF
require_once '../html2pdf/vendor/autoload.php';
try {
    $html2pdf = new HTML2PDF('P', 'A4', 'fr');
    //      $html2pdf->setModeDebug();
    $html2pdf->setDefaultFont('Arial');
    $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
    $html2pdf->Output('ficha_tecnica.pdf');
} catch (HTML2PDF_exception $e) {
    echo $e;
    exit;
}
开发者ID:hlrd93,项目名称:PDVSA-ENT,代码行数:30,代码来源:reporte.php

示例15: Core

 function krs_format($kode)
 {
     $data['id_krs'] = $kode;
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('P', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     //$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
     // ambil data dari tabel
     $data['data_pdf'] = $this->mdl_krs->get_krs($kode);
     $konten = $this->load->view('registrasi/krs_format', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output('exemple00.pdf');
 }
开发者ID:bosokpp1,项目名称:p-siakad,代码行数:17,代码来源:krs.php


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