本文整理汇总了PHP中PDF类的典型用法代码示例。如果您正苦于以下问题:PHP PDF类的具体用法?PHP PDF怎么用?PHP PDF使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PDF类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPDF
public function getPDF()
{
/*$pdf = new PDF();
$docentes = Docente::all();
$columnas = ['NRO','CODIGO','APELLIDOS Y NOMBRES'];
$pdf->SetFont('Arial','B',13);
$pdf->AddPage();
$pdf->Cell(80);
$pdf->Cell(30,5,'Lista de Docentes',0,1,'C');
$pdf->SetFont('Arial','B',9);
$pdf->Ln(2);
$pdf->SetFont('Arial','B',10);
$pdf->docentes($columnas,$docentes);
$cabe=['Content-Type' => 'application/pdf'];
return Response::make($pdf->_checkoutput(),200,$cabe);*/
$fpdf = new PDF();
$docentes = Docente::all();
$columnas = ['NRO', 'CODIGO', 'APELLIDOS Y NOMBRES'];
$fpdf->AddPage();
$fpdf->Cell(80);
$fpdf->Cell(30, 5, 'Lista de Docentes', 0, 1, 'C');
$fpdf->SetFont('Arial', 'B', 9);
$fpdf->Ln(2);
$fpdf->SetFont('Arial', 'B', 16);
$fpdf->docentes($columnas, $docentes);
$fpdf->Output();
exit;
}
示例2: display
public function display()
{
$order_invoice_list = $this->order->getInvoicesCollection();
Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list));
$pdf = new PDF($order_invoice_list, PDF::TEMPLATE_INVOICE, $this->context->smarty);
$pdf->render();
}
示例3: render
/**
* PageHeader element renderer
*
* @param PDF $pdf
*
* @return void
*/
function render($pdf)
{
$pdf->clearPageHeader();
foreach ($this->elements as $element) {
$pdf->addPageHeader($element);
}
}
示例4: gerarpdfAction
public function gerarpdfAction()
{
$this->_helper->layout->disableLayout();
$html = $_POST['html'];
$formato = $_POST['formato'];
$pdf = new PDF($html, $formato);
xd($pdf->gerarRelatorio());
}
示例5: Cetak
function Cetak()
{
// *** Init PDF
$pdf = new PDF();
$pdf->SetTitle("Rekap Pembayaran Mahasiswa Per Bulan");
$pdf->AddPage('L', 'Legal');
$lbr = 190;
BuatIsinya($_SESSION['TahunID'], $_SESSION['ProdiID'], $pdf);
$pdf->Output();
}
示例6: Cetak
function Cetak()
{
// *** Init PDF
$pdf = new PDF();
$pdf->SetTitle("Pembayaran Mahasiswa Per Periode");
$pdf->AddPage();
$lbr = 190;
BuatIsinya($_SESSION['TahunID'], $_SESSION['ProdiID'], $pdf);
$pdf->Output();
}
示例7: Cetak
function Cetak()
{
$TahunID = sqling($_REQUEST['TahunID']);
$ProdiID = sqling($_REQUEST['ProdiID']);
$BIPOTNamaID = $_REQUEST['BIPOTNamaID'];
// *** Init PDF
$pdf = new PDF();
$pdf->SetTitle("Laporan Pembayaran Per Akun");
BuatIsinya($TahunID, $ProdiID, $BIPOTNamaID, $pdf);
$pdf->Output();
}
示例8: Cetak
function Cetak()
{
// *** Init PDF
$pdf = new PDF();
$pdf->SetTitle("Penjualan Formulir");
$pdf->AddPage();
$lbr = 190;
BuatJudulLaporan($_SESSION['_PMBPeriodID'], $pdf);
BuatIsinya($_SESSION['_PMBPeriodID'], $pdf);
$pdf->Output();
}
示例9: relatorioCursoPorPolo
function relatorioCursoPorPolo()
{
$pdf = new PDF("P", "pt", "A4");
$relatorio = $this->read();
$cabeçalhoTabela = array('Curso', 'Tipo');
$polo = "";
$array = array();
foreach ($relatorio as $value) {
if ($polo == "") {
$polo = $value->getPolo()->getId();
$pdf->setVendedor($value->getPolo()->getNome());
$pdf->AddPage();
}
if ($polo != $value->getPolo()->getId()) {
$pdf->BasicTable($cabeçalhoTabela, $array);
$array = array();
$polo = $value->getPolo()->getId();
$pdf->setVendedor($value->getPolo()->getNome());
$pdf->AddPage();
array_push($array, array($value->getNome(), $value->getTipo()['descricao']));
} else {
array_push($array, array($value->getNome(), $value->getTipo()['descricao']));
}
}
$pdf->BasicTable($cabeçalhoTabela, $array);
$pdf->Output();
}
示例10: imprimirPase
public function imprimirPase($id)
{
if (Session::get('id')) {
$usuario = $this->usuariosRepo->buscar(Session::get('id'));
} else {
$usuario = $this->usuariosRepo->buscar($id);
}
if ($usuario->available_pago === 1 && $usuario->available_perfil === 1) {
$datetime1 = new DateTime('2014-09-17 12:30:00');
$datetime2 = new DateTime("now");
// if( $datetime1 > $datetime2 ){
// Session::flash('aviso', 'Su pase podra ser impreso hasta el miercoles 17 de noviembre del 2014 a las 12:30 pm');
// return Redirect::back();
// }
$content = $usuario->id . ',' . $usuario->full_name . ',' . $usuario->email;
DNS2D::getBarcodePngPath('codeqr', $content, "QRCODE", 7, 7, array(91, 139, 205));
$html = View::make("imprimir/imprimirPase", compact('usuario'));
return PDF::load($html, 'A4', 'landscape')->show();
} else {
// Session::flash('aviso', 'Su pago no a sido registrado o su perfil aun esta incompleto');
$usuario = [Auth::user()->available_pago, Auth::user()->available_perfil];
if ($usuario[0] == 0 && $usuario[1] == 0) {
Session::flash('aviso', 'Debe completar su perfíl');
} elseif ($usuario[0] == 0 && $usuario[1] == 1) {
Session::flash('aviso', 'Su pago no ha sido validado. Intente más tarde');
}
return Redirect::route('inicio');
}
}
示例11: exportToPdf
public function exportToPdf()
{
$data = DB::table('logbooks')->join('priorities', 'logbooks.priorities_id', '=', 'priorities.id')->join('users', 'logbooks.user_id', '=', 'users.id');
$fromDate = Input::get('fromDate');
$toDate = Input::get('toDate');
$sid = Input::get('sid');
$oid = Input::get('oid');
if ($oid == 'all') {
$opName = "Semua Operator";
} else {
if ($oid) {
$user = User::find($oid);
$opName = $user->first_name . ' ' . $user->last_name;
$data->where('logbooks.user_id', '=', $oid);
}
}
if ($sid == 'all') {
$sName = "Semua Status";
} else {
if ($sid) {
$status = Priorities::find($sid);
$sName = $status->description;
$data->where('logbooks.priorities_id', '=', $sid);
}
}
$query = $data->select('logbooks.user_id', 'users.id', 'logbooks.created_at', 'logbooks.title', 'logbooks.deskripsi', 'logbooks.priorities_id', 'priorities.description as priority', 'users.first_name', 'users.last_name')->whereBetween('logbooks.created_at', array($fromDate, $toDate))->orderBy('logbooks.created_at', 'asc');
$logbook = ['data' => $query->get(), 'fromDate' => $fromDate, 'toDate' => $toDate, 'sName' => $sName, 'opName' => $opName, 'count' => $data->count()];
// $pdf = View::make('export.pdf', $logbook);
// return $pdf;
$pdf = PDF::loadView('export.pdf', $logbook);
return $pdf->stream();
}
示例12: handle
public function handle()
{
date_default_timezone_set("America/Mexico_City");
$lastweek = Carbon::now()->startOfWeek()->subWeek();
$startOfWeek = Carbon::now()->startOfWeek()->addDay();
if ($startOfWeek->isTomorrow() == true) {
$encuestas = Encuesta::History($lastweek, $startOfWeek)->get();
} else {
$encuestas = Encuesta::Reinicio($startOfWeek)->get();
}
$pdf = \PDF::loadView('reportes.Clientes', compact('encuestas'))->setOrientation('landscape')->save(public_path() . '/pdfs/' . 'reporte semanal' . '.pdf');
$ToMail = 'victor.zapata@trep.mx';
$ToName = 'Victor Zapata';
$file = public_path() . '/pdfs/' . 'reporte semanal' . '.pdf';
\Mail::send('emails.Reportes', [], function ($message) use($ToName, $ToMail, $file) {
//remitente
$message->from(env('MAIL_FROM'), env('MAIL_NAME'));
//asunto
$message->subject('Reporte Semanal Thaigreen');
//receptor
$message->to($ToMail, $ToName);
$message->to('miguel.sanchez@trep.mx', 'Mike');
$message->to('mahoganyp@thaigreen.mx', $name = null);
//Adjunto
$message->attach($file, ['as' => 'Reporte Semanal.PDF']);
});
chmod(public_path() . '/pdfs/' . 'reporte semanal.pdf', 0777);
unlink(public_path() . '/pdfs/' . 'reporte semanal.pdf');
}
示例13: stock
public function stock()
{
$items = Item::all();
$organization = Organization::find(1);
$pdf = PDF::loadView('erpreports.stockReport', compact('items', 'organization'))->setPaper('a4')->setOrientation('potrait');
return $pdf->stream('Stock Report.pdf');
}
示例14: getResult
public function getResult($id = 'x')
{
$printed = \Request::get('printed');
$slctd_samples = \Request::has("samples") ? \Request::get("samples") : [];
$slctd_samples_str = is_array($slctd_samples) ? implode(',', $slctd_samples) : "{$slctd_samples}";
$sql = "SELECT s.*, p.artNumber,p.otherID, p.gender, p.dateOfBirth,\n\t\t\t\tGROUP_CONCAT(ph.phone SEPARATOR ',') AS phone, f.facility, d.district, h.hub AS hub_name, \n\t\t\t\tGROUP_CONCAT(res_r.Result, '|||', res_r.created SEPARATOR '::') AS roche_result,\n\t\t\t\tGROUP_CONCAT(res_a.result, '|||', res_a.created SEPARATOR '::') AS abbott_result,\n\t\t\t\tGROUP_CONCAT(res_o.result, '|||', res_o.created SEPARATOR '::') AS override_result,\n\t\t\t\tlog_s.id AS repeated, v.outcome AS verify_outcome, reason.appendix AS rejection_reason,\n\t\t\t\tu.signaturePATH, wk.machineType, fctr.factor, sw.sampleID, sw.worksheetID\n\t\t\t\tFROM vl_samples AS s\n\t\t\t\tLEFT JOIN vl_facilities AS f ON s.facilityID=f.id\n\t\t\t\tLEFT JOIN vl_districts AS d ON f.districtID=d.id\n\t\t\t\tLEFT JOIN vl_hubs AS h ON f.hubID=h.id\n\t\t\t\tLEFT JOIN vl_patients As p ON s.patientID=p.id\n\t\t\t\tLEFT JOIN vl_patients_phone As ph ON p.id = ph.patientID\n\t\t\t\tLEFT JOIN vl_samples_verify AS v ON s.id=v.sampleID\t\t\t\t\n\t\t\t\tLEFT JOIN vl_appendix_samplerejectionreason AS reason ON v.outcomeReasonsID=reason.id\n\t\t\t\tLEFT JOIN vl_samples_worksheet AS sw ON s.id=sw.sampleID\n\t\t\t\tLEFT JOIN vl_samples_worksheetcredentials AS wk ON sw.worksheetID=wk.id\n\t\t\t\tLEFT JOIN vl_results_roche AS res_r ON s.vlSampleID = res_r.SampleID\n\t\t\t\tLEFT JOIN vl_results_abbott AS res_a ON s.vlSampleID = res_a.SampleID\n\t\t\t\tLEFT JOIN vl_results_override AS res_o ON s.vlSampleID = res_o.sampleID\n\t\t\t\tLEFT JOIN vl_logs_samplerepeats AS log_s ON s.id = log_s.sampleID\n\t\t\t\tLEFT JOIN vl_users AS u ON wk.createdby = u.email\n\t\t\t\tLEFT JOIN vl_results_multiplicationfactor AS fctr ON wk.id=fctr.worksheetID\n\t\t\t\tWHERE\n\t\t\t\t";
if ($id == 'x' and count($slctd_samples) == 0) {
return "Please select atleast one";
}
$sql .= $id != 'x' ? " s.id={$id} LIMIT 1" : " s.id IN ({$slctd_samples_str}) GROUP BY s.id";
$vldbresult = \DB::connection('live_db')->select($sql);
if (\Request::has('pdf')) {
$s_arr = $id != 'x' ? [$id] : explode(",", $slctd_samples_str);
$sql = "INSERT INTO vl_facility_downloads (sample_id, downloaded_by, downloaded_on) VALUES";
foreach ($s_arr as $smpl) {
$sql .= "({$smpl}, '" . \Auth::user()->email . "', '" . date('Y-m-d H:i:s') . "'),";
}
$sql = trim($sql, ',');
\DB::connection('live_db')->unprepared($sql);
$pdf = \PDF::loadView('results.pdfresults', compact("vldbresult"));
return $pdf->download('vl_results_' . session('facility') . '.pdf');
//return \PDF::loadFile('http://www.github.com')->inline('github.pdf');
}
return view('results.result', compact("vldbresult", "printed"));
}
示例15: __construct
public function __construct($orientation = 'P', $format = "Letter", $color = 'gray')
{
parent::__construct($orientation, "pt", $format);
self::$document_orientation = $orientation;
self::$document_format = $format;
$margins = parent::getMargins();
$this->document_width = parent::getPageWidth() - $margins['left'] - $margins['right'];
$this->last_width = $margins['left'];
$this->last_height = $margins['top'];
$this->document_color = $color;
if ($color == 'red') {
parent::SetDrawColorArray(array(255, 128, 128));
} elseif ($color == 'green') {
parent::SetDrawColorArray(array(128, 255, 128));
} elseif ($color == 'blue') {
parent::SetDrawColorArray(array(128, 128, 255));
} else {
parent::SetDrawColorArray(array(128, 128, 128));
}
parent::SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
parent::SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);
parent::setImageScale(PDF_IMAGE_SCALE_RATIO);
parent::SetHeaderMargin(PDF_MARGIN_HEADER);
parent::SetFooterMargin(PDF_MARGIN_FOOTER + 10);
}