本文整理汇总了PHP中PDF::loadHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP PDF::loadHTML方法的具体用法?PHP PDF::loadHTML怎么用?PHP PDF::loadHTML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDF
的用法示例。
在下文中一共展示了PDF::loadHTML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pdf
public function pdf()
{
// data
$sekolah = Sekolah::data();
$kembali = Pengembalian::semua();
return PDF::loadHTML(View::make('pdf.pengembalian', compact('sekolah', 'kembali')))->setPaper('a4')->download('data pengembalian.pdf');
}
示例2: InDanhSachDeTaiNhom
public function InDanhSachDeTaiNhom($mahp, $macb)
{
$date = date('Y-m-d');
$nguoiin = DB::table('giang_vien')->where('macb', $macb)->value('hoten');
//Lấy giá trị năm học và học kỳ hiện tại
$namht = DB::table('nien_khoa')->distinct()->orderBy('nam', 'desc')->value('nam');
$hkht = DB::table('nien_khoa')->distinct()->orderBy('hocky', 'desc')->where('nam', $namht)->value('hocky');
$mank = DB::table('nien_khoa as nk')->join('nhom_hocphan as hp', 'nk.mank', '=', 'hp.mank')->where('nk.nam', $namht)->where('nk.hocky', $hkht)->value('nk.mank');
$mahp = \Request::segment(3);
if ($mahp == "all") {
$gv_hp = DB::table('nhom_hocphan as hp')->select('gv.macb', 'gv.hoten', 'hp.tennhomhp', 'hp.manhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('gv.macb', $macb)->where('hp.mank', $mank)->get();
//Lấy mảng các mã nhóm HP của cán bộ này ở hk-nk hiện tại
$ds_hpgv = DB::table('nhom_hocphan as hp')->select('hp.manhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('gv.macb', $macb)->where('hp.mank', $mank)->lists('hp.manhomhp');
$dssv = DB::table('sinh_vien as sv')->leftjoin('chia_nhom as chn', 'sv.mssv', '=', 'chn.mssv')->leftjoin('ra_de_tai as radt', 'chn.manhomthuchien', '=', 'radt.manhomthuchien')->leftjoin('de_tai as dt', 'radt.madt', '=', 'dt.madt')->whereIn('chn.manhomhp', $ds_hpgv)->orderBy('chn.manhomthuchien', 'asc')->get();
} else {
if ($mahp != null) {
$gv_hp = DB::table('nhom_hocphan as hp')->select('gv.macb', 'gv.hoten', 'hp.tennhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('hp.manhomhp', $mahp)->first();
$dssv = DB::table('sinh_vien as sv')->leftjoin('chia_nhom as chn', 'sv.mssv', '=', 'chn.mssv')->leftjoin('ra_de_tai as radt', 'chn.manhomthuchien', '=', 'radt.manhomthuchien')->leftjoin('de_tai as dt', 'radt.madt', '=', 'dt.madt')->where('chn.manhomhp', $mahp)->orderBy('chn.manhomthuchien', 'asc')->get();
}
}
$view = \View::make('giangvien.in-danh-sach-de-tai-nhom', compact('macb', 'nguoiin', 'namht', 'hkht', 'gv_hp', 'dssv', 'date', 'mahp'));
$pdf = \App::make('dompdf.wrapper');
$pdf = \PDF::loadHTML($view)->setPaper('a4')->setOrientation('landscape');
return $pdf->stream("DanhSachDeTaiNhom.pdf");
}
示例3: upload
protected function upload()
{
$validator = $this->fileValidator(Input::all());
if ($validator->passes()) {
if ($this->_user->download_count) {
\Excel::selectSheetsByIndex(0)->load(Input::get('file'), function ($reader) {
$finalHtml = '';
$currentTime = date('d-m-Y_His');
mkdir($currentTime);
foreach ($reader->toArray() as $row) {
$html = "\n\t\t\t<style>\n\t\t\t\t.page-break {\n\t \t\t\tpage-break-after: always;\n\t\t\t\t}\n\t\t\t\t.outer-container {\n\t\t\t\t\tmargin: 0% auto;\n\t\t\t\t\tborder: 1px solid black;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\theight: 99%;\n\t\t\t\t}\n\t\t\t\t.subject-container {\n\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\tmargin-top: 30px;\n\t\t\t\t}\n\t\t\t\t.content-container {\n\t\t\t\t\ttext-align: left;\n\t\t\t\t\tpadding: 10px;\n\t\t\t\t\tmargin-top: 50px;\n\t\t\t\t}\n\t\t\t\tol {\n\t\t\t\t\ttext-align: left;\n\t\t\t\t}\n\t\t\t\tol li{\n\t\t\t\t\tpadding-bottom: 40px;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div class='outer-container'>\n\t\t\t\t\n\t\t\t \t\t<p class='subject-container'>Subject: NOTICE UNDER SECTION 138 OF NEGOTIABLE INSTRUMENT ACT READ WITH SECTION 420 OF INDIAN PENAL CODE</p>\n\n\t\t\t\t\t<p class='content-container'>\n\t\t\t\t\t\tOn behalf of and under instructions of my client <u>{$row['name']}</u> S/o__________ R/o __________ (hereinafter referred to as "my client"). I do hereby serve you with the following legal notice:\n\n\t\t\t\t\t\t<ol>\n\t\t\t\t\t\t\t<li>That my client, an engineering student, while looking for job paid Rs {$row['amount']} to you for assured placement in an MNC, last year.</li>\n\t\t\t\t\t\t\t<li>That thereafter my client issued a number of reminders to you for placement, but still no opportunity was provided to him, i.e. as you were unable to fulfill the promise as to placement of my client. Therefore, it was decided between you and my client that the amount of Rs {$row['amount']} should be refunded and as a result you issued him a cheque no {$row['cheque_number']} dated {$row['cheque_date']}.</li>\n\t\t\t\t\t\t\t<li>That the said cheque was presented by my client to State Bank of India, Noida for credit in his account in the month of December 2011 itself, but it bounced due to insufficient funds. And my client contacted you and was assured of cash in lieu of bounced cheque, therefore, my client did not take legal action earlier. My client thereafter again requested many a time to you for the payment of the said cheque amount by telephone and/or through personal visit of his representative, but in vain.</li>\n\t\t\t\t\t\t\t<li>That in April 2012, my client again tried depositing the cheque with State Bank of India, Mysore but it was again returned as unpaid with remarks - Funds Insufficient, vide Syndicate Bank memo dated 19 April 2012.</li>\n\t\t\t\t\t\t\t<li>That in the facts and circumstances created by you my above said client left with no alternative except to serve you the present notice and calling upon all of you to make the payment of the above mentioned cheque amount totaling Rs {$row['amount']}/- (Rupees Ten Thousand only) including bouncing charges in cash with interest @ 24% per annum within 15 days of the receipt of this notice failing which my client shall be constrained to institute against you a criminal complaint under section 138 of the Negotiable Instrument Act read with section 420 of IPC where under you could be sentenced to undergo imprisonment of the two years and also pay the fine equivalent of the double amount of the above mentioned cheque as well as legal charges of this notice of Rs 2100/-</li>\n\t\t\t\t\t\t\t<li>That a copy of this notice retained in my office for further reference /record and legal action.</li>\n\t\t\t\t\t\t</ol>\n\t\t\t\t\t</p>\n\t\t\t</div>";
$finalHtml .= $html . "<div class='page-break'></div>";
\PDF::loadHTML($html)->setPaper('a4')->setOrientation('portrait')->setWarnings(false)->save($currentTime . '/' . $row["name"] . '_' . $row['cheque_number'] . '.pdf');
}
\PDF::loadHTML($finalHtml)->setPaper('a4')->setOrientation('portrait')->setWarnings(false)->save($currentTime . '/' . $currentTime . '.pdf');
// Here we choose the folder which will be used.
$dirName = public_path() . '/' . $currentTime;
// Choose a name for the archive.
$zipFileName = $this->_user->email . '_' . $currentTime . '.zip';
// Create ".zip" file in public directory of project.
$zip = new ZipArchive();
if ($zip->open(public_path() . '/' . $zipFileName, ZipArchive::CREATE) === TRUE) {
// Copy all the files from the folder and place them in the archive.
foreach (glob($dirName . '/*') as $fileName) {
$file = basename($fileName);
$zip->addFile($fileName, $file);
}
$zip->close();
$headers = array('Content-Type' => 'application/octet-stream');
} else {
echo 'failed';
}
$filename = $this->_user->email . '_' . $currentTime . '.zip';
$filepath = $_SERVER["DOCUMENT_ROOT"];
ob_start();
// http headers for zip downloads
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"" . $filename . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filepath . "/" . $filename));
@readfile($filepath . "/" . $filename);
ob_end_flush();
\File::deleteDirectory($currentTime);
\File::delete($this->_user->email . '_' . $currentTime . '.zip');
// reader methods
$this->_user->download_count = $this->_user->download_count - 1;
$this->_user->save();
});
} else {
return Redirect::to("home")->with('message', 'Your maximum download limit 3, exceeded in beta version. Please subscribe to use this feature.');
}
}
return Redirect::to("home")->withErrors($validator->messages());
}
示例4: pageToPdf
/**
* Convert a page to a pdf file.
* @param Page $page
* @return mixed|string
*/
public function pageToPdf(Page $page)
{
$cssContent = file_get_contents(public_path('/css/export-styles.css'));
$pageHtml = view('pages/pdf', ['page' => $page, 'css' => $cssContent])->render();
$containedHtml = $this->containHtml($pageHtml);
$pdf = \PDF::loadHTML($containedHtml);
return $pdf->output();
}
示例5: process
function process()
{
$this->MagicFetch = new MagicalFetch();
if (Input::has("project_folder")) {
$getfolderID = Input::get("project_folder");
reset($getfolderID);
## get the workspace ID
$folderID = current($getfolderID);
## set the work space folder
define("WORKS_SPACE_ID", $folderID);
/**
* Copy files from temp to workspace
*/
rename(base_path() . "/tmp/" . $folderID, base_path() . "/workspace/{$folderID}");
define("SOURCE_DIR", base_path() . "/workspace/{$folderID}");
chmod(SOURCE_DIR, 0777);
$target_path = base_path() . "/projects/{$folderID}";
## create project directory
if (!is_dir($target_path)) {
mkdir($target_path, 0777);
}
## set the target folder
define("TARGET_DIR", $target_path);
}
if (!is_readable(SOURCE_DIR)) {
echo "Error. Source Directory " . SOURCE_DIR . " is not readable. Program will terminate<br>";
exit;
}
if (!is_writeable(TARGET_DIR)) {
echo "Error. Target Directory " . TARGET_DIR . " is not writeable. Program will terminate<br>";
exit;
}
$data['html'] = $this->ScanSourceFiles();
krsort($this->FuncArray);
krsort($this->ConstArray);
krsort($this->VarArray);
sort($this->FileArray);
$data['html'] .= $this->WriteTargetFiles();
$data['html'] .= $this->MagicFetch->ShowArrays();
if (Input::get('ciphers') == 'fw') {
$this->CiphersLaravel();
} elseif (Input::get('ciphers') == 'none') {
$this->CiphersNonFW();
}
if (Input::has('blenciT')) {
$data['blenc_report'] = $this->BLENCiT();
if (Input::has('BLENC_Report') && Input::get('BLENC_Report') == 1) {
PDF::loadHTML($data['blenc_report'])->setPaper('a4')->setOrientation('landscape')->setWarnings(false)->save(TARGET_DIR . '/blenc/blenc_report.pdf');
}
}
if (Input::has('PDF_Report') && Input::get('PDF_Report') == 1) {
PDF::loadHTML($data['html'])->setPaper('a4')->setOrientation('landscape')->setWarnings(false)->save(TARGET_DIR . '/guide.pdf');
}
MagicalHelpers::CompressProject();
MagicalHelpers::DeleteDir(SOURCE_DIR);
return View::make('magical.process', $data)->with($data)->render();
}
示例6: InDSPhanCV
public function InDSPhanCV($manth)
{
$date = date('Y-m-d');
//Carbon::now();
//Lấy năm học và học kỳ hiện tại
$namht = DB::table('nien_khoa')->distinct()->orderBy('nam', 'desc')->value('nam');
$hkht = DB::table('nien_khoa')->where('nam', $namht)->orderBy('hocky', 'desc')->value('hocky');
$gv = DB::table('giang_vien as gv')->select('gv.macb', 'gv.hoten', 'gv.email')->join('de_tai as dt', 'gv.macb', '=', 'dt.macb')->join('ra_de_tai as radt', 'dt.madt', '=', 'radt.madt')->where('radt.manhomthuchien', $manth)->first();
$thongtin = DB::table('de_tai as dt')->select('dt.tendt', 'sv.hoten', 'sv.mssv', 'sv.email', 'hp.tennhomhp')->join('ra_de_tai as radt', 'dt.madt', '=', 'radt.madt')->join('chia_nhom as chn', 'radt.manhomthuchien', '=', 'chn.manhomthuchien')->join('sinh_vien as sv', 'chn.mssv', '=', 'sv.mssv')->join('nhom_hocphan as hp', 'chn.manhomhp', '=', 'hp.manhomhp')->where('chn.nhomtruong', 1)->where('chn.manhomthuchien', $manth)->first();
$dscv = DB::table('cong_viec as cv')->join('thuc_hien as th', 'cv.macv', '=', 'th.macv')->where('th.manhomthuchien', $manth)->get();
$view = \View::make('giangvien.in-ke-hoach-phan-cong-nhomsv', compact('manth', 'date', 'thongtin', 'namht', 'hkht', 'dscv', 'gv'));
$pdf = \App::make('dompdf.wrapper');
$pdf = \PDF::loadHTML($view)->setPaper('a4')->setOrientation('landscape');
return $pdf->stream("KeHoach_" . $manth . ".pdf");
}
示例7: reporteCursantePdf
public function reporteCursantePdf(Request $request)
{
$id = $request['cursante'];
$cursante = DB::table('users')->where('users.id', $id)->join('kardexes', 'users.id', '=', 'user')->get();
$directores = Leader::all();
$nombreJefe = $request['jefe'];
$jefes = DB::table('jeves')->where('jefe_est', $nombreJefe)->get();
$view = \View::make('director.RepdfCursante', compact('cursante', 'directores', 'jefes'))->render();
$pdf = \PDF::loadHTML($view)->setPaper('letter');
return $pdf->stream('Cursate-{users.paterno}.pdf');
}
示例8: generatePdf
public function generatePdf($chart)
{
$file_name = time() . 'report.pdf';
$file_path = public_path('report');
$user_stat = $this->getUserStatsForPdf();
$skill_stat = $chart;
$htmlcontent = view('report.report')->with(['user_stat' => $user_stat, 'skill_stat']);
\PDF::loadHTML($htmlcontent)->setPaper('a4')->setOrientation('portrait')->save($file_path . $file_name);
$mail_template = 'emails.email_report';
$data['receipent_name'] = \Auth::user()->name;
$data['receipent_email'] = \Auth::user()->email;
$data['message'] = $message;
$mail_receipents[\Auth::user()->email] = \Auth::user()->name;
$mail_subject = 'Result Report';
$mailMessage = 'Please see the report attatched for you order.';
$mail_attachment = $file_path . $file_name;
\Mail::send($mail_template, $data, function ($mailMessage) use($mail_receipents, $mail_subject, $mail_attachment) {
$message->to($mail_receipents)->subject($mail_subject);
$message->attach($mail_attachment);
});
unlink($file_path . $file_name);
}
示例9: pdf
public function pdf()
{
// data
$sekolah = Sekolah::data();
$admin = Admin::semua();
return PDF::loadHTML(View::make('pdf.pengguna', compact('sekolah', 'admin')))->setPaper('a4')->download('data pengguna.pdf');
}
示例10: create
/**
* Show the form for creating a new resource PDF.
*
* @param string $view
* @param string $title
* @return \Illuminate\Http\Response
*/
public function create($view, $title)
{
$pdf = \PDF::loadHTML($view);
return $pdf->setPaper('Letter')->stream($title);
}
示例11: savePdf
/**
* @param $factura
* @param $tmpDir
* @return array
*/
private function savePdf($factura, $tmpDir)
{
$view = $this->viewInvoice($factura);
$view = str_replace("localhost:8080", "localhost", $view);
$uidPdf = uniqid();
$pdfPath = storage_path("app") . "{$tmpDir}/{$uidPdf}.pdf";
\PDF::loadHTML($view)->setPaper('a4')->setOption('margin-right', 0)->setOption('margin-bottom', 0)->setOption('margin-left', 0)->setOption('margin-top', 0)->save($pdfPath);
return array($uidPdf, $pdfPath);
}
示例12: generate_pdf
protected function generate_pdf($html, $filepath, $footer = 'footerpdf', $header = '', $type = '1', $headerparam = '')
{
$pdf = PDF::loadHTML($html);
$footer = route($footer);
$footer = str_replace("https", "http", $footer);
$pdf_options = array('page-size' => 'Letter', 'margin-top' => 26, 'margin-bottom' => 26, 'footer-html' => $footer, 'disable-smart-shrinking' => false);
if ($header != '') {
if ($headerparam == '') {
$pdf_options['header-center'] = $header;
$pdf_options['header-font-size'] = 8;
} else {
$header = route($header, array($headerparam));
$header = str_replace("https", "http", $header);
$pdf_options['header-html'] = $header;
$pdf_options['header-spacing'] = 5;
}
}
if ($type == '1') {
$pdf_options['margin-left'] = 26;
$pdf_options['margin-right'] = 26;
}
if ($type == '2') {
$pdf_options['margin-left'] = 16;
$pdf_options['margin-right'] = 16;
}
$pdf->setOptions($pdf_options)->save($filepath);
while (!file_exists($filepath)) {
sleep(2);
}
return true;
}
示例13: cetak_surat_penunjukan
function cetak_surat_penunjukan($id)
{
$pengadaan = $this->get_pengadaan($id);
$jadwal = $this->get_jadwal($id);
$rekanan = $this->get_rekanan($pengadaan->id_rekanan);
$pegawai = $this->get_pegawai($pengadaan->id_users);
$data = new stdclass();
$data->tanggal = Date::parse($jadwal->thp10_smp)->format('j F Y');
$data->no_penunjukan = $pengadaan->no_srt12;
$data->rekanan = $rekanan->nama_rkn;
$data->judul = $pengadaan->desk_kegiatan;
$data->thn_anggaran = $pengadaan->thn_anggaran;
$data->tgl_penawaran = $jadwal->thp4_smp;
$data->hps_nego = number_format($pengadaan->hps_deal, 0, ',', '.');
$data->hps_nego_huruf = number_format($pengadaan->hps_deal, 0, ',', '.');
$data->pegawai = $pegawai->nama;
$data->nip = $pegawai->nik;
$html = View::make('admin.report.sppb')->with('data', $data);
return PDF::loadHTML($html)->setPaper('legal')->setOrientation('portait')->stream('surat_penunjukan_penyedia.pdf');
}
示例14: getPdfView
public function getPdfView(Request $request, $id)
{
$view = $this->getHtmlContent($id);
$nombreFact = "factura-{$this->data['row']->serfac}-{$this->data['row']->ejefac}-{$this->data['row']->numfac}.pdf";
$output = \PDF::loadHTML($view)->setPaper('a4')->setOption('margin-right', 0)->setOption('margin-bottom', 0)->setOption('margin-left', 0)->setOption('margin-top', 0)->output();
return Response::make($output, 200, ['Content-Type' => 'application/pdf', 'Content-Disposition' => 'inline; ' . $nombreFact]);
}
示例15: cetakPengalaman_rekanan
function cetakPengalaman_rekanan($id)
{
$data = new stdclass();
$pengadaan = $this->get_pengadaan($id);
$data = Rekanan::where('id_rkn', $pengadaan->id_rekanan)->first();
$data->tanggal = date("d F Y", strtotime($this->get_jadwal($id)->thp2_dari));
$pengurus = $this->get_pengurus($pengadaan->id_rekanan);
$data->pemilik = $pengurus->nama_pengurus;
$data->jabatan = $pengurus->jabatan;
$html = View::make('admin.report.data_pengalaman_rekanan')->with('data', $data);
return PDF::loadHTML($html)->setPaper('legal')->setOrientation('landscape')->stream('pengalaman_perusahaan.pdf');
}