本文整理匯總了PHP中FPDF::PageNo方法的典型用法代碼示例。如果您正苦於以下問題:PHP FPDF::PageNo方法的具體用法?PHP FPDF::PageNo怎麽用?PHP FPDF::PageNo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FPDF
的用法示例。
在下文中一共展示了FPDF::PageNo方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PurchaseOrderModel
function export_order($id)
{
global $FANNIE_OP_DB, $FANNIE_ROOT;
$dbc = FannieDB::get($FANNIE_OP_DB);
$order = new PurchaseOrderModel($dbc);
$order->orderID($id);
$order->load();
$items = new PurchaseOrderItemsModel($dbc);
$items->orderID($id);
$vendor = new VendorsModel($dbc);
$vendor->vendorID($order->vendorID());
$vendor->load();
$contact = new VendorContactModel($dbc);
$contact->vendorID($order->vendorID());
$contact->load();
if (!class_exists('FPDF')) {
include_once $FANNIE_ROOT . 'src/fpdf/fpdf.php';
}
$pdf = new FPDF('P', 'mm', 'Letter');
$pdf->AddPage();
$pdf->SetFont('Arial', '', '12');
$pdf->Cell(100, 5, 'Vendor: ' . $vendor->vendorName(), 0, 0);
$pdf->Cell(100, 5, 'Date: ' . date('Y-m-d'), 0, 0);
$pdf->Ln();
$pdf->Cell(100, 5, 'Phone: ' . $contact->phone(), 0, 0);
$pdf->Cell(100, 5, 'Fax: ' . $contact->fax(), 0, 0);
$pdf->Ln();
$pdf->Cell(100, 5, 'Email: ' . $contact->email(), 0, 0);
$pdf->Cell(100, 5, 'Website: ' . $contact->website(), 0, 0);
$pdf->Ln();
$pdf->MultiCell(0, 5, "Ordering Info:\n" . $contact->notes(), 'B');
$pdf->Ln();
$cur_page = 0;
$pdf->SetFontSize(10);
foreach ($items->find() as $obj) {
if ($cur_page != $pdf->PageNo()) {
$cur_page = $pdf->PageNo();
$pdf->Cell(25, 5, 'SKU', 0, 0);
$pdf->Cell(20, 5, 'Order Qty', 0, 0);
$pdf->Cell(30, 5, 'Brand', 0, 0);
$pdf->Cell(65, 5, 'Description', 0, 0);
$pdf->Cell(20, 5, 'Case Size', 0, 0);
$pdf->Cell(20, 5, 'Est. Cost', 0, 0);
$pdf->Ln();
}
$pdf->Cell(25, 5, $obj->sku(), 0, 0);
$pdf->Cell(20, 5, $obj->quantity(), 0, 0, 'C');
$pdf->Cell(30, 5, $obj->brand(), 0, 0);
$pdf->Cell(65, 5, $obj->description(), 0, 0);
$pdf->Cell(20, 5, $obj->caseSize(), 0, 0, 'C');
$pdf->Cell(20, 5, sprintf('%.2f', $obj->caseSize() * $obj->unitCost() * $obj->quantity()), 0, 0);
$pdf->Ln();
}
$pdf->Output('order_export.pdf', 'D');
}
示例2: FPDF
{
//Posición: a 1,5 cm del final
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Número de página
$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
}
}
//$pdf->FPDF('P','mm','A4');
$pdf = new FPDF('P', 'cm', 'custom', 300.28, 458.92);
//ingreso medida puntos
//$pdf->Open();
$pdf->AliasNbPages();
$pdf->SetLeftMargin(0.7);
$pdf->PageNo();
$pdf->SetTopMargin(5);
$pdf->SetAutoPageBreak(0.6);
$pdf->AddPage();
$pdf->SetFont('Arial', '', 9);
$venta->ventas_ver($_REQUEST['venta']);
$nro_documento = $venta->ven_nrodoc;
$cliente_nombre = $venta->cli_razonsocial;
$cliente_direccion = $venta->cli_direccion;
$cliente_ruc = $venta->cli_ruc;
$e_fecha = $venta->_util->obtiene_fecha($venta->ven_fecha);
$fecha = explode("/", $e_fecha);
//si fecha esta en formato dia-mes-año
$dia = $fecha[0];
$mes = $venta->_util->ver_nombre_mes($fecha[1]);
$mes_numero = substr($fecha[3], 2);
示例3: sprintf
$pdf->Image('./img/acb_logo_gross.jpg', 95, 10, 25);
// Position auf der X- und Y-Achse
$pdf->SetY(40);
// Schriftart festlegen
$pdf->SetFont('Times', 'BU', 14);
$pdf->Cell(160, 7, utf8_decode('Telefonnummern der Flugleiter/-innen, Aero-Club Butzbach e.V.'), 0, 1, 'C');
// Schriftart festlegen
$pdf->SetFont('Times', '', 11);
$pdf->Cell(160, 5, sprintf(utf8_decode('Stand: %s %d'), utf8_decode($_monate[date('n')]), date('Y')), 0, 1, 'C');
// Position auf der X- und Y-Achse
$pdf->SetXY(20, 280);
// Schriftart und -farbe ändern
$pdf->SetTextColor(128, 128, 128);
$pdf->SetFont('Times', '', 8);
// Ausgabe des Fusszeilentext
$pdf->Cell(0, 10, 'Seite ' . $pdf->PageNo() . ' von {nb}', 0, 0, 'C');
// Position auf der X- und Y-Achse
$x = 20;
$y = 63;
// alle Flugleiter des Vereins ermitteln
$data = getFlugleiterliste();
// Schriftfarbe setzen
$pdf->SetTextColor(0, 0, 0);
foreach ($data as $mitglied) {
// Schriftart festlegen
$pdf->SetFont('Times', 'B', 11);
// Schriftfarbe setzen
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY($x, $y);
$pdf->Write(5, utf8_decode(mb_strtoupper($mitglied['nachname'], 'UTF-8')));
if ($mitglied['fl_dienst_wochentags'] == 'J') {
示例4:
$pdf->Cell(40, 5, "Mata Pelajaran", 1, 0, 'C', true);
$pdf->Cell(20, 5, "Kelas", 1, 0, 'C', true);
$pdf->Cell(30, 5, "Nilai Akhir", 1, 0, 'C', true);
$pdf->Cell(30, 5, "Predikat (NA)", 1, 0, 'C', true);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetTextColor(0, 0, 0);
//membuat halaman
$no = 1;
//fungsi mengatur dan posisi table x dan y
$pdf->SetXY(15, 65);
//membuat baris tabel
while (list($kd_mapel, $mapel, $kelas, $nilai) = mysql_fetch_row($hasilnya2)) {
$pdf->Cell(10, 5, $no, 1, 0, 'C');
$pdf->Cell(40, 5, $kd_mapel, 1, 0, 'C');
$pdf->Cell(40, 5, $mapel, 1, 0, 'C');
$pdf->Cell(20, 5, $kelas, 1, 0, 'C');
$pdf->Cell(30, 5, $nilai, 1, 0, 'C');
$pdf->Cell(30, 5, $nilai, 1, 0, 'C');
$y = 65 + 5 * $no;
$no++;
$pdf->SetXY(15, $y);
}
//fungsi show halaman
$pdf->SetY(-15);
//buat garis horizontal
$pdf->Line(7, $pdf->GetY(), 200, $pdf->GetY());
//Arial italic 9
$pdf->SetFont('Arial', 'I', 7);
//nomor halaman
$pdf->Cell(0, -10, 'Halaman ' . $pdf->PageNo() . ' dari {nb}', 0, 0, 'R');
$pdf->Output();
示例5: xml2pdf
//.........這裏部分代碼省略.........
if ($scale->length) {
$footer = $xpath->query('//footer');
$footer = $footer->length ? $footer->item(0) : NULL;
$no_brake = $xpath->query('//nobreak');
$no_brake = $no_brake->length ? TRUE : FALSE;
// если есть теги <nobreak>, то расставляем разрывы страниц руками
if ($no_brake) {
$pdf->SetAutoPageBreak(false);
}
$last_y = 0;
$pages = array();
foreach ($scale as $node) {
$last_y = intval($pdf->y);
if ($node->tagName == 'nobreak' && $node->getAttribute('start')) {
$max_h = $last_y;
$loc_offset = 0;
foreach ($xpath->query('//cell|locate[(following::nobreak)]') as $i => $nd) {
if ($nd->tagName == 'nobreak' && $node->getAttribute('end')) {
break;
}
$_h = $nd->getAttribute('height');
if ($i > 0 && !$loc_offset) {
$_h = 0;
}
$max_h += intval($_h);
$loc_offset = $nd->getAttribute('x_offset');
}
$max_h += $last_y;
if ($max_h > $printable) {
if ($footer) {
$pdf->SetY(-20);
$pdf->SetFont($font_name, '', 9);
$pdf->Cell(0, 10, self::prepareNodeText($footer), 0, 0, 'C');
$pages[] = $pdf->PageNo();
}
$pdf->AddPage();
}
}
if ($no_brake && $pdf->y > $printable) {
if ($footer && !in_array($pdf->PageNo(), $pages)) {
$pdf->SetY(-20);
$pdf->SetFont($font_name, '', 9);
$pdf->Cell(0, 10, self::prepareNodeText($footer), 0, 0, 'C');
$pages[] = $pdf->PageNo();
}
$pdf->AddPage();
}
if (!(int) $node->getAttribute('keep-pos')) {
$pdf->SetX($margin_left);
}
// сброс позиции по X-оси если <node keep-pos="0" или не задан
if ((int) $node->getAttribute('offset-left')) {
$pdf->SetX((int) $node->getAttribute('offset-left') + $margin_left);
}
if ($node->tagName == 'text') {
// вывод строки
if ($node->getAttribute('font-name')) {
$font_name = $node->getAttribute('font-name');
}
if ((int) $node->getAttribute('font-size')) {
$font_size = (int) $node->getAttribute('font-size');
}
$align = $node->getAttribute('align') ? strtoupper($node->getAttribute('align')) : 'C';
$width = (int) $node->getAttribute('width') ? (int) $node->getAttribute('width') : $text_width;
$height = (int) $node->getAttribute('height') ? (int) $node->getAttribute('height') : 5;
$border = $node->getAttribute('border') ? strtoupper($node->getAttribute('border')) : 0;
示例6: FPDF
<?php
require_once 'fpdf16/fpdf.php';
$pdf = new FPDF('P', 'cm', 'A4');
$pdf->SetFont('Arial', '', 12);
$pdf->AliasNbPages('{nb}');
$pdf->AddPage();
$pdf->Write(1, 'Texto de teste');
$pdf->Ln(1);
$pdf->Write(1, utf8_decode('Página Atual: ' . $pdf->PageNo()));
$pdf->Ln(1);
$pdf->Write(1, utf8_decode(' Total de páginas: {nb}'));
$pdf->AddPage();
$pdf->Write(1, 'Texto de teste');
$pdf->Output('/tmp/teste.pdf');
示例7: trim
$vd2 = @$vd + $vd1;
$vs2 = @$vs + $vs1;
$vt2 = @$vt + $vt1;
$vi2 = @$vi + $vi1;
$pdf->ln(10);
$pdf->Setx(5);
$pdf->Cell(137, 5, "QUANTIDADE DE ITENS: " . $qtotal, 1, 0, "L", 0);
$pdf->Cell(29, 5, trim(db_formatar($vs2, 'f')), 1, 0, "R", 0);
$pdf->Cell(25, 5, trim(db_formatar($vd2, 'f')), 1, 0, "R", 0);
$pdf->Cell(25, 5, trim(db_formatar($vb2, 'f')), 1, 0, "R", 0);
$pdf->Cell(10, 5, "", 1, 0, "C", 0);
$pdf->Cell(25, 5, db_formatar($vi2, 'f'), 1, 0, "R", 0);
$pdf->Cell(10, 5, "", 1, 0, "C", 0);
$pdf->Cell(25, 5, db_formatar($vt2, 'f'), 1, 1, "R", 0);
$y = $pdf->GetY();
$pdf->SetY($y + 3);
$pdf->Setx(5);
// if(!isset($DB_mens1)){
// $DB_mens1 = "";
// }
db_mensagem("issqnplan_cad", "issqnplan_rod");
$pdf->SetFont('Courier', '', 7);
// $pdf->Cell(140,4,"Data: ".db_formatar(date("Y-m-d"),'d'),0,1,"L",0);
$pdf->Cell(140, 4, "Local e Data: {$munic} " . db_formatar(date("Y-m-d"), 'd'), 0, 1, "L", 0);
$pdf->MultiCell(260, 4, $DB_mens1, 0, "L", 0);
$pdf->SetY(-26);
$pdf->Setx(5);
$pdf->SetFont('Courier', 'B', 9);
$pdf->Cell(170, 5, $DB_mens2, 0, 0, "L", 0);
$pdf->Cell(110, 5, "Página " . $pdf->PageNo() . " de {nb} ", 0, 0, "C", 0);
$pdf->Output();
示例8: array
}
$pdf->Ln();
$respUsuario = $cp->ejecutarSentencia(DBSentencias::BUSCAR_USUARIO_ID, array($idUsuario));
$usuarios = $respUsuario->fetchAll(PDO::FETCH_ASSOC);
foreach ($usuarios as $usuario) {
$pdf->SetFont('Arial', 'B', '20');
$pdf->SetFillColor(254, 254, 254);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(150, 15, "USUARIO QUE REALIZO LA CARGA", 1, 0, 'C', true);
$pdf->Ln();
$pdf->SetFont('Arial', '', '16');
$pdf->SetFillColor(229, 229, 229);
$pdf->SetTextColor(3, 3, 3);
$pdf->Cell(50, 15, utf8_decode($usuario['nombre_usuario']), 1, 0, 'C', true);
$pdf->Cell(50, 15, utf8_decode($usuario['apellido_usuario']), 1, 0, 'C', true);
$pdf->Cell(50, 15, utf8_decode($usuario['usuario_usuario']), 1, 0, 'C', true);
$pdf->Ln();
}
$consultaUsuarios = $cp->ejecutarSentencia(DBSentencias::BUSCAR_USUARIO_ID, array($idUsuario));
$usuarios = $consultaUsuarios->fetchAll(PDO::FETCH_ASSOC);
foreach ($usuarios as $usuarioF) {
$usuario = $usuarioF['usuario_usuario'];
}
// Posición: a 1,5 cm del final
$pdf->SetY(380);
// Arial italic 8
$pdf->SetFont('Arial', 'I', 12);
// Número de página
$pdf->Cell(0, 10, 'Practica Profesional Guirao Lazarte Bilyk--Pagina ' . $pdf->PageNo() . ' Usuario: ' . $usuario, 0, 0, 'C');
$pdf->Output();
}
示例9: foreach
$fpdf->Cell(8,7,"MANZANO", 1,0,'C',True);
$fpdf->Cell(5,7,"LOTE", 1,0,'C',True);
//FECHAS EXTREMAS
$fpdf->Cell(15,7,"FECHA INICIAL", 1,0,'C',True);
$fpdf->Cell(15,7,"FECHA FINAL", 1,0,'C',True);
//UBICACION FISICA
$fpdf->Cell(8,7,"AMBIENTE", 1,0,'C',True);
$fpdf->Cell(8,7,"ESTANTE", 1,0,'C',True);
$fpdf->Cell(7,7,"CUERPO", 1,0,'C',True);
$fpdf->Cell(7,7,"BALDA", 1,0,'C',True);
//AREA
$fpdf->Cell(15,7,"PRODUCTOR", 1,0,'C',True);
$fpdf->Cell(15,7,"OBSERVACION", 1,0,'C',True);
$fpdf->Ln();*/
/*$fpdf->SetFont('Arial', '', 6);
$counter=1;
foreach ($archivo as $valor) {
$fpdf->Cell(8, 4, $counter++, 0);
$fpdf->Cell(12, 4, $valor->ref_arc, 0);
$fpdf->Cell(45, 4, $valor->ncj_arc, 0);
$fpdf->Cell(35, 4, $valor->ntm_arc, 0);
$fpdf->Cell(40, 4, $valor->foj_arc, 0);
$fpdf->Cell(30, 4, $valor->cub_arc, 0);
$fpdf->Ln();
$fpdf->PageNo();
}*/
$fpdf->SetY(-15);
$fpdf->SetFont('Arial', 'I', 8);
$fpdf->Cell(0, 10, utf8_decode('Página ') . $fpdf->PageNo() . ' de {nb}', 0, 0, 'C');
//finaliza y muestra en pantalla pdf
$fpdf->Output($nombre . ".pdf", "I");
示例10: 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);
}
}
示例11: pdf
/**
* muestra el pdf del pedido en cuestion
* @param type $idPedido
*/
function pdf($idPedido)
{
$metodo = 'F';
$datosPedido = $this->Tienda_model->datosPedido($idPedido);
$email = $this->session->userdata('username');
$datos = $this->Usuarios_model->getUsuario($email);
$lineas = $this->Tienda_model->getLinea($idPedido);
//nos falta el nombre del libro para ello deberemos consultar su nombre por cada uno
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 20);
//cabecera
$pdf->Image(base_url() . 'Assets/img/logo.png', 10, 8, 100);
$pdf->Cell(60);
$pdf->Cell(80, 100, 'PEDIDO');
$pdf->Ln(15);
$pdf->Cell(100, 100, 'Datos cliente');
$pdf->Cell(40, 100, 'Datos librosweb');
$pdf->Ln(8);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(100, 100, 'Cliente: ' . $datos['username'] . ' ' . $datos['apellidos']);
$pdf->Cell(40, 100, 'Librosweb');
$pdf->Ln(5);
$pdf->Cell(100, 100, utf8_decode('Dirección: ' . $datos['direccion']));
$pdf->Cell(40, 100, 'Avda Europa, Parcela 2-5 y 2-6');
$pdf->Ln(5);
$pdf->Cell(100, 100, utf8_decode('Población: ' . $datos['provincia'] . ' ' . $datos['cp']));
$pdf->Cell(40, 100, 'Murcia');
$pdf->Ln(5);
$pdf->Cell(100, 100, utf8_decode('NIF/CIF: ' . $datos['dni']));
$pdf->Cell(40, 100, 'CIF: B-73347494');
$pdf->Ln(65);
//Datos
$header = array('LIBRO', 'PRECIO', 'IVA', 'CANTIDAD', 'TOTAL');
$w = array(83, 25, 22, 35, 25);
for ($i = 0; $i < count($header); $i++) {
$pdf->Cell($w[$i], 7, utf8_decode($header[$i]), 1, 0, true);
}
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 10);
// Datos
foreach ($lineas as $linea) {
$titulo = $this->Tienda_model->datos_libro($linea['producto_idproducto']);
$cantidad = $linea['cantidad'] * $linea['precio'];
$pdf->Cell(83, 40, utf8_decode($titulo['nombre']), 1);
$pdf->Cell(25, 40, utf8_decode($linea['precio']) . " " . iconv('UTF-8', 'windows-1252', '€'), 1);
$pdf->Cell(22, 40, utf8_decode('21%'), 1);
$pdf->Cell(35, 40, utf8_decode($linea['cantidad']), 1);
$pdf->Cell(25, 40, utf8_decode($cantidad) . " " . iconv('UTF-8', 'windows-1252', '€'), 1);
$pdf->Ln();
if ($pdf->GetY() > 264) {
$pdf->AddPage();
}
}
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(40, 40, 'El importe total del pedido es de: ' . $datosPedido['importe'] . " " . iconv('UTF-8', 'windows-1252', '€'));
//pie
$pdf->SetY(-15);
$pdf->Cell(0, 10, 'Page ' . $pdf->PageNo() . '/{nb}', 0, 0, 'C');
$pdf->Output($metodo, 'Assets/img/' . $idPedido . 'pedido.pdf', true);
}