本文整理汇总了PHP中FPDF::Ln方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::Ln方法的具体用法?PHP FPDF::Ln怎么用?PHP FPDF::Ln使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDF
的用法示例。
在下文中一共展示了FPDF::Ln方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: exportpdf
public function exportpdf()
{
if ($this->data['users']->role != "admin") {
exit;
}
$header = array('Full Name', 'User Name', 'E-mail', 'Gender', 'Address', 'Phone No', 'Mobile No', 'Profession');
$data = array();
$student = User::where('role', 'parent')->get();
foreach ($student as $value) {
$data[] = array($value->fullName, $value->username, $value->email, $value->gender, $value->address, $value->phoneNo, $value->mobileNo, $value->parentProfession);
}
$pdf = new FPDF();
$pdf->SetFont('Arial', '', 10);
$pdf->AddPage();
foreach ($header as $col) {
$pdf->Cell(40, 7, $col, 1);
}
$pdf->Ln();
foreach ($data as $row) {
foreach ($row as $col) {
$pdf->Cell(40, 6, $col, 1);
}
$pdf->Ln();
}
$pdf->Output();
exit;
}
示例3: generarFolleto
public function generarFolleto()
{
$concursos = $this->concursoMapper->findConcurso("pinchosOurense");
$establecimientos = $this->establecimientoMapper->findAllValidados();
$pinchos = $this->pincho->all();
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 30);
$pdf->SetTextColor(85, 53, 20);
$pos_y = 10;
$pdf->Cell(0, 24, $concursos->getNombre(), 0, 0, "L");
$pdf->Ln();
$pdf->SetFont('Arial', '', 16);
$pdf->SetTextColor(0, 0, 0);
$pdf->MultiCell(0, 6, $concursos->getDescripcionConcurso(), 0, "L");
$pdf->SetTextColor(85, 53, 20);
$pdf->SetFont('Arial', 'B', 13);
$pdf->Cell(0, 24, "Establecimientos participantes", 0, 0, "L");
foreach ($establecimientos as $establecimiento) {
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 13);
$pdf->SetTextColor(85, 53, 20);
$pdf->SetFillColor(182, 145, 107);
$pdf->Cell(0, 10, utf8_decode($establecimiento->getNombre()), 1, 0, "C", "false");
$pdf->Ln();
$pdf->SetFont('Arial', 'I', 13);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(0, 10, utf8_decode($establecimiento->getDescripcion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, utf8_decode($establecimiento->getLocalizacion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, utf8_decode("Pincho:"), 0, 0, "L");
foreach ($pinchos as $pincho) {
if ($pincho->getEstablecimiento() == $establecimiento->getId()) {
$pdf->Ln();
$pdf->Cell(5);
$pdf->Cell(0, 10, utf8_decode($pincho->getNombre()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(5);
$pdf->Cell(0, 10, utf8_decode($pincho->getDescripcion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(5);
if ($pincho->isCeliaco()) {
$pdf->Cell(0, 10, utf8_decode("Apto para celiaco"), 0, 0, "L");
} else {
$pdf->Cell(0, 10, utf8_decode("No apto para celiaco"), 0, 0, "L");
}
}
}
$pdf->Ln(5);
}
$pdf->Output("folleto.pdf", "D");
}
示例4: create_matrix
public function create_matrix()
{
$matrix = array();
$position = '';
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 16);
$pdf->Cell(12, 10, ' ', 1, 0, 'C');
$pdf->Cell(12, 10, 'A', 1, 0, 'C');
$pdf->Cell(12, 10, 'B', 1, 0, 'C');
$pdf->Cell(12, 10, 'C', 1, 0, 'C');
$pdf->Cell(12, 10, 'D', 1, 0, 'C');
$pdf->Cell(12, 10, 'E', 1, 0, 'C');
$pdf->Cell(12, 10, 'F', 1, 0, 'C');
$pdf->Cell(12, 10, 'G', 1, 0, 'C');
$pdf->Cell(12, 10, 'H', 1, 0, 'C');
$pdf->Ln(10);
for ($i = 1; $i <= $this->rows; $i++) {
$letra = 'A';
$pdf->Cell(12, 10, $i, 1, 0, 'C');
for ($j = 0; $j < $this->cols; $j++) {
$matrix[$i][$j] = rand($this->min, $this->max);
$pdf->Cell(12, 10, $matrix[$i][$j], 1, 0, 'C');
$position .= $letra . $i . '-' . $matrix[$i][$j] . ';';
++$letra;
}
$pdf->Ln(10);
}
$pdf->Output('accessMatrix.pdf', 'D');
return $position;
}
示例5: EWD_UFAQ_Export_To_PDF
function EWD_UFAQ_Export_To_PDF()
{
require_once EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php';
if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {
$category_array = array('taxonomy' => 'ufaq-category', 'field' => 'slug', 'terms' => $Category->slug);
}
$params = array('posts_per_page' => -1, 'post_type' => 'ufaq');
$faqs = get_posts($params);
$PDFPasses = array("FirstPageRun", "SecondPageRun", "Final");
foreach ($PDFPasses as $PDFRun) {
$pdf = new FPDF();
$pdf->AddPage();
if ($PDFRun == "SecondPageRun" or $PDFRun == "Final") {
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(20, 10, "Page #");
$pdf->Cell(20, 10, "Article Title");
$pdf->Ln();
$pdf->SetFont('Arial', '', 12);
foreach ($ToC as $entry) {
$pdf->Cell(20, 5, " " . $entry['page']);
$pdf->MultiCell(0, 5, $entry['title']);
$pdf->Ln();
}
unset($ToC);
}
foreach ($faqs as $faq) {
$PostTitle = strip_tags(html_entity_decode($faq->post_title));
$PostText = strip_tags(html_entity_decode($faq->post_content));
$PostText = str_replace("[", "[", $PostText);
$PostText = str_replace("]", "]", $PostText);
$pdf->AddPage();
$Entry['page'] = $pdf->page;
$Entry['title'] = $PostTitle;
$pdf->SetFont('Arial', 'B', 15);
$pdf->MultiCell(0, 10, $PostTitle);
$pdf->Ln();
$pdf->SetFont('Arial', '', 12);
$pdf->MultiCell(0, 10, $PostText);
$ToC[] = $Entry;
unset($Entry);
}
if ($PDFRun == "FirstPageRun" or $PDFRun == "SecondPageRun") {
$pdf->Close();
}
if ($PDFRun == "Final") {
$pdf->Output('Ultimate-FAQ-Manual.pdf', 'D');
}
}
}
示例6: generarPDF
public function generarPDF($codigos, $estab)
{
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 16);
$pos_y = 10;
$pdf->Cell(0, 12, "Codigos para los pinchos de " . $estab, 0, 0, "C");
foreach ($codigos as $codigo) {
$pdf->Ln();
$pdf->Cell(0, 10, $codigo->getId(), 0, 0, "C");
}
$pdf->Output("codigos.pdf", "D");
}
示例7: execute
public function execute()
{
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont("helvetica", "B", 16);
$pdf->Cell(0, 10, "Hello world!", 0, 1);
$pdf->Ln();
$pdf->SetFont("helvetica", "", 12);
$pdf->SetFillColor(192, 192, 192);
$pdf->Cell(40, 10, "Back", 1, 0, "C", 1);
$pdf->Link(10, 30, 40, 10, "/demos");
$pdf->Output();
$this->output->disable();
}
示例8: PedidoPdf
/**
* Recibe un array con los datos del pedido otro con las lineas de dicho pedido y un booleano que le
* indica si el pdf es para mostrar o para enviar por correo y se encarga de rellenar el pdf con los datos recibidos
* @param type $pedido
* @param type $lineas
* @param type $enviar
*/
public function PedidoPdf($pedido, $lineas, $enviar = false)
{
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(40, 7, "Pedido: " . $pedido['idpedido'], 0);
$pdf->Cell(70, 7, "Estado: " . $pedido['estado_ped'], 0);
$pdf->Cell(70, 7, "Fecha: " . $pedido['fecha_pedido'], 0);
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Cell(70, 7, "Nombre del producto", 1);
$pdf->Cell(26, 7, "Cantidad", 1);
$pdf->Cell(40, 7, "Precio", 1);
$pdf->Cell(40, 7, "Precio Final *", 1);
$pdf->Ln();
foreach ($lineas as $linea) {
$pdf->Cell(70, 7, $linea['nombrepro'], 1);
$pdf->Cell(26, 7, $linea['cantidad'], 1);
$pdf->Cell(40, 7, $linea['preciopro'] . iconv('UTF-8', 'windows-1252', '€'), 1);
$pdf->Cell(40, 7, $linea['precio_ped'] . iconv('UTF-8', 'windows-1252', '€'), 1);
$pdf->Ln();
}
$pdf->Ln();
$pdf->Ln();
$pdf->Cell(100, 7, "Total del pedido: " . $pedido['total_ped'] . iconv('UTF-8', 'windows-1252', '€'), 1);
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Cell(100, 7, "* Impuestos y descuento aplicados ", 0);
if ($enviar == false) {
$pdf->Output();
} else {
$pdf->Output('F', 'asset/pedidocorreo/pedido.pdf', true);
}
}
示例9: initialize_pdf
/**
* Sets up a new PDF object with the necessary settings
*
* @return FPDF A new PDF object
*/
protected function initialize_pdf()
{
global $CFG;
require_once $CFG->libdir . '/fpdf/fpdf.php';
$newpdf = new FPDF('L', 'in', 'letter');
$newpdf->setMargins(self::marginx, self::marginy);
$newpdf->SetFont('Arial', '', 9);
$newpdf->AddPage();
$newpdf->SetFont('Arial', '', 16);
$newpdf->MultiCell(0, 0.2, $this->report->title, 0, 'C');
$newpdf->Ln(0.2);
$newpdf->SetFont('Arial', '', 8);
$newpdf->SetFillColor(225, 225, 225);
return $newpdf;
}
示例10: Header
function Header()
{
parent::SetFont($this->getFont(), '', 18);
$this->SetTextColor(255, 255, 255);
$this->SetFillColor($this->colorBackg[0], $this->colorBackg[1], $this->colorBackg[2]);
//Título
$tam = $this->w - 3;
$pX = ($this->w - $tam) / 2;
$this->SetX($pX);
parent::Cell($tam, 15, $this->getTitle(), 0, 0, 'R', true);
if ($this->getLogoHeader() != "") {
parent::Image($this->getLogoHeader(), $pX, 11, 40);
}
//Salto de línea
parent::Ln(20);
parent::SetFont($this->getFont(), '', 10);
}
示例11: createpdf
function createpdf($id_gr)
{
require '../fpdf/fpdf.php';
//permite criar uma font a partir das font do windows
//require('../fpdf/makefont/makefont.php');
//MakeFont('../fpdf/arial.ttf','iso-8859-1', true);
if (strpos($id_gr, '-') !== false) {
$grepdb = grepGetByGrNumber($id_gr);
} else {
$grepdb = grepGetById($id_gr);
}
//$grepdb = grepGetById($id_gr);
$pdf = new FPDF('P', 'mm', 'A4');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('arial', '', 12);
$pdf->Cell(0, 10, $pdf->Image('../images/eleclerc.jpg', 6, 10, 50), 0, 0, 'L');
//$pdf->Cell(0,10,utf8_decode('Guia de Reparação nº19') ,0 ,0 ,'R');
if ($grepdb['gr_number'] == "") {
$pdf->Cell(0, 10, utf8_decode('Guia de Reparação nº' . $grepdb['id']), 0, 0, 'R');
} else {
$pdf->Cell(0, 10, utf8_decode('Guia de Reparação nº' . $grepdb['gr_number']), 0, 0, 'R');
}
$pdf->Ln(15);
$pdf->Cell(155, 10, utf8_decode($_SESSION['morada_leclerc_pdf']), 0, 0, 'L');
$pdf->Cell(2, 10, utf8_decode('Data: ' . invertedatasemhora($grepdb['date_in'])), 0, 0, 'L');
$pdf->Ln(6);
$pdf->Cell(0, 10, utf8_decode($_SESSION['cod_postal_leclerc_pdf']), 0, 0, 'L');
$pdf->Ln(6);
$pdf->Cell(0, 10, utf8_decode('Tel: ' . $_SESSION['telefone_leclerc_pdf'] . ' Fax: ' . $_SESSION['fax_leclerc_pdf']), 0, 0, 'L');
$pdf->Ln(6);
$pdf->Cell(0, 10, utf8_decode($_SESSION['mail_leclerc_pdf']), 0, 0, 'L');
$pdf->Ln(6);
$pdf->Cell(0, 10, utf8_decode('NIF: ' . $_SESSION['nif_leclerc_pdf']), 0, 0, 'L');
//cliente
$pdf->Ln(15);
$pdf->SetFont('arial', '', 20);
$pdf->Cell(0, 10, utf8_decode('Cliente'), 0, 0, 'L');
$pdf->Ln(2);
$pdf->Cell(0, 10, utf8_decode('_______________________________________________'), 0, 0, 'L');
$pdf->Ln(10);
$pdf->SetFont('arial', '', 12);
$pdf->Cell(0, 10, utf8_decode('Nome: ' . $grepdb['cl_name']), 0, 0, 'L');
$pdf->Ln(10);
$pdf->Cell(0, 10, utf8_decode('Morada: ' . $grepdb['cl_morada']), 0, 0, 'L');
$pdf->Ln(10);
//o multicell permite ser só uma linha ou caso acaba a linha cria logo uma por baixo
$pdf->Cell(80, 10, utf8_decode('Localidade: ' . $grepdb['cl_localidade']));
$pdf->Cell(2, 10, utf8_decode('Cod. Postal: ' . codpostalToForm($grepdb['cl_codpostal'])));
$pdf->Ln(10);
$pdf->Cell(0, 10, utf8_decode('Contacto: ' . $grepdb['cl_telefone']), 0, 0, 'L');
$pdf->Ln(15);
$pdf->SetFont('arial', '', 20);
//artigo
$pdf->Cell(0, 10, utf8_decode('Artigo'), 0, 0, 'L');
$pdf->Ln(2);
$pdf->Cell(0, 10, utf8_decode('_______________________________________________'), 0, 0, 'L');
$pdf->Ln(10);
$pdf->SetFont('arial', '', 12);
$pdf->Cell(80, 10, utf8_decode('Marca: ' . $grepdb['art_marca']));
$pdf->Cell(2, 10, utf8_decode('Tipo: ' . $grepdb['art_type']));
$pdf->ln(10);
$pdf->Cell(80, 10, utf8_decode('Modelo: ' . $grepdb['art_modelo']));
$pdf->Cell(2, 10, utf8_decode('EAN: ' . $grepdb['art_ean']));
$pdf->ln(10);
$pdf->MultiCell(0, 10, utf8_decode('Nº Série: ' . $grepdb['art_numserie']));
$pdf->MultiCell(0, 10, utf8_decode('Anomalia: ' . $grepdb['art_anomalia']));
$pdf->MultiCell(0, 10, utf8_decode('Acessórios: ' . $grepdb['art_acessor']));
$pdf->MultiCell(0, 10, utf8_decode('Estética: ' . $grepdb['art_estetic']));
//$image_photo = $pdf->Image('../images/euro.jpg',$pdf->GetX(), $pdf->GetY(), 'R');
$pdf->Cell(80, 10, utf8_decode('Talão: ' . $grepdb['art_numtalao']));
$pdf->Cell(2, 10, utf8_decode('Valor: ' . $grepdb['art_valor']));
$pdf->Ln(10);
if ($grepdb['art_garantie'] == 1) {
$pdf->Cell(80, 10, utf8_decode('Garantia: Sim'));
$pdf->Cell(2, 10, utf8_decode('Data: ' . $grepdb['art_dategar']));
} else {
$pdf->Cell(0, 10, utf8_decode('Garantia: Não'), 0, 0, 'L');
}
$pdf->Ln(10);
if ($grepdb['art_orcamento'] == 1) {
$pdf->Cell(0, 10, utf8_decode('Orçamento: Sim'), 0, 0, 'L');
} else {
$pdf->Cell(0, 10, utf8_decode('Orçamento: Não'), 0, 0, 'L');
}
$pdf->Ln(20);
$pdf->Cell(20, 10, utf8_decode(' '));
$pdf->Cell(80, 10, utf8_decode('Assinatura Cliente:'));
$pdf->Cell(2, 10, utf8_decode('Assinatura Funcionário:'));
$pdf->Ln(20);
$pdf->Cell(20, 10, utf8_decode(' '));
$pdf->Cell(80, 10, utf8_decode('________________'));
$pdf->Cell(2, 10, utf8_decode('____________________'));
return $pdf;
}
示例12: fee_month
public function fee_month()
{
$date_from = $this->input->get("date_from");
$date_to = $this->input->get("date_to");
$event = $this->input->get("event");
require_once "../assets/fpdf/fpdf.php";
$pdf = new FPDF();
$pdf->AliasNbPages();
$pdf->AddPage('L', 'A4');
//title
$pdf->SetFont('Arial', 'B', 16);
$pdf->Cell(0, 10, 'Report Absensi Moderasi HM Sampoerna', 0, 0, 'C');
$pdf->Ln(10);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(0, 5, 'Periode Tanggal : ' . $date_from . ' s/d ' . $date_to, 0, 0, 'C');
$pdf->Ln(5);
$pdf->Cell(0, 5, 'Event : ' . $this->event_model->get_event_name($this->input->get("event")), 0, 0, 'L');
$pdf->Ln(10);
//header
$pdf->SetFont('Arial', 'B', 8);
$pdf->SetDrawColor(0, 0, 0);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(10, 14, 'No', 1, 0, 'C');
$pdf->Cell(40, 14, 'Moderator', 1, 0, 'C');
$from = date_create(format_ymd($date_from));
$to = date_create(format_ymd($date_to));
$j = 0;
while ($from <= $to) {
$pdf->SetXY(60 + $j, 35);
$pdf->Cell(6, 7, date_format($from, "d"), 1, 0, 'C');
$pdf->SetXY(60 + $j, 42);
$pdf->Cell(6, 7, date_format($from, "m"), 1, 0, 'C');
date_add($from, date_interval_create_from_date_string('1 days'));
$j += 6;
}
$pdf->SetXY($j + 60, 35);
$pdf->Cell(0, 14, 'Jumlah', 1, 0, 'C');
$pdf->Ln(14);
//rows
$pdf->SetFont('Arial', '', 8);
$pdf->SetDrawColor(0, 0, 0);
$pdf->SetTextColor(0, 0, 0);
$result = $this->user_event_model->get_user_month()->result();
$total = 0;
$i = 1;
$j = 0;
foreach ($result as $r) {
$pdf->Cell(10, 7, $i++, 1, 0, 'C');
$pdf->Cell(40, 7, $r->user, 1, 0, 'L');
$from = date_create(format_ymd($date_from));
$to = date_create(format_ymd($date_to));
$j = 0;
$jum = 0;
while ($from <= $to) {
$jumlah = $this->absent_model->check_exist_month($r->user_kode, $event, date_format($from, 'Y-m-d'));
$pdf->Cell(6, 7, number_format($jumlah), 1, 0, 'C');
$jum += $jumlah;
date_add($from, date_interval_create_from_date_string('1 days'));
$j++;
}
$pdf->Cell(0, 7, number_format($jum), 1, 0, 'C');
$total += $jum;
$pdf->Ln(7);
}
$pdf->SetFillColor(240, 240, 240);
$pdf->SetFont('Arial', 'B', 8);
$pdf->Cell(50 + 6 * $j, 7, 'Total : ', 1, 0, 'R', true);
$pdf->Cell(0, 7, number_format($total), 1, 0, 'C', true);
$pdf->SetFont('Arial', '', 10);
$this->_footer($pdf);
$pdf->Output("Fee Moderasi HM Sampoerna", "I");
}
示例13: FPDF
//header('Content-disposition: attachment; filename='.$solicitud.'.pdf');
//header('Content-type: application/pdf');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 10);
$url = base_url();
$INC_DIR = $url . "img/";
$pdf->Image($INC_DIR . 'logo.png', 10, 6, 40);
//$pdf->Image('img/logo.png',10,6,40);
$pdf->SetFont('Arial', 'B', 15);
$pdf->Cell(80);
$pdf->Cell(30, 8, "Gracias por preferirnos", 0, 0, 'C');
$pdf->SetY(35);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(189, 8, utf8_decode('De acuerdo a su solicitud, a continuación le presentamos su propuesta.'), 0, 1, 'L');
$pdf->Ln(3);
$pdf->Cell(189, 8, utf8_decode('Propuesto asegurado: ' . $nombre), 1, 1, 'L');
$pdf->Cell(189, 8, utf8_decode('Teléfono: ' . $telefono), 1, 1, 'L');
$pdf->Cell(189, 8, utf8_decode('Celular: ' . $celular), 1, 1, 'L');
$pdf->Cell(189, 8, utf8_decode('Correo Electrónico: ' . $email), 1, 1, 'L');
$pdf->Cell(189, 8, utf8_decode('Cédula: ' . $cedula), 1, 1, 'L');
$pdf->Ln(3);
$pdf->Cell(189, 8, utf8_decode("Compañía de seguros: " . $company . ""), 1, 1, 'L');
$pdf->Ln(5);
$pdf->SetTextColor(255, 0, 0);
$pdf->Cell(59, 5, utf8_decode("Cotización No.: " . $solicitud . ""), 1, 0, 'C');
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(65, 5, utf8_decode('Ramo: AUTO'), 1, 0, 'C');
$pdf->Cell(65, 5, utf8_decode("Fecha: " . $fecha_solicitud . ""), 1, 1, 'C');
$pdf->Ln(5);
$pdf->SetTextColor(0, 102, 204);
示例14: generatePDFReport
function generatePDFReport($report, $results)
{
$types = self::get_report_column_types($report->getId());
eval('$managerInstance = ' . $report->getObjectType() . "::instance();");
$externalCols = $managerInstance->getExternalColumns();
$filename = str_replace(' ', '_', $report->getName()) . date('_YmdHis');
$pageLayout = $_POST['pdfPageLayout'];
$fontSize = $_POST['pdfFontSize'];
include_once LIBRARY_PATH . '/pdf/fpdf.php';
$pdf = new FPDF($pageLayout);
$pdf->setTitle($report->getName());
$pdf->AddPage();
$pdf->SetFont('Arial', '', $fontSize);
$pdf->Cell(80);
$report_title = iconv(mb_internal_encoding(), "ISO-8859-1", html_entity_decode($report->getName(), ENT_COMPAT));
$pdf->Cell(30, 10, $report_title);
$pdf->Ln(20);
$colSizes = array();
$maxValue = array();
$fixed_col_sizes = array();
foreach ($results['rows'] as $row) {
$i = 0;
foreach ($row as $k => $value) {
if (!isset($maxValue[$i])) {
$maxValue[$i] = '';
}
if (strlen(strip_tags($value)) > strlen($maxValue[$i])) {
$maxValue[$i] = strip_tags($value);
}
$i++;
}
}
$k = 0;
foreach ($maxValue as $str) {
$col_title_len = $pdf->GetStringWidth($results['columns'][$k]);
$colMaxTextSize = max($pdf->GetStringWidth($str), $col_title_len);
$db_col = $results['columns'][$k];
$colType = array_var($types, array_var($results['db_columns'], $db_col, ''), '');
if ($colType == DATA_TYPE_DATETIME && !($report->getObjectType() == 'ProjectEvents' && $results['db_columns'][$db_col] == 'start')) {
$colMaxTextSize = $colMaxTextSize / 2;
if ($colMaxTextSize < $col_title_len) {
$colMaxTextSize = $col_title_len;
}
}
$fixed_col_sizes[$k] = $colMaxTextSize;
$k++;
}
$fixed_col_sizes = self::fix_column_widths($pageLayout == 'P' ? 172 : 260, $fixed_col_sizes);
$max_char_len = array();
$i = 0;
foreach ($results['columns'] as $col) {
$colMaxTextSize = $fixed_col_sizes[$i];
$colFontSize = $colMaxTextSize + 5;
$colSizes[$i] = $colFontSize;
$col_name = iconv(mb_internal_encoding(), "ISO-8859-1", html_entity_decode($col, ENT_COMPAT));
$pdf->Cell($colFontSize, 7, $col_name);
$max_char_len[$i] = self::get_max_length_from_pdfsize($pdf, $colFontSize);
$i++;
}
$lastColX = $pdf->GetX();
$pdf->Ln();
$pdf->Line($pdf->GetX(), $pdf->GetY(), $lastColX, $pdf->GetY());
foreach ($results['rows'] as $row) {
$i = 0;
$more_lines = array();
$col_offsets = array();
foreach ($row as $k => $value) {
if ($k == 'link') {
$value = strip_tags($value);
$cell = $value;
} else {
$cell = $this->format_value_to_print($k, $value, $types[$k], $report->getObjectType());
}
$cell = iconv(mb_internal_encoding(), "ISO-8859-1", html_entity_decode($cell, ENT_COMPAT));
$splitted = self::split_column_value($cell, $max_char_len[$i]);
$cell = $splitted[0];
if (count($splitted) > 1) {
array_shift($splitted);
$ml = 0;
foreach ($splitted as $sp_val) {
if (!isset($more_lines[$ml]) || !is_array($more_lines[$ml])) {
$more_lines[$ml] = array();
}
$more_lines[$ml][$i] = $sp_val;
$ml++;
}
$col_offsets[$i] = $pdf->x;
}
$pdf->Cell($colSizes[$i], 7, $cell);
$i++;
}
foreach ($more_lines as $ml_values) {
$pdf->Ln();
foreach ($ml_values as $col_idx => $col_val) {
$pdf->SetX($col_offsets[$col_idx]);
$pdf->Cell($colSizes[$col_idx], 7, $col_val);
}
}
$pdf->Ln();
$pdf->SetDrawColor(220, 220, 220);
//.........这里部分代码省略.........
示例15: RelacaoMedicamento
public function RelacaoMedicamento($arrValues, $type)
{
$pdf = new FPDF("P", "pt", "A4");
$pdf->AddPage();
$pdf->SetFont('arial', 'B', 13);
$pdf->Cell(0, 5, utf8_decode("Relacionamento de medicamento x idosos"), 0, 1, 'C');
$pdf->Cell(0, 5, "", "B", 1, 'C');
$pdf->Ln(10);
$pdf->SetFont('arial', 'B', 11);
$Product = new Produto();
$row = $Product->getProdutoById($arrValues['medicamento']);
$pdf->Cell(300, 20, "Medicamento - " . $row['NMPRODUTO'], 1, 0, "L");
$pdf->Cell(100, 20, utf8_decode('Sim/Não'), 1, 0, "L");
$pdf->SetFont('arial', '', 10);
$pdf->Ln();
$Cliente = new Clientes();
foreach ($arrValues['relacoes'] as $value) {
$row = $Cliente->getIdodosById($value);
$pdf->Cell(300, 20, utf8_decode($row['NMCLIENTE']), 1, 0, "L");
$pdf->Cell(100, 20, 'Sim', 1, 0, "L");
$pdf->Ln();
}
$pdf->Output(self::getNameRel(), $type);
}