當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FPDF::Write方法代碼示例

本文整理匯總了PHP中FPDF::Write方法的典型用法代碼示例。如果您正苦於以下問題:PHP FPDF::Write方法的具體用法?PHP FPDF::Write怎麽用?PHP FPDF::Write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FPDF的用法示例。


在下文中一共展示了FPDF::Write方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: generate_pdf

 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');
 }
開發者ID:passionybr2003,項目名稱:gmaps,代碼行數:36,代碼來源:PdfCreator.php

示例2: FPDF

$name = $_POST['name'];
$characteristics = $_POST['characteristics'];
$image = $_POST['image'];
require 'fpdf17/fpdf.php';
//create a FPDF object
$pdf = new FPDF();
//set document properties
$pdf->SetAuthor('Anon');
$pdf->SetTitle($name);
//set font for the entire document
$pdf->SetFont('Helvetica', 'B', 20);
$pdf->SetTextColor(50, 60, 100);
//set up a page
$pdf->AddPage('P');
//$pdf->SetDisplayMode(real,'default');
//insert an image and make it a link
$pdf->Image('logo.png', 10, 20, 33, 0);
//display the title without a border around it
$pdf->SetXY(50, 20);
$pdf->SetDrawColor(50, 60, 100);
$pdf->Cell(100, 10, $name, 0, 0, 'C', 0);
// Insert a dynamic image from a URL
$pdf->Image($image, 75, 30, 0, 50);
//Set x and y position for the main text, reduce font size and write content
$pdf->SetXY(10, 90);
$pdf->SetFontSize(10);
$pdf->Write(5, $characteristics);
//Output the document
$pdf->Output();
?>
 
開發者ID:JLockerbie,項目名稱:BS,代碼行數:30,代碼來源:fpdfout.php

示例3: FPDF

 function generate_news_pdf($news)
 {
     $imagePath = $_SERVER['DOCUMENT_ROOT'] . 'news_app/uploads/news_images/';
     require $_SERVER['DOCUMENT_ROOT'] . 'news_app/app/libraries/FPDF/fpdf.php';
     $pdf = new FPDF();
     $pdf->AliasNbPages();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     // Title
     //$pdf->Ln(4);
     $pdf->Write(1, $news->title);
     //$pdf->Ln(10);
     $pdf->Image($imagePath . $news->news_image, 50, 30, 'C');
     //$pdf->Ln(16);
     $pdf->SetFont('Arial', '', 12);
     $pdf->Write(5, $news->news_text);
     $pdf->Output();
 }
開發者ID:sonupatil,項目名稱:news_app,代碼行數:18,代碼來源:pdf_helper.php

示例4: makePdfFile

 public static function makePdfFile($filename, $content)
 {
     if (PdfUtils::$imported == FALSE) {
         require_once 'libs/fpdf/fpdf.php';
     }
     PdfUtils::$imported = true;
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     //$pdf->Cell(40,10,'Hello World!');
     $pdf->Write(5, $content);
     $pdf->Output($filename, 'F');
 }
開發者ID:alex2stf,項目名稱:phpquick,代碼行數:13,代碼來源:PdfUtils.php

示例5: UsersTrafficPeriodPDF

