public function drawPDF() { $pdf = new \FPDF('L', 'mm', 'Letter'); $pdf->SetMargins(3.175, 3.175, 3.175); $pdf->SetAutoPageBreak(false); if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) { $this->font = 'Gill'; $this->alt_font = 'GillBook'; define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/'); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); } $pdf->SetFont($this->font, '', 16); $data = $this->loadItems(); $width = 136.52; $height = 105; $top = 90; $left = 15; $effective_width = $width - 2 * $left; foreach ($data as $item) { $pdf->AddPage(); $column = 1; // right aligned $price = $this->printablePrice($item); $pdf->SetXY($left + $width * $column, $top); $pdf->SetFontSize($this->SMALL_FONT); $pdf->Cell($effective_width, 10, $item['brand'], 0, 1, 'C'); $pdf->SetX($left + $width * $column); $pdf->SetFontSize($this->MED_FONT); $pdf->MultiCell($effective_width, 12, $item['description'], 0, 'C'); $pdf->SetX($left + $width * $column); $pdf->SetFontSize($this->BIG_FONT); $pdf->Cell($effective_width, 25, $price, 0, 1, 'C'); $y_pos = $pdf->GetY(); if ($item['startDate'] != '' && $item['endDate'] != '') { // intl would be nice $datestr = $this->getDateString($item['startDate'], $item['endDate']); $pdf->SetXY($left + $width * $column, $top + ($height - 40)); $pdf->SetFontSize($this->SMALL_FONT); $pdf->Cell($effective_width, 20, $datestr, 0, 1, 'R'); } if ($item['originName'] != '') { $pdf->SetXY($left + $width * $column, $y_pos); $pdf->SetFontSize($this->SMALL_FONT); if (strlen($item['originName']) < 50) { $pdf->Cell($effective_width, 20, $item['originName'], 0, 1, 'L'); } else { $pdf->Cell($effective_width, 20, $item['originShortName'], 0, 1, 'L'); } } } $pdf->Output('WfcProdSingle.pdf', 'I'); }
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"); }
private function generate_pdf($srcText, $dest) { // Set some document variables $author = ""; $x = 50; $text = "<<<EOT" . $srcText . "EOT"; // Create fpdf object $pdf = new FPDF('P', 'pt', 'Letter'); // Set base font to start $pdf->SetFont('Times', 'B', 24); // Add a new page to the document $pdf->addPage(); // Set the x,y coordinates of the cursor $pdf->SetXY($x, 50); // Write 'Simple PDF' with a line height of 1 at the current position $pdf->Write(25, 'Simple PDF'); // Reset the font $pdf->SetFont('Courier', 'I', 10); // Set the font color $pdf->SetTextColor(255, 0, 0); // Reset the cursor, write again. $pdf->SetXY($x, 75); $pdf->Cell(0, 11, "By: {$author}", 'B', 2, 'L', false); // Place an image on the pdf document //$pdf->Image('graph.jpg', $x, 100, 150, 112.5, 'JPG'); // Reset font, color, and coordinates $pdf->SetFont('Arial', '', 12); $pdf->SetTextColor(0, 0, 0); $pdf->SetXY($x, 250); // Write out a long text blurb. $pdf->write(13, $srcText); // echo "<pre>"; // print_r($pdf);exit; $fileName = substr($dest, 0, strpos($dest, '.')) . "_" . time() . '.pdf'; $pdf->Output($fileName, 'F'); }
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; }
function preprocess() { if (FormLib::get_form_value('start', False) !== False) { $pdf = new FPDF('P', 'in', 'Letter'); $pdf->SetMargins(0.5, 0.5, 0.5); $pdf->SetAutoPageBreak(False, 0.5); $pdf->AddPage(); $start = FormLib::get_form_value('start'); $x = 0.5; $y = 0.5; $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $pdf->SetFont('Gill', '', 16); for ($i = 0; $i < 40; $i++) { $current = $start + $i; $pdf->SetXY($x, $y); $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C'); $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C'); if ($i % 2 == 0) { $x += 1.75 * 2 + 0.5; } else { $x = 0.5; $y += 0.5; } } $pdf->Close(); $pdf->Output("mem stickers {$start}.pdf", "I"); return False; } return True; }
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; } }
public function post_id_handler() { if (!is_array($this->id)) { $this->id = array($this->id); } $today = date("F j, Y"); $pdf = new FPDF('L', 'in', array(3.5, 5.0)); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $primary = ""; $pdf->SetAutoPageBreak(true, 0); $pdf->SetFont("Gill", "", 10); //Meat of the statement foreach ($this->id as $card_no) { $account = \COREPOS\Fannie\API\member\MemberREST::get($card_no); $pdf->AddPage(); $pdf->SetXY(3.0, 1.45); foreach ($account['customers'] as $c) { if ($c['accountHolder']) { $pdf->Cell(2, 0.25, $c['firstName'] . ' ' . $c['lastName'], "", 1, "L"); break; } } $pdf->SetX(3.0); $pdf->Cell(2, 0.25, $account['addressFirstLine'], "", 1, "L"); if ($account['addressSecondLine']) { $pdf->SetX(3.0); $pdf->Cell(2, 0.25, $account['addressSecondLine'], "", 1, "L"); } $pdf->SetX(3.0); $str = $account['city'] . ", " . $account['state'] . " " . $account['zip']; $pdf->Cell(2, 0.25, $str, "", 1, "L"); } $pdf->Output('member postcards.pdf', 'D'); return false; }
private function CreatePDFRendering($name, $company, $file) { $pdf = new FPDF('L', 'pt', array(162, 288)); //2.25"x4" $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 22); //name font style $pdf->Cell(0, 22, $name, 0, 1, 'C'); //name $pdf->Cell(0, 10, '', 0, 1, 'C'); //blank line $pdf->SetFont('Arial', 'I', 16); //company font style $pdf->Cell(0, 16, $company, 0, 1, 'C'); //company name $pdf->Cell(0, 28, '', 0, 1, 'C'); //blank line $pdf->Image('images/logo.png', $pdf->GetX() + 165, $pdf->GetY(), 65); if ($file == true) { //set file name to hash of object $fullpath = $this->savedirectory . md5(spl_object_hash($pdf)) . '.pdf'; $pdf->Output($fullpath, 'F'); $pdf->Close(); $cmd = 'lpr ' . $fullpath; $cmdout = shell_exec($cmd); return $fullpath; } else { return $pdf->Output(); } }
function pdf() { $this->load->library('cfpdf'); $pdf = new FPDF('P', 'mm', 'A4'); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 'L'); $pdf->Cell(10, 7, 'No', 1, 0); $pdf->cell(30, 7, 'Tanggal', 1, 0); $pdf->cell(30, 7, 'Operator', 1, 0); $pdf->cell(38, 7, 'Total', 1, 1); // tampilkan dari database $pdf->SetFont('Arial', 'B', 'L'); $data = $this->model_transaksi->laporan_default(); $no = 1; foreach ($data->result() as $d) { $total = 0; } $pdf->SetFont('Arial', 'B', 'L'); $pdf->Cell(10, 7, $no, 1, 0); $pdf->cell(30, 7, $d->tanggal_transaksi, 1, 0); $pdf->cell(30, 7, $d->nama_lengkap, 1, 0); $pdf->cell(38, 7, '', 1, 1); // end $pdf->cell(67, 7, 'total', 1, 0, 'L'); $pdf->cell(38, 7, '', 1, 0); $pdf->Output(); }
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"); }
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(); }
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'); } } }
public function actionHelloWorld() { $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 16); $pdf->Cell(40, 10, 'Hello World!'); $pdf->Output(); }
function generatePDF($print_id, $print_type = 1) { include "config.php"; require_once 'fpdf/fpdf.php'; $db = go\DB\DB::create($db_params, 'mysql'); $db->query('SET CHARACTER SET cp1251'); $get_print = $db->query('SELECT `finish_number`, `valve_type_id` FROM {numbers} WHERE `print_id`=?', array($_GET['print_id']))->assoc(); $get_print_info = $db->query('SELECT DISTINCT(`nm`.`order`) as `order`, `us`.`name` as `name`, `nm`.`print_id` as `print_id` FROM {numbers} `nm` LEFT JOIN {users} `us` ON (`nm`.`user_id` = `us`.`id`) WHERE `print_id`=?', array($_GET['print_id']))->row(); define('FPDF_FONTPATH', 'fpdf/fonts'); $pdf = new FPDF("L", "mm", array("88", "7")); $pdf->AddFont('Arial-BoldMT', 'B', 'arial_bold.php'); $pdf->SetFont('Arial-BoldMT', 'B', 11); $pdf->SetTextColor(0); //Add info for this order $pdf->AddPage('L'); $pdf->SetAutoPageBreak(false); $pdf->SetXY(0, 0); $pdf->Cell(43, 7, $get_print_info['name'], 0, 0, "C", 0); $pdf->Cell(4, 7, '', 0, 0, "C", 0); $pdf->Cell(43, 7, $get_print_info['order'], 0, 0, "C", 0); //End of add for ($i = 0; $i < count($get_print); $i++) { $pdf->AddPage('L'); $pdf->SetAutoPageBreak(false); $pdf->SetXY(0, 0); $pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i]['finish_number'], 0, 0, "C", 0); $pdf->Cell(4, 7, '', 0, 0, "C", 0); if ($i + $print_type < count($get_print)) { $pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i + $print_type]['finish_number'], 0, 0, "C", 0); } $pdf->SetAutoPageBreak(false); $i += $print_type; } return $pdf->Output($get_print_info['print_id'] . '.pdf', 'I'); }
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); }
function create_pdf() { define('FPDF_FONTPATH', 'font/'); require 'fpdf.php'; $unique_id = $_GET['unq']; $invoid = $_POST['invoid']; // post the form in page 2 $invonm = $_POST['invonm']; // name $invopc = $_POST['invopc']; // postcode $invoad = $_POST['invoad']; // address $invoem = $_POST['invoem']; // email $invoph = $_POST['invoph']; // telephone $invoss = $_POST['invoss']; // services $invotl = $_POST['invotl']; // total $invode = $_POST['invode']; // date $invost = $_POST['invost']; // unique stamp // $invid = $_SESSION['invoice_id']; // $invnm = $_SESSION['invoice_name']; // $invad = $_SESSION['invoice_address']; // $invem = $_SESSION['invoice_email']; // $invpc = $_SESSION['invoice_postcode']; $pdf = new FPDF(); $pdf->AddPage(); $pdf->Image('img/logo.jpg'); $pdf->SetFont('Arial', '', '12'); $pdf->Cell(0, -6, 'Invoice date: ' . $invode, 0, 1, "R"); $pdf->Cell(0, -6, 'UIS: ' . $invost, 0, 1, "R"); $pdf->Cell(0, 24, '', 0, 1, "L"); $pdf->Cell(0, 6, 'Customer Name: ' . $invonm, 0, 1, "L"); $pdf->Cell(0, 6, 'Address: ' . $invoad, 0, 1, "L"); $pdf->Cell(0, 6, 'Postcode: ' . $invopc, 0, 1, "L"); $pdf->Cell(0, 6, 'Telephone: ' . $invoph, 0, 1, "L"); $pdf->Output(); }
} $pdf->AddPage(); $timetext = time(); $lastword = substr($timetext, -1, 1); $j = 0; $randomtext = rand(1, 10); while ($j < rand(1, 10)) { $lastword = $lastword . $randomtext; $j++; } $pdf->Ln(); $pdf->SetFont("Times", "B", 12); $pdf->SetXY(10, 10); //print transparent random text $pdf->SetTextColor(255, 255, 255); $pdf->Cell(0, 10, "{$timetext} - {$lastword}", 0, 0, 'C'); $pdf->SetXY($xmargin, 10); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 10, "{$org->organization_name} ({$org->companyno})", 0, 0, 'L'); //$pdf->SetFont("Times","",10); //$pdf->Cell(0,12,"($org->companyno)",0,0,'L'); $pdf->SetXY($xmargin, 18); //organization contact info block (2) $orgadd1 = "{$org->street1} {$org->street2} {$org->street3}"; $pdf->SetFont("Times", "", 8); $pdf->Cell(0, 4, "{$orgadd1} {$org->postcode} {$org->city} {$org->state} {$org->country_name}.", 0, 0, 'L'); $pdf->Ln(); $pdf->SetX($xmargin); $pdf->Cell(0, 4, "Tel: {$org->tel_1} {$org->tel2} Fax: {$org->fax} Website: {$org->url} Email: {$org->email}", 0, 0, 'L'); //official receipt label block (3) $pdf->SetXY(160, 8);
$email = $row['email']; $_SESSION['email'] = $email; $_SESSION['name'] = $firstname; $pdf = new FPDF(); $image12 = "done2.png"; // Add a page to that object $pdf->AddPage(); $pdf->setleftmargin(10); $pdf->setX(10); $pdf->setY(10); // Add some text $pdf->SetFont('Arial', 'B', 10); $text = "hello"; // width, height, text, no border, next line - below & left margin, alignement // shree rang in centre $pdf->Cell(200, 10, '|| Shree Rang ||', 0, 1, "C"); //create rectangle and registration form $pdf->SetFillColor(0, 0, 0); $pdf->Rect(0, 20, 210, 10, 'F'); $pdf->SetTextColor(255, 255, 255); $pdf->SetFont('Arial', 'B', 15); $pdf->Cell(200, 10, 'REGISTRATION FORM - 2016', 0, 1, "C"); // space below registration form $pdf->Cell(210, 5, '', 0, 1, "C"); //set font and height $pdf->SetFont('Arial', 'B', 12); $pdf->SetTextColor(0, 0, 0); //space before form no. $pdf->Cell(10, 5, '', 0, 0, "C"); $pdf->Cell(5, 5, 'FORM NO.', 0, 0, "C"); //space between rect and form no tag
$idproveedor = $_GET["idproveedor"]; $tipo = $_GET["tipo"]; $encargado = utf8_decode($_GET["encargado"]); $identrada = $_GET["identrada"]; $totalsiniva = $_GET["totalsiniva"]; $iva = $_GET["iva"]; $totalconiva = $_GET["totalconiva"]; $consulta = mysql_query("SELECT valor,tb_productos.nombre as nombre, cantidad,tr_productos_entradas.id_producto as id " . "FROM tr_productos_entradas,tb_productos,tb_usuarios WHERE id_entrada='{$identrada}' " . "and tr_productos_entradas.id_producto=tb_productos.id_producto and proveedor=cc"); $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetMargins(30, 25, 30); $pdf->SetFont('Arial', '', 10); $pdf->Image('../images/aseoblanco.jpg', 30, 30, 70); $pdf->SetXY(29, 10); $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(0, 100, 'Proveedor:', 0, 0, 'L'); $pdf->SetXY(50, 10); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, 100, $proveedor, 0, 0, 'L'); if ($tipo == "Factura") { $pdf->SetXY(126, 30); $pdf->Cell(1, 10, $tipo, 0, 0, 'R'); $pdf->SetXY(124, 40); $pdf->Cell(1, 10, 'Fecha', 0, 0, 'R'); $pdf->SetXY(119, 55); $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(1, 10, 'Nit:', 0, 0, 'R'); $pdf->SetFont('Arial', '', 10); } else { $pdf->SetXY(126, 30); $pdf->Cell(1, 10, $tipo, 0, 0, 'R');
$data = array(); $gender = array('Laki-laki', 'Perempuan', 'Lain-lain'); foreach ($result as $row) { $row['gender'] = $gender[$row['gender']]; array_push($data, $row); } //setting judul laporan dan header tabel $judul = "LAPORAN DATA MAHASISWA"; $header = array(array("label" => "No. Pegawai", "length" => 30, "align" => "L"), array("label" => "Nama", "length" => 50, "align" => "L"), array("label" => "Email", "length" => 40, "align" => "L"), array("label" => "Telepon", "length" => 30, "align" => "L"), array("label" => "Jenis Kelamin", "length" => 30, "align" => "L")); //sertakan library FPDF dan bentuk objek require_once "fpdf/fpdf.php"; $pdf = new FPDF(); $pdf->AddPage(); //tampilkan judul laporan $pdf->SetFont('Arial', 'B', '16'); $pdf->Cell(0, 20, $judul, '0', 1, 'C'); //buat header tabel $pdf->SetFont('Arial', '', '10'); $pdf->SetFillColor(11, 11, 11); $pdf->SetTextColor(255); $pdf->SetDrawColor(11, 11, 11); foreach ($header as $kolom) { $pdf->Cell($kolom['length'], 5, $kolom['label'], 1, '0', $kolom['align'], true); } $pdf->Ln(); //tampilkan data tabelnya $pdf->SetFillColor(224, 235, 255); $pdf->SetTextColor(0); $pdf->SetFont(''); $fill = false; foreach ($data as $baris) {
<?php require_once 'vendor/autoload.php'; $addresses = getAddressFromCSV($argv[1]); $pdf = new FPDF('L', 'mm', array(148, 100)); foreach ($addresses as $address) { $pdf->AddPage(); $pdf->SetFont('Arial', "", 8); $pdf->setXY(30, 3); $pdf->Cell(45, 10, "The Andrews Family"); $pdf->setXY(30, 6); $pdf->Cell(45, 10, "Sakaine 5-7-29"); $pdf->setXY(30, 9); $pdf->Cell(45, 10, "Kashiwa-shi Chiba-ken Japan"); $pdf->setXY(30, 12); $pdf->Cell(45, 10, "277-0053"); $startPosition = 45; $pdf->SetFont('Arial', "", 12); $pdf->setXY(30, $startPosition); $pdf->Cell(45, 10, trim($address[0])); $pdf->SetFont('Arial', "", 10); if (isset($address[6]) && $address[6] != "") { $pdf->setXY(30, $startPosition += 5); $pdf->Cell(45, 10, trim($address[6])); } $pdf->setXY(30, $startPosition += 5); $pdf->Cell(45, 10, trim($address[1])); $pdf->setXY(30, $startPosition += 5); $pdf->Cell(45, 10, trim($address[2]) . ', ' . trim($address[3]) . ' ' . trim($address[4])); $pdf->setXY(30, $startPosition += 5); $pdf->Cell(45, 10, trim($address[5]));
if ($campo['carcou_dni'] == '0') { $dni = ''; } else { $dni = $campo['carcou_dni']; } $fecha_recepcion = $cargo->util->obtienefecha($campo['carcou_fecharecepcion']); $observaciones = $campo['carcou_observaciones']; $hora = $campo['carcou_hora']; $fragil = $campo['fra_descripcion']; $embalaje = $campo['emb_descripcion']; if ($cant_vestandar > 0) { $valor = $cant_vestandar . ' ESTANDAR'; } else { $valor = $cant_vsimple . ' SIMPLE'; } $pdf->Cell(15.6, 1, '', 0, 0, 'C'); $pdf->Cell(4, 1, $codigo, 0, 0, 'C'); $pdf->Ln(1); $pdf->Cell(19.6, 0.5, '', 0, 0, 'C'); $pdf->Ln(0.5); $pdf->Cell(4.9, 0.7, $fecha, 0, 0, 'C'); $pdf->Cell(4.9, 0.7, $origen, 0, 0, 'C'); $pdf->Cell(4.9, 0.7, $destino, 0, 0, 'C'); $pdf->Cell(4.9, 0.7, $area, 0, 0, 'C'); $pdf->Ln(0.7); $pdf->Cell(9.800000000000001, 1.4, $remite, 0, 0, 'C'); //$pdf->Ln(1.4); $pdf->Cell(9.800000000000001, 0.7, $consignado, 0, 2, 'C'); $pdf->Cell(9.800000000000001, 0.7, $direccionconsignado . ' - ' . $distritodestino, 0, 0, 'C'); $pdf->Ln(0.7); //$pdf->Cell(9.8,1.4,$consignado,1,0,'C');
} $catcount = count($cat_names_array); if ($catcount) { $y_coord = $tm; $x_coord = $lm; $pdf->AddPage('P'); //print "Adding Page ".$page++."<br>"; $pdf->SetMargins($lm, $tm, 8.5); $pdf->SetFillColor(204, 204, 204); /** black **/ $pdf->SetTextColor(0, 0, 0); $pdf->SetXY($x_coord, $y_coord); /** Display a Page Title **/ $pageTitle = "Class Summary for " . $termName . " - " . $class_name . " - " . $teacherName; $pdf->SetFont('Times', 'B', $titlefs); $pdf->Cell($pw, $titleh, $pageTitle, 0, 1, 'C', 1); $y_coord += $titleh; $pdf->SetXY($x_coord, $y_coord); $pdf->SetFont('Times', 'B', $catfs); $numCats = count($cat_names_array); $overallavw = 1.0; $studentw = 2.0; $rightleft = $overallavw + $studentw; $catw = ($pw - ($overallavw + $studentw)) / $numCats; /** Student Names **/ $pdf->Cell($studentw, 2 * $cath, 'Student Names', 0, 0, 'C', 1); $x_coord += $studentw; //$pdf->SetXY($x_coord,$y_coord); /** Categories **/ foreach ($cat_names_array as $cat => $weight) { $pdf->Cell($catw, $cath, $cat, 0, 2, 'C', 1);
/* initialisation/configuration de la classe*/ $courrier = new FPDF(); //font declaration des polices ! $courrier->AddFont('SourceSansPro-Regular', '', 'SourceSansPro-Regular.php'); $courrier->AddFont('SourceSansPro-Semibold', '', 'SourceSansPro-Semibold.php'); $courrier->AddFont('SourceSansPro-LightItalic', '', 'SourceSansPro-LightItalic.php'); $courrier->SetFont('SourceSansPro-Regular', '', 12); $courrier->open(); $courrier->SetAutoPageBreak(1, 15); $courrier->AddPage(); /* Création bloc emetteur */ $courrier->SetFont('SourceSansPro-Regular', '', 12); $courrier->Image($logo, 5, 10, 45, 27); $courrier->Ln(20); $courrier->SetXY(55, 15); $courrier->Cell(0, 5, $emetteur['nom'], 0, 2, 'L', false); //largeur,hauteur,,texte,bodure,suite,alignement,couleur de fond; $courrier->SetX(55); $courrier->MultiCell(0, 5, $emetteur['adr'], 0, 'L', false); //largeur,hauteur,,texte,bodure,suite,alignement,couleur de fond; $courrier->SetX(55); $courrier->MultiCell(0, 5, $emetteur['cp'] . " " . $ville, 0, 'L', false); //largeur,hauteur,,texte,bodure,suite,alignement,couleur de fond; $courrier->Ln(20); /* Création bloc destinataire */ $courrier->SetFont('SourceSansPro-Regular', '', 12); $courrier->SetX(120); $courrier->Cell(0, 5, $destinataire['nom'], 0, 1, 'L', false); //largeur,hauteur,,texte,bodure,suite,alignement,couleur de fond; $courrier->SetX(120); $courrier->MultiCell(0, 5, $destinataire['adr'], 0, 'L', false);
$pdf->Cell(9.5, 5, Round($PUAN[$charilk . 'D' . $charson][0], 2), 0, 0, 'C'); $pdf->Cell(9.5, 5, Round($PUAN[$charilk . 'D' . $charson][1], 2), 0, 0, 'C'); $pdf->Cell(9.5, 5, Round($PUAN[$charilk . 'D' . $charson][2], 2), 0, 0, 'C'); $pdf->Cell(9.5, 5, Round($PUAN[$charilk . 'D' . $charson][3], 0) . '%', 0, 0, 'C'); $pdf->Cell(9.5, 5, Round($PUAN[$charilk . 'H' . $charson][0], 2), 0, 0, 'C'); $pdf->Cell(9.5, 5, Round($PUAN[$charilk . 'H' . $charson][1], 2), 0, 0, 'C'); $pdf->Cell(9.5, 5, Round($PUAN[$charilk . 'H' . $charson][2], 2), 0, 0, 'C'); $pdf->Cell(9.5, 5, Round($PUAN[$charilk . 'H' . $charson][3], 0) . '%', 0, 0, 'C'); } if (isset($_GET['sonuc'])) { $readerUTime = $_GET['readerUTime']; $pdf = new FPDF('L', 'mm', 'A4'); $tabanhesabi = null; AddPage($readerUTime); $pdf->SetXY(15, 120); $pdf->Cell(200, 5, "Genel baþarý seviyesi deðerlendirmesidir.", 0, 0, 'L'); $tabanhesabi = 0; AddPage($readerUTime); $pdf->SetXY(15, 120); $pdf->Cell(200, 5, "Sadece \" {$tabanhesabi} \" baþarý seviyesinden büyük olanlarýn deðerlendirmesidir.", 0, 0, 'L'); $tabanhesabi = 50; AddPage($readerUTime); $pdf->SetXY(15, 120); $pdf->Cell(200, 5, "Sadece \" {$tabanhesabi} \" baþarý seviyesinden büyük olanlarýn deðerlendirmesidir.", 0, 0, 'L'); $pdf->SetCompression(true); $pdf->Output(); } else { ?> <html> <head><title>OMR</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" /></head>
//echo $dmother; if (!isset($female)) { $female = "True"; } else { $female = "False"; } if (!isset($twins)) { $twins = "True"; } else { $twins = "False"; } require "fpdf/fpdf.php"; $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont("Arial", "B", 16); $pdf->Cell(0, 10, "Nitave Hospital", 1, 0, "L"); $pdf->Cell(-100, 10, "Indoor Case Paper", 1, 0, "C"); $pdf->SetFont("Arial", "", 10); $pdf->Ln(); $pdf->Cell(0, 10, "Bill no : {$bno}", 1, 0, "L"); $pdf->Cell(-100, 10, "Case No : {$no}", 1, 0, "C"); $pdf->Ln(); $pdf->Cell(0, 10, "Name : {$name}", 1, 0, "L"); $pdf->Cell(-100, 10, "Age : {$age}", 1, 0, "C"); $pdf->Ln(); $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->AddPage(); if (isset($mode) && !empty($mode) && !strcmp($mode, "addresslist")) { $addresslist = hex2bin($addresslist); $pdf->SetFont('Arial', '', 12); include 'config.php'; $ds = ldap_connect($ldapHost, $ldapPort); // must be a valid LDAP server! if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { if ($ds) { $r = ldap_bind($ds); // this is an "anonymous" bind, typically // read-only access $pdf->SetFont('Arial', 'B', 12); $pdf->MultiCell(80, 6, $ST_ADDRESS_LIST . "\n" . date(DATE_RFC822), 0, 1); $pdf->SetFont('Arial', '', 12); $pdf->Cell(80, 6, "", 0, 1); $tok = strtok($addresslist, "@"); $counter = 0; while ($tok !== false) { $ldapFilter = "cn=" . $tok; $sr = ldap_search($ds, $ldapDomain, $ldapFilter); $info = ldap_get_entries($ds, $sr); $text = $info[0]["givenname"][0] . " " . $info[0]["sn"][0] . "\n" . $info[0]["mozillahomestreet"][0] . "\n" . $info[0]["mozillahomepostalcode"][0] . " " . $info[0]["mozillahomelocalityname"][0] . "\n" . $info[0]["mozillahomecountryname"][0]; $pdf->MultiCell(80, 6, utf8_decode($text), "T", 1); $pdf->Cell(80, 6, "", 0, 1); $counter = $counter + 1; $tok = strtok("@"); } } } } else {
$this->Ln(20); } function Footer() { $this->SetY(-15); // Arial italic 8 $this->SetFont('Arial', 'I', 8); // Page number $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } $pdf = new FPDF('L', 'cm', 'A4'); $pdf->AddPage(); $pdf->SetMargins(1.5, 3, 1.75); $pdf->SetFont('times', '', 14); $pdf->Cell('', 0.6, 'Kartu Berobat', 0, 1, 'C'); $pdf->Ln(); $pdf->SetFontSize(10); $pdf->Cell(3, 0.6, 'Antiran No', 1, 0, 'C'); $pdf->Cell(3, 0.6, 'ID Pasien', 1, 0, 'C'); $pdf->Cell(3, 0.6, 'Nama Pasien', 1, 0, 'C'); $pdf->Cell(4, 0.6, 'Alamat', 1, 0, 'C'); $pdf->Cell(2.5, 0.6, 'Jenis Kelamin', 1, 0, 'C'); $pdf->Cell(3, 0.6, 'Usia', 1, 0, 'C'); $pdf->Cell(3, 0.6, 'Golongan Darah', 1, 0, 'C'); $pdf->Cell(2.5, 0.6, 'No Ponsel', 1, 0, 'C'); $sql = "select * from pasien WHERE pasien_id='{$_GET['id']}' "; foreach ($dbh->query($sql) as $data) { $no++; $pdf->Ln(); $pdf->Cell(3, 0.6, $no, 1, 0, 'C');
require '../impresion/fpdf2.php'; //aqui la consulta o lo que sea... $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', '10'); //titulos de las tabals..... /* $pdf->Cell(60,20,'Ultim Control',C); $pdf->Cell(20,20,'Vaca/Codi'); $pdf->Cell(50,10,'Datacontrol'); $pdf->Cell(25,5,'LLET'); */ //resultados de la consulta a la BD //while($row = mysql_fetch_array($result)) { for ($i = 1; $i <= 10; $i++) { $pdf->Cell(20, 20, 'a', 1, 0); $pdf->Cell(50, 20, 'b', 1, 0); $pdf->Ln(20); $pdf->Cell(25, 5, 'c', 1, 0); $i = $i + 1; /*$pdf->Cell(60,20,'PDF+PHP Test',); rectangle with 60 mm of width & 20 mm of height, we wrote ‘PDF+PHP Test’ and the first 0 means we do not want a border. The 1 next to it means that once it’s done the cell, it will go to the beginning of the next line, if 0 is provided, then it will be to the right of it, if 2 is provided then it will go below. The C is just the alignment which is center of the text inside the box, possible values are left (L), center (C), right (R).*/ $pdf->Ln(5); } $pdf->Output(); /*Now let’s see that code line by line… require('fpdf.php'); This line includes our FPDF class that we need to create the PDF file. $pdf=new FPDF();
public function imprimir() { $segmento = $this->uri->segment(3); if ($segmento) { $data = $this->pedidos_model->obtener_detalle_pedido($segmento); //$this->output->set_content_type('application/json')->set_output(json_encode($data->result()[0])); $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(30, 5, 'DETALLE DEL PEDIDO No.' . $data->result()[0]->idPedidos, 0, 1); $pdf->Output(); } }