本文整理汇总了PHP中FPDF::output方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::output方法的具体用法?PHP FPDF::output怎么用?PHP FPDF::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDF
的用法示例。
在下文中一共展示了FPDF::output方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: download
public function download($page = 'noticeview')
{
define('FPDF_FONTPATH', APPPATH . 'plugins/fpdf/font/');
require APPPATH . 'plugins/fpdf/fpdf.php';
$this->load->helper('url');
if (!file_exists(APPPATH . '/views/noticeboard/' . $page . '.php')) {
show_404();
}
$data['title'] = ucfirst($page);
// Capitalize the first letter
$data['name'] = "Nayeem";
$id = $_GET['id'];
$file = base_url() . 'uploads/' . $id . '.jpg';
$type = ".jpg";
if (@getimagesize($file)) {
$size = getimagesize($file);
} else {
$type = ".png";
$file = base_url() . 'uploads/' . $id . '.png';
$size = getimagesize(base_url() . 'uploads/' . $id . '.png');
}
//$pdf = new FPDF('p','mm',array(210,300));
if ($size[0] > $size[1]) {
$style = 'l';
} else {
$style = 'p';
}
$pdf = new FPDF($style, 'pt', array($size[0] * 3 / 4, $size[1] * 3 / 4));
$pdf->AddPage();
$pdf->setDisplayMode('fullpage');
//$pdf -> Image(base_url().'uploads/'.$id.'.png',20,20,170,260);
$pdf->Image(base_url() . 'uploads/' . $id . "" . $type, 0, 0, 0, 0);
// $pdf -> setFont ('times','B',20);
// $pdf -> cell(200,30,"Title",0,1);
$pdf->setFont('times', 'B', '20');
$pdf->write(10, "{$size['0']}, {$size['1']}");
$pdf->output($id . '.pdf', 'D');
//header('Location: ' .base_url(). 'index.php/noticeview/show?id='.$id);
}
示例2: save
//.........这里部分代码省略.........
$borders .= 'T';
$pdf->SetDrawColor(
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 0, 2)),
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 2, 2)),
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 4, 2))
);
}
if ($style->getBorders()->getBottom()->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
$borders .= 'B';
$pdf->SetDrawColor(
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 0, 2)),
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 2, 2)),
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 4, 2))
);
}
if ($borders == '') {
$borders = 0;
}
if ($sheet->getShowGridlines()) {
$borders = 'LTRB';
}
// Image?
$iterator = $sheet->getDrawingCollection()->getIterator();
while ($iterator->valid()) {
if ($iterator->current()->getCoordinates() == PHPExcel_Cell::stringFromColumnIndex($column) . ($row + 1)) {
try {
$pdf->Image(
$iterator->current()->getPath(),
$pdf->GetX(),
$pdf->GetY(),
$iterator->current()->getWidth(),
$iterator->current()->getHeight(),
'',
$this->_tempDir
);
} catch (Exception $ex) { }
}
$iterator->next();
}
// Print cell
$pdf->MultiCell(
$cellWidth,
$cellHeight,
$cellData,
$borders,
$alignment,
($style->getFill()->getFillType() == PHPExcel_Style_Fill::FILL_NONE ? 0 : 1)
);
// Coordinates
$endX = $pdf->GetX();
$endY = $pdf->GetY();
// Revert to original Y location
if ($endY > $startY) {
$pdf->SetY($startY);
if ($lineHeight < $lineHeight + ($endY - $startY)) {
$lineHeight = $lineHeight + ($endY - $startY);
}
}
$pdf->SetX($startX + $singleCellWidth);
// Hyperlink?
if ($sheet->getCellByColumnAndRow($column, $row)->hasHyperlink()) {
if (!$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->isInternal()) {
$pdf->Link(
$startX,
$startY,
$endX - $startX,
$endY - $startY,
$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->getUrl()
);
}
}
}
// Garbage collect!
$sheet->garbageCollect();
// Next line...
$pdf->Ln($lineHeight);
}
}
// Document info
$pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
$pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
$pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
$pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
$pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());
// Write to file
fwrite($fileHandle, $pdf->output($pFilename, 'S'));
// Close file
fclose($fileHandle);
}
示例3: viewBookingPDF
public function viewBookingPDF(Request $request)
{
include app_path() . '\\fpdf\\fpdf.php';
//require(app_path().'/Http/Controllers/fpdf/fpdf.php');
if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) {
$id = $_REQUEST['id'];
//return view('pages.mybookings', ['booking' => bookingModel::findOrFail($id)] );
$pdf = new \FPDF();
$pdf->AddPage();
$pdf->SetFont("Arial", "B", 20);
$pdf->Cell(0, 10, "Welcome to Lodgiify", 1, 1);
$pdf->Cell(50, 10, "FirstName :", 1, 0);
//$pdf->Cell(50,10,$booking[0]->checkin ,1,1);
$pdf->output();
die;
}
}
示例4:
$pdf->Cell(0, 10, "Address : {$address}", 1, 0, "L");
//$pdf->Cell(-100,10,"Present Complaints : {$complents}",1,0,"C");
$pdf->Ln();
$pdf->Cell(0, 10, "Date of Admission : {$admitdate}", 1, 0, "L");
$pdf->Cell(-100, 10, "Date of discharge : {$dischargedate}", 1, 0, "C");
$pdf->Ln();
$pdf->Cell(0, 10, "Diagnosis : {$diagnosis}", 1, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, "Treatment : {$treatement}", 1, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, "Surgeon Name : {$surgeon}", 1, 0, "L");
$pdf->Cell(-100, 10, "Anasthesia Surgeon : {$anasthesiasurgeon}", 1, 0, "C");
$pdf->Ln();
$pdf->Cell(0, 10, "Delivery : {$delivery}", 1, 0, "L");
$pdf->Cell(-100, 10, "Anasthesia : {$anasthesia}", 1, 0, "C");
$pdf->Ln();
$pdf->SetFont("Arial", "B", 12);
$pdf->Cell(0, 10, "Baby's Information", 1, 0, "L");
$pdf->SetFont("Arial", "", 10);
$pdf->Ln();
$pdf->Cell(0, 10, "Date Of Birth : {$bdob}", 1, 0, "L");
$pdf->Cell(-100, 10, "Birth Time : {$btime}", 1, 0, "C");
$pdf->Ln();
$pdf->Cell(0, 10, "Weight : {$weight}", 1, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, "Gender : Male = {$male} Female = {$female} Twins = {$twins}", 1, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, "Status : {$status}", 1, 0, "L");
$pdf->Cell(-100, 10, "Asphxia : {$asphxia}", 1, 0, "C");
$pdf->output();
示例5: FPDF
<?php
require_once 'fpdf.php';
define('FPDF_FONTPATH', './font/');
//Zeichensatz anzeigen im PDF
$font = 'ORION';
$pdf = new FPDF();
$pdf->AddFont($font, '', $font . '.php');
$pdf->SetFont($font, '', 15);
$pdf->Open();
$pdf->AddPage();
$pdf->setFontSize(15);
for ($i = 32; $i < 256; $i++) {
$text .= " #{$i}: " . chr($i);
}
$pdf->write(10, $text);
$pdf->output('test.pdf');
示例6: viewVehicleBookingPDF
public function viewVehicleBookingPDF(Request $request)
{
$error = true;
$user = $request->session()->get('user');
if (is_null($user)) {
return redirect()->action('MainController@index');
} elseif ($user[0]->type == "tenant") {
if (isset($request['id'])) {
$bookingid = $request['id'];
$error = false;
} else {
$bookingid = false;
$error = true;
}
if ($error == false) {
$bookings = vehiclebookingModel::where('id', '=', $bookingid)->get();
$driver = $bookings[0]->vehicle->driver;
if ($driver = 0) {
$x = 'NO';
} else {
$x = 'Yes';
}
$vehicleName = $bookings[0]->vehicle->vehicleName;
$vehicleModel = $bookings[0]->vehicle->models;
$vehicleCat = $bookings[0]->vehicle->category->vehiclecatname;
$vehicleImage = $bookings[0]->vehicle->image;
include app_path() . '\\fpdf\\fpdf.php';
if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) {
$id = $_REQUEST['id'];
$pdf = new \FPDF();
$pdf->AddPage();
$pdf->Rect(5, 5, 200, 287, 'D');
//For A4
$pdf->SetFont("Arial", "B", 30);
$pdf->SetFillColor(36, 96, 84);
$pdf->write(6, $pdf->Image('images/logo.png', 145, 10, -100), 1, 1);
$pdf->SetFont("Arial", "B", 8);
$pdf->Ln(30);
$pdf->Cell(135);
$pdf->Write(10, "Phone: 2612205/57139151");
$pdf->Ln(10);
$pdf->Cell(135);
$pdf->Write(10, "Email: Lokeshpravin@gmail.com");
$pdf->SetFont("Arial", "B", 30);
$pdf->Write(10, "Welcome to Lodgiify");
$pdf->Ln(20);
$pdf->SetFont("Arial", "B", 12);
$pdf->Cell(20);
$pdf->MultiCell(25, 6, "Booking Form:", 'LRT', 'L', 0);
$pdf->Cell(20);
$pdf->Cell(75, 10, "Full Name :", 1, 0);
$pdf->Cell(75, 10, $user[0]->FirstName . ' ' . $user[0]->LastName, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 10, "From :", 1, 0);
$pdf->Cell(75, 10, $bookings[0]->fromdate, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 10, "To :", 1, 0);
$pdf->Cell(75, 10, $bookings[0]->todate, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 10, "Price :", 1, 0);
$pdf->Cell(75, 10, 'Rs' . $bookings[0]->price, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 10, "Vehicle Name :", 1, 0);
$pdf->Cell(75, 10, $vehicleName, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 10, "Type :", 1, 0);
$pdf->Cell(75, 10, $vehicleCat, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 10, "Model : ", 1, 0);
$pdf->Cell(75, 10, $vehicleModel, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 10, "With driver : ", 1, 0);
$pdf->Cell(75, 10, $x, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 10, "Transmission : ", 1, 0);
$pdf->Cell(75, 10, $bookings[0]->vehicle->transmission, 1, 1);
$pdf->Cell(20);
$pdf->Cell(75, 60, "Image : ", 1, 0);
$pdf->Cell(75, 60, $pdf->Image('upload' . "/" . $vehicleImage, 118, 187, 50, 50), 1, 1);
$pdf->Ln(45);
$pdf->SetFont("Arial", "B", 10);
$pdf->Cell(155);
$pdf->Cell(0, 5, "Page " . $pdf->PageNo(), 0, 1);
$pdf->output();
die;
}
}
} else {
return response()->view('pages.404', ['user' => $user], 404);
}
}
示例7: download
public function download()
{
define('FPDF_FONTPATH', APPPATH . 'plugins/fpdf/font/');
require APPPATH . 'plugins/fpdf/fpdf.php';
$this->load->helper('url');
$getmed = $this->dbroom->getmedical();
$getlau = $this->dbroom->getlaundry();
$data['mednil'] = 0;
$data['launil'] = 0;
if ($getmed->num_rows() == 0) {
$data['mednil'] = 1;
}
if ($getlau->num_rows() == 0) {
$data['launil'] = 1;
}
$pdf = new FPDF('p', 'mm', 'a4');
$pdf->AddPage();
$pdf->setDisplayMode('fullpage');
$pdf->setFont('times', 'B', '20');
if (!$data['mednil']) {
$pdf->write(10, "\nStudents Asked for Medical Help\n\n");
$pdf->setFont('times', 'B', '15');
$pdf->cell(80, 10, "Name", 1, 0, 'C');
$pdf->cell(40, 10, "Room", 1, 0, 'C');
$pdf->cell(40, 10, "Phone", 1, 0, 'C');
$pdf->write(10, "\n");
foreach ($getmed->result() as $row) {
$pdf->setFont('times', '', '15');
$pdf->cell(80, 10, $row->name, 1, 0, 'C');
$pdf->cell(40, 10, $row->room, 1, 0, 'C');
$pdf->cell(40, 10, $row->phone, 1, 0, 'C');
$pdf->write(10, "\n");
// $pdf -> cell(200,30,$row->room,1,1);
// $pdf -> cell(200,30,$row->phone,1,1);
}
}
$pdf->setFont('times', 'B', '20');
if (!$data['launil']) {
$pdf->write(10, "\nStudents Asked for Laundry Service\n\n");
$pdf->setFont('times', 'B', '15');
$pdf->cell(80, 10, "Name", 1, 0, 'C');
$pdf->cell(40, 10, "Room", 1, 0, 'C');
$pdf->cell(40, 10, "Phone", 1, 0, 'C');
$pdf->write(10, "\n");
foreach ($getlau->result() as $row) {
$pdf->setFont('times', '', '15');
$pdf->cell(80, 10, $row->name, 1, 0, 'C');
$pdf->cell(40, 10, $row->room, 1, 0, 'C');
$pdf->cell(40, 10, $row->phone, 1, 0, 'C');
$pdf->write(10, "\n");
// $pdf -> cell(200,30,$row->room,1,1);
// $pdf -> cell(200,30,$row->phone,1,1);
}
}
$pdf->output('service.pdf', 'D');
}