function UsersTrafficPeriodPDF()
{
    //require('chart.php');
    require 'lib/fpdf.php';
    global $SAMSConf;
    global $DATE;
    $DB = new SAMSDB();
    $sdate = $DATE->sdate();
    $edate = $DATE->edate();
    $bdate = $DATE->BeginDate();
    $eddate = $DATE->EndDate();
    $size = "";
    if (isset($_GET["size"])) {
        $size = $_GET["size"];
    }
    require "reportsclass.php";
    $dateselect = new DATESELECT($DATE->sdate(), $DATE->edate());
    $lang = "./lang/lang.{$SAMSConf->LANG}";
    require $lang;
    define('FPDF_FONTPATH', 'lib/font/');
    require 'lib/fpdf.php';
    $pdfFile = new FPDF();
    $pdfFile->Open();
    $pdfFile->AddFont('Nimbus', '', 'Nimbus.php');
    $pdfFile->SetAuthor("SQUID Account Management System");
    $pdfFile->SetCreator("Created by SAMS2");
    $pdfFile->SetTitle("SAMS2 users statistic");
    //      UsersTrafficPeriodPDF();
    $pdfFile->AddPage();
    $pdfFile->SetFont('Nimbus', '', 15);
    //$pdfFile->SetFont('SUSESerif-Roman','',16);
    $pdfFile->SetXY(50, 15);
    echo " {$usersbuttom_2_traffic_UsersTrafficPeriod_1}<BR>{$usersbuttom_2_traffic_UsersTrafficPeriod_2}<br>";
    $pdfFile->Write(0, " {$usersbuttom_2_traffic_UsersTrafficPeriod_1}<BR>{$usersbuttom_2_traffic_UsersTrafficPeriod_2}");
    $pdfFile->Output();
}
開發者ID:ruNovel,項目名稱:sams2,代碼行數:36,代碼來源:usersbuttom_2_traffic.php

示例6: post_id_handler

 public function post_id_handler()
 {
     $numbers = array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty");
     if (!is_array($this->id)) {
         $this->id = array($this->id);
     }
     $today = date("F j, Y");
     $pdf = new FPDF('P', 'mm', 'Letter');
     $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Medium.php');
     //Meat of the statement
     foreach ($this->id as $card_no) {
         $pdf->AddPage();
         $pdf->Image('new_letterhead_horizontal.png', 5, 10, 200);
         $pdf->SetFont('Gill', '', '12');
         $pdf->Ln(45);
         $account = \COREPOS\Fannie\API\member\MemberREST::get($card_no);
         $pdf->Cell(10, 10, $today, 0);
         $pdf->Ln(15);
         foreach ($account['customers'] as $c) {
             if ($c['accountHolder']) {
                 $firstname = ucwords(strtolower($c['firstName']));
                 $lastname = ucwords(strtolower($c['lastName']));
                 $fullname = $firstname . " " . $lastname;
                 break;
             }
         }
         //Member address
         $pdf->Cell(10, 10, trim($fullname), 0);
         $pdf->Ln(5);
         $pdf->Cell(80, 10, $account['addressFirstLine'], 0);
         if ($account['addressSecondLine']) {
             $pdf->Cell(80, 10, $account['addressSecondLine'], 0);
         }
         $pdf->Cell(90, 10, $account['city'] . ', ' . $account['state'] . '   ' . $account['zip'], 0);
         $pdf->Ln(15);
         $pdf->MultiCell(0, 5, "Dear " . $firstname . ",");
         $pdf->Ln(5);
         $txt = "We have received your Application to Terminate your membership at WFC. The\nBoard reviews termination requests annually in ";
         $pdf->SetFont("Gill", "", "12");
         $pdf->Write(5, str_replace("\n", " ", $txt));
         $pdf->SetFont("Gill", "B", "12");
         $pdf->Write(5, "February");
         $pdf->SetFont("Gill", "", "12");
         $txt = ". Refunds, less any indebtedness owed to WFC, are authorized for payment in\nthe order received subject to the financial health of WFC and receipt of additional stock\nfrom new members. Your stock will be refunded as soon as possible based on these criteria.";
         $pdf->Write(5, str_replace("\n", " ", $txt) . "\n");
         $pdf->Ln(5);
         $txt = "Submission of an Application to Terminate immediately inactivates your owner\nbenefits and discounts and your right to participate in governance of WFC. Please keep us\nadvised of any changes in your mailing address.";
         $pdf->MultiCell(0, 5, str_replace("\n", ' ', $txt));
         $pdf->Ln(5);
         $txt = "If you have any questions, please do not hesitate to ask. I can be reached at the\nnumber above or at mms@wholefoods.coop. Thank you.";
         $pdf->MultiCell(0, 5, str_replace("\n", ' ', $txt));
         $pdf->Ln(5);
         $pdf->MultiCell(0, 5, "Thank you for your support of WFC");
         $pdf->Ln(10);
         $pdf->MultiCell(0, 5, "Sincerely yours,");
         $pdf->MultiCell(0, 5, "WHOLE FOODS COMMUNITY CO-OP, INC.");
         $pdf->Ln(10);
         $pdf->MultiCell(0, 5, "Amanda Borgren");
         $pdf->MultiCell(0, 5, "Owner Services");
     }
     $pdf->Output('member term letters.pdf', 'D');
     return false;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:64,代碼來源:StatementsPluginTerm.php

示例7: Write

 function Write($h, $txt, $link = '')
 {
     if ($this->CurrentFont['type'] == 'Type0') {
         $this->MBWrite($h, $txt, $link);
     } else {
         parent::Write($h, $txt, $link);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:soopa,代碼行數:8,代碼來源:korean.php

示例8: createPDF

function createPDF($text)
{
    if (!isset($GLOBALS["pdf_font"])) {
        $GLOBALS["pdf_font"] = 'Arial';
        $GLOBALS["pdf_fontsize"] = 12;
    }
    $pdf = new FPDF();
    $pdf->SetCreator("PHPlist version " . VERSION);
    $pdf->Open();
    $pdf->AliasNbPages();
    $pdf->AddPage();
    $pdf->SetFont($GLOBALS["pdf_font"], $GLOBALS["pdf_fontstyle"], $GLOBALS["pdf_fontsize"]);
    $pdf->Write((int) $GLOBALS["pdf_fontsize"] / 2, $text);
    $fname = tempnam($GLOBALS["tmpdir"], "pdf");
    $pdf->Output($fname, false);
    return $fname;
}
開發者ID:bcantwell,項目名稱:website,代碼行數:17,代碼來源:sendemaillib.php

示例9: FPDF

        $nombre_mes = "Noviembre";
        break;
    case 12:
        $nombre_mes = "Diciembre";
        break;
}
if ($registros > 0) {
    require '/fpdf/fpdf.php';
    $pdf = new FPDF('L');
    $pdf->AddPage();
    // Imagen
    $pdf->Image('serbimaAA.jpg', 245, 8, 30);
    // titulo
    $pdf->SetFont('Arial', 'B', 12);
    $pdf->SetXY(90, 10);
    $pdf->Write(1, "PLANILLA DE DESCUENTO {$emp}");
    $pdf->SetXY(125, 15);
    $pdf->Write(1, 'Mes de ' . $nombre_mes . ' del ' . $ano);
    // Informacion del empleador
    $pdf->SetFont('Arial', 'U', 10);
    $pdf->SetXY(10, 30);
    $pdf->Write(1, 'Información del empleador');
    if ($registro = sqlsrv_fetch_object($resultado)) {
        $rut_inst = $registro->rut_inst;
        $dv_inst = $registro->dv_inst;
    }
    function rut($rut)
    {
        return number_format(substr($rut, 0, -1), 0, "", ".") . '-' . substr($rut, strlen($rut) - 1, 1);
    }
    $rut_inst_formateado = rut($rut_inst . $dv_inst);
開發者ID:llanosCoder,項目名稱:mybu,代碼行數:31,代碼來源:pdf.php

示例10: short_global_risk_pdf_report

 public function short_global_risk_pdf_report($project_id, $offset = 0, $limit = 100, $order_by = 'project_name', $order_by_2 = 'occurred', $order_by_3 = 'expected_cost', $direction = 'ASC', $direction_2 = 'DESC')
 {
     $confirm_member = $this->User_model->confirm_member();
     if (!$confirm_member['success']) {
         $_SESSION['last_uri'] = $this->uri->uri_string();
         $_SESSION['login_message'] = $confirm_member['message'];
         redirect('login');
     }
     $permission = $this->Project_model->initialize($project_id, $_SESSION['user_id']);
     if ($permission === false) {
         redirect('dashboard');
         return;
     }
     $user_id = $_SESSION['user_id'];
     $this->load->model('Risk_model');
     $filter_field = $this->input->post('filter_field');
     $filter_value = $this->input->post('filter_value');
     $this->load->helper('security');
     xss_clean($filter_field);
     xss_clean($filter_value);
     $risks = $this->Risk_model->get_all_by_user($user_id, $limit, $offset, $order_by, $order_by_2, $order_by_3, $direction, $direction_2, $filter_field, $filter_value);
     $project_data = $this->Project_model->get();
     $page_data = array('project_data' => $project_data);
     $this->load->library('fpdf');
     $pdf = new FPDF();
     $pdf->AddPage('L');
     $pdf->SetFont('Arial', 'BU', 16);
     $pdf->Cell(10, 5, 'Global Risk Report');
     $pdf->Ln(8);
     $pdf->SetFont('Arial', 'B', 12);
     // $pdf->Write(15, "Project Name:");
     // $pdf->Write(15, "  " . $project_data['project_name']);
     $pdf->Write(15, "     " . date('Y-m-d'));
     //set table header and body fonts
     $thfont = array('family' => 'Arial', 'style' => 'B', 'size' => 11);
     $tbfont = array('family' => 'Arial', 'style' => '', 'size' => 11);
     $pdf->Ln(17);
     $twidth = array(25, 42, 22, 22, 52, 23, 48, 22, 22);
     $theader = array('Project Name', 'Risk Event', 'Date of Concern', 'Occurred', 'Cause', 'Probability', 'Impact', 'Overall Impact', 'Expected Cost');
     $tdata = array();
     $count = sizeof($risks);
     foreach (array_slice($risks, 0, $count - 1) as $item) {
         array_push($tdata, array($item['project_name'], $item['event'], $item['date_of_concern'], $item['occurred'], $item['cause'], $item['probability'], $item['impact'], $item['overall_impact'], '$' . (string) intval($item['expected_cost'])));
     }
     $pdf->create_table($theader, $tdata, $twidth, 'L', 'L', $thfont, $tbfont);
     return $pdf->Output();
 }
開發者ID:esctt,項目名稱:riskmp_v1,代碼行數:47,代碼來源:user.php

示例11: FPDF

 /**
  * Download task list as attachment
  *
  * @access public
  * @param void
  * @return null
  */
 function download_list()
 {
     $task_list = ProjectTaskLists::findById(get_id());
     if (!$task_list instanceof ProjectTaskList) {
         flash_error(lang('task list dnx'));
         $this->redirectTo('task');
     }
     // if
     $this->canGoOn();
     if (!$task_list->canView(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('task'));
     }
     // if
     $output = array_var($_GET, 'output', 'csv');
     $project_name = active_project()->getName();
     $task_list_name = $task_list->getName();
     $task_count = 0;
     if ($output == 'pdf') {
         Env::useLibrary('fpdf');
         $download_name = "{$project_name}-{$task_list_name}-tasks.pdf";
         $download_type = 'application/pdf';
         $pdf = new FPDF();
         $pdf->AddPage();
         $pdf->SetTitle($task_list_name);
         $pdf->SetCompression(true);
         $pdf->SetCreator('ProjectPier');
         $pdf->SetDisplayMode(fullpage, single);
         $pdf->SetSubject(active_project()->getObjectName());
         $pdf->SetFont('Arial', 'B', 16);
         $task_lists = active_project()->getOpenTaskLists();
         $pdf->Cell(0, 10, lang('project') . ': ' . active_project()->getObjectName(), 'C');
         $pdf->Ln();
         foreach ($task_lists as $task_list) {
             $pdf->SetFont('Arial', 'B', 14);
             $pdf->Write(10, lang('task list') . ': ' . $task_list->getObjectName());
             $pdf->Ln();
             $tasks = $task_list->getTasks();
             $line = 0;
             // Column widths
             $w = array(10, 0, 0);
             // Header
             //for($i=0;$i<count($header);$i++)
             //  $this->Cell($w[$i],7,$header[$i],1,0,'C');
             //$this->Ln();
             $pdf->SetFont('Arial', 'I', 14);
             foreach ($tasks as $task) {
                 $line++;
                 if ($task->isCompleted()) {
                     $task_status = lang('completed');
                     $pdf->SetTextColor(100, 200, 100);
                     $task_completion_info = lang('completed task') . ' : ' . format_date($task->getCompletedOn());
                 } else {
                     $task_status = lang('open');
                     $pdf->SetTextColor(255, 0, 0);
                     $task_completion_info = lang('due date') . ' : ' . lang('not assigned');
                     if ($task->getDueDate()) {
                         $task_completion_info = lang('due date') . ' : ' . format_date($task->getDueDate());
                     }
                 }
                 if ($task->getAssignedTo()) {
                     $task_assignee = $task->getAssignedTo()->getObjectName();
                 } else {
                     $task_assignee = lang('not assigned');
                 }
                 $pdf->Cell($w[0], 6, $line);
                 $pdf->Cell($w[2], 6, $task_status, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Cell($w[2], 6, $task_completion_info, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Cell($w[2], 6, $task_assignee, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->MultiCell($w[2], 6, $task->getText(), "TLRB");
                 $pdf->Ln();
             }
         }
         $pdf->Output($download_name, 'D');
     } else {
         $download_name = "{$project_name}-{$task_list_name}-tasks.txt";
         $download_type = 'text/csv';
         $download_contents = $task_list->getDownloadText($task_count, "\t", true);
         download_contents($download_contents, $download_type, $download_name, strlen($download_contents));
     }
     die;
 }
開發者ID:bklein01,項目名稱:Project-Pier,代碼行數:98,代碼來源:TaskController.class.php

示例12:

$pdf->SetFont('Arial', 'B', 10);
$pdf->SetX(5);
$pdf->Cell(50, 5, 'TO WHOM IT MAY CONCERN:', 0, 1, 'L');
$pdf->Cell(190, 5, '', 0, 1, 'C');
$pdf->SetFont('Arial', '', 10);
$pdf->SetX(10);
$pdf->Cell(40, 5, 'This is to certify that', 0, 0, 'L');
$pdf->SetX(50);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(150, 5, $resulta[0], 0, 1, 'C');
$pdf->SetX(50);
$pdf->Cell(150, 5, '-----------------------------------------------------------------------------------------------------------------------------', 0, 1, 'C');
$pdf->Cell(200, 5, '', 0, 1, 'C');
$pdf->SetX(10);
$pdf->SetFont('Arial', '', 10);
$pdf->Write(5, 'of ');
$pdf->SetFont('Arial', 'BU', 10);
$pdf->Write(5, $resulta[4]);
$pdf->SetFont('Arial', '', 10);
$pdf->Write(5, ' is hereby granted to operate his/her peddling activity.', 0, 1, 'L');
$pdf->Cell(200, 5, '', 0, 1, 'C');
$pdf->Cell(200, 5, '', 0, 1, 'C');
$pdf->Cell(200, 5, '', 0, 1, 'C');
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetX(5);
$pdf->Cell(60, 5, 'NAME OF BUSINESS', 1, 0, 'C');
$pdf->Cell(60, 5, 'MERCHANDISE SOLD', 1, 0, 'C');
$pdf->Cell(40, 5, 'APPLICATION DATE', 1, 0, 'C');
$pdf->Cell(40, 5, 'VALID FOR', 1, 1, 'C');
//put values here
$pdf->SetFont('Arial', 'B', 10);
開發者ID:laiello,項目名稱:ebpls,代碼行數:31,代碼來源:ebpls_peddler_permit.php

示例13: FPDF

$pdf = new FPDF();
//valores por defecto que son página A4 con orientación vertical y el tamaño medido en milímetros
/*El primer parámetro del constructor permite elegir entre orientación vertical (L)
 u horizontal (P). El segundo parámetro sirve para que las medidas
de referencia se hagan en base a puntos (pt), milímetros (mm), centímetro
(cm) o pulgadas (in). El último parámetro nos ofrece la oportunidad de
elegir entre los diferentes formatos de página que existen: A3, A4, A5, Letter
y Legal.*/
//MEtodos de la clase
//var_dump(get_class_methods($pdf));
//PAGINA 1: Write
$pdf->AddPage();
//añade una página al documento con la orientación que le pida
$pdf->SetFont('Arial', 'B', 15);
//selecciona una fuente tomando como parámetro el tipo, la propiedad (negrita, cursiva) y el tamaño
$pdf->Write(155, ' Mi primer documento!!!');
//Write(altura,texto,enlace)-> Imprime el texto pasado como parámetro en la posición que indica el cursor.
$pdf->SetFont('Helvetica', 'I', 15);
//selecciona una fuente tomando como parámetro el tipo, la propiedad (negrita, cursiva) y el tamaño
$pdf->Write(165, ' Mi primer documento!!!');
$pdf->SetFont('Arial', '', 15);
//selecciona una fuente tomando como parámetro el tipo, la propiedad (negrita, cursiva) y el tamaño
$pdf->Write(180, ' Mi primer documento!!!', "http://www.googles.es");
//PAGINA 2: La Celda
$pdf->AddPage();
$pdf->SetFont('Courier', '', 10);
$pdf->Cell(80);
$pdf->Cell(20, 10, 'Titulo', 'LR', 1, 'C');
$pdf->Cell(50);
$pdf->Cell(40, 10, 'Enlace a google', 1, 1, 'C', 0, "http://www.google.es");
//PAGINA 3: El cursor
開發者ID:ttounkyo,項目名稱:proyecto,代碼行數:31,代碼來源:ex1.php

示例14: FPDF

<?php

if (urlencode(@$_REQUEST['action']) == "getpdf") {
    mysql_connect("localhost", "root", "");
    mysql_select_db("phonebook");
    include 'fpdf/fpdf.php';
    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->SetFont('Helvetica', '', 14);
    $pdf->Write(5, 'Phone Book');
    $pdf->Ln();
    $pdf->SetFontSize(10);
    $pdf->Write(5, 'Batch:13 Group: Code Worior');
    $pdf->Ln();
    $pdf->Ln(5);
    $pdf->SetFont('Helvetica', 'B', 10);
    $pdf->Cell(50, 7, 'Full Name', 1);
    //$pdf->Cell(50 ,7, 'Last Name', 1);
    //        $pdf->Cell(30 ,7, 'Nick Name', 1);
    $pdf->Cell(35, 7, 'Mobile Number', 1);
    $pdf->Cell(35, 7, 'Home Phone', 1);
    $pdf->Cell(35, 7, 'Work Phone', 1);
    $pdf->Ln();
    $pdf->SetFont('Helvetica', '', 10);
    $result = mysql_query("SELECT * FROM tbl_info");
    while ($row = mysql_fetch_array($result)) {
        $pdf->Cell(50, 7, $row['fname'] . " " . $row['lname'], 1);
        //
        //
        //
        //
開發者ID:rezaul91,項目名稱:mini_project,代碼行數:31,代碼來源:downloadpdf.php

示例15: otr_pdf_writer

 public function otr_pdf_writer($file, $info)
 {
     $path = getcwd();
     if (!is_dir($path . '/img/')) {
         if (mkdir($path . '/img')) {
             if (!mkdir($path . '/img/otr_pdfs')) {
                 return false;
             }
         } else {
             return false;
         }
     } elseif (!is_dir($path . '/img/otr_pdfs/')) {
         if (!mkdir($path . '/img/otr_pdfs')) {
             return false;
         }
     }
     $url_file_path = '/img/otr_pdfs/' . $file;
     $filename = $path . $url_file_path;
     $info['student_full_name'] = $info['FirstName'] . ' ' . $info['MiddleName'] . ' ' . $info['LastName'];
     $pdf = new FPDF('P', 'mm', array(218, 290));
     $pdf->SetAuthor($info['student_full_name']);
     $pdf->SetTitle('OTR');
     $pdf->SetFont('Helvetica', 'B', 20);
     $pdf->SetTextColor(50, 60, 100);
     $pdf->AddPage('P');
     //$pdf->SetDisplayMode('real','default');
     $pdf->SetFontSize(10);
     // Background image
     $pdf->Image('../resources/otr/otr_multi_form2.png', 0, 0);
     $start_x = 18;
     $start_y = 46;
     for ($i = 0; $i < 3; $i++) {
         // Fill out first form
         // Name
         $pdf->SetFont('Times', 'B', 14);
         $start_address_Y = $start_y - 27;
         foreach ($info['otr_address'] as $otr_address) {
             $pdf->SetXY($start_x + 109, $start_address_Y);
             $pdf->Write(5, $otr_address);
             $start_address_Y += 5;
         }
         $pdf->SetFont('Helvetica', 'B', 10);
         $pdf->SetXY($start_x, $start_y);
         $pdf->Write(5, $info['student_full_name']);
         // Address
         $pdf->SetXY($start_x + 2, $start_y + 6.5);
         $pdf->Write(5, $info['addr_line1_CA']);
         // Years of Attendance (I don't believe we are gathering this information)
         //$pdf->SetXY($start_x+90,$start_y+6.5);
         //$pdf->Write(5,$info['name']);
         //$pdf->SetXY($start_x+115,$start_y+6.5);
         //$pdf->Write(5,$info['name']);
         // City, State
         $pdf->SetXY($start_x + 1, $start_y + 13);
         $pdf->Write(5, $info['city_CA'] . ', ' . $info['st_ca']);
         // Zip Code
         $pdf->SetXY($start_x + 58, $start_y + 13);
         $pdf->Write(5, $info['zip_CA']);
         // Soc. Security Number
         //            $pdf->SetXY($start_x+26,$start_y+19.5);
         //            $pdf->Write(5,$info['SF_NO']);
         // Phone Number & Email
         $pdf->SetXY($start_x + 15, $start_y + 26);
         if ($info['pref_contact'] == 'cell_phone') {
             $pdf->Write(5, $info['ndcellphone']);
         } else {
             $pdf->Write(5, $info['phone']);
         }
         $pdf->SetFontSize(8);
         $pdf->SetXY($start_x + 52, $start_y + 26);
         $pdf->Write(5, $info['line1']);
         $pdf->SetFontSize(10);
         // Birth Date
         $birth_date = explode('/', $info['birth_date']);
         $pdf->SetXY($start_x + 115, $start_y + 26);
         $pdf->Write(5, $birth_date[0]);
         $pdf->SetXY($start_x + 122.5, $start_y + 26);
         $pdf->Write(5, $birth_date[1]);
         $pdf->SetXY($start_x + 130, $start_y + 26);
         $pdf->Write(5, $birth_date[2]);
         // Today's Date
         $pdf->SetXY($start_x + 102, $start_y + 32.5);
         $pdf->Write(5, date('m'));
         $pdf->SetXY($start_x + 109.5, $start_y + 32.5);
         $pdf->Write(5, date('d'));
         $pdf->SetXY($start_x + 117, $start_y + 32.5);
         $pdf->Write(5, date('Y'));
         // Move to the next form:
         $start_y = $start_y + 93;
     }
     $pdf->Output($filename);
     if (file_exists($filename)) {
         //$full_url = 'http://'.$_SERVER['HTTP_HOST'].$url_file_path;
         return $url_file_path;
     } else {
         return false;
     }
 }
開發者ID:robeysan,項目名稱:studentportal,代碼行數:98,代碼來源:ndc.php


注:本文中的FPDF::Write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。