示例#1
2
 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');
 }
示例#2
2
文件: fpdfout.php 项目: JLockerbie/BS
$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();
?>
 
示例#3
1
 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');
 }
示例#4
1
 function Write($h, $txt, $link = '')
 {
     if ($this->CurrentFont['type'] == 'Type0') {
         $this->MBWrite($h, $txt, $link);
     } else {
         parent::Write($h, $txt, $link);
     }
 }
示例#5
1
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;
}
示例#6
1
文件: pdf.php 项目: llanosCoder/mybu
        $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);
示例#7
1
文件: user.php 项目: esctt/riskmp_v1
 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();
 }
 /**
  * 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;
 }
示例#9
0
 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();
 }
示例#10
0
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();
}
示例#11
0
 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;
 }
示例#12
0
$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);
示例#13
0
文件: ex1.php 项目: ttounkyo/proyecto
$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
示例#14
0
<?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);
        //
        //
        //
        //
示例#15
0
 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;
     }
 }
$pdf->SetTextColor(0, 0, 0);
//set up a page
$pdf->AddPage('P');
$pdf->SetDisplayMode(real, 'default');
//display the title with a border around it
//Set x and y position for the main text, reduce font size and write content
$pdf->Image('img/form_1_04_1.jpg', 5, 5, 205);
if ($row['study_type'] == "Денна") {
    $pdf->Line(58, 53.5, 65, 53.5);
}
if ($row['study_type'] == "Заочна") {
    $pdf->Line(67, 53.5, 76, 53.5);
}
$pdf->SetXY(52, 64);
$pdf->SetFont('Times', '', 10);
$pdf->Write(5, $row['ab_id']);
$pdf->SetFontSize(9);
$pdf->SetXY(22, 70);
$pdf->Write(5, $row['lastname']);
$pdf->SetXY(15, 74.5);
$pdf->Write(5, $row['firstname']);
$pdf->SetXY(24, 78);
$pdf->Write(5, $row['patronymic']);
$pdf->SetFontSize(8);
$pdf->SetXY(34, 81.5);
$pdf->Write(5, $row['faculty']);
$pdf->SetXY(7, 89);
$pdf->Write(5, str_replace($row['faculty'], "", $row['training']));
$pdf->SetXY(7, 96);
$pdf->Write(5, $row['speciality']);
$pdf->SetXY(52, 100);
 $sub = str_replace('<responsavel_empresa>', $responsavel_empresa, $imprimir_sub);
 $sub = str_replace('<responsavel_endereco>', $responsavel_endereco, $sub);
 $sub = str_replace('<responsavel_cidade>', $responsavel_cidade, $sub);
 $sub = str_replace('<responsavel_estado>', $responsavel_estado, $sub);
 $sub = str_replace('<responsavel_cep>', $responsavel_cep, $sub);
 $sub = str_replace('<responsavel_tel>', $responsavel_tel, $sub);
 $sub = str_replace('<responsavel_fax>', $responsavel_fax, $sub);
 $sub = str_replace('<responsavel_email>', $responsavel_email, $sub);
 $pdf->AddPage();
 $pdf->Image('../images/header.jpg', '0', '0', '19', '3,04', 'JPG');
 $pdf->SetFont('', 'B', 12);
 $pdf->Cell('', 2, 'NÃO EMITIMOS E NEM VENDEMOS CERTIDÕES E SIM PRAZOS E SOLUÇÕES', '', 1, 'C');
 $pdf->SetFont('', 'B', 14);
 $pdf->Cell('', 2, 'Declaração de Busca', '', 1, 'C');
 $pdf->SetFont('', '', 12);
 $pdf->Write(1, $topo, '');
 $pdf->SetFont('', '', 12);
 $pdf->Cell('', 1, '', '', 1, 'C');
 $pdf->Cell('', 1, '', '', 1, 'C');
 $pdf->Cell('', 1, '', '', 1, 'C');
 $pdf->Cell('', 1, '', '', 1, 'C');
 $pdf->Cell('', 1, '', '', 1, 'C');
 $pdf->Cell('', 1, '', '', 1, 'C');
 $pdf->Cell('', 1, $data_atual, '', 1, 'C');
 $pdf->Cell('', 1, $impressao_ordem, '', 1, 'R');
 $pdf->ln();
 $pdf->ln();
 $pdf->ln();
 $pdf->ln();
 $pdf->Cell('', 1, $responsavel_empresa, '', 1, 'C');
 $pdf->ln();
示例#18
0
        $pdf->Cell(0, 6, '', 0, 0);
        //   $pdf->Ln();
        //   $pdf->Ln();
        // $pdf->Ln();
        //   $pdf->Ln();
        //   echo "<p class='espaciar2'><img src=$img width='100' height='150' alt='' class='captionated' /></p>
        // <p> <strong>ID:</strong><br>	<strong>Titulo:</strong><br>	<strong>Autor:</strong><br><strong>Prestado a:</strong></p>
        //<p class='espaciar'>$id<br>	$ti<br>	$aut<br> <strong>$prestt</strong> <br><br><br><br><br>		</p>";
        //   echo "<a href='JavaScript:newPopup('http://www.quackit.com/html/html_help.cfm');'>Open a popup window</a>";
        //   <a href="JavaScript:newPopup('http://www.quackit.com/html/html_help.cfm');">Open a popup window</a>
        //   echo "<tr><td>$id</td><td>$ti</td><td>$aut</td><td>$an</td><td>$edi</td><td>$gen</td><td>$nump</td><td>$stat</td></tr>";
        // }
    }
    $espaciadoV = $espaciadoV + 1;
    $espaciadoH = $espaciadoH + 6;
    mysql_free_result($result2);
    mysql_free_result($result3);
}
//echo"</table>";
mysql_free_result($result);
mysql_free_result($result4);
mysql_close($link);
$pdf->Ln();
$pdf->Ln();
$pdf->Write(5, 'Consulte información detallada sobre sus libros en:     ', '');
$pdf->SetTextColor(0, 0, 255);
$pdf->SetFont('', 'U');
$pdf->Write(5, 'Biblioteca Personal', 'http://localhost/BibliotecaPersonal2/indexP.php');
$pdf->Output();
//mysql_free_result($result);
//  mysql_close($link);
        $sub = str_replace('<impressao_ordem>', $impressao_ordem, $sub);
        $data_atual = $responsavel_cidade . ', ' . date(d) . ' de ' . $mes . ' de ' . date('Y') . '.';
        $sub = str_replace("<data>", $data_atual, $sub);
        $sub = str_replace("<contato>", $contato, $sub);
        if ($custas != '' && ($id_conveniado == 635 || $id_conveniado == 26198 || $id_conveniado == 26341 || $id_conveniado == 26118 || $id_conveniado == 28815)) {
            $sub = str_replace("<custas>", 'Custas: R$ ' . $custas, $sub);
        } else {
            $sub = str_replace("<custas>", '', $sub);
        }
        $pdf->AddPage();
        $pdf->Image('../images/header.jpg', '0', '0', '19', '3,04', 'JPG');
        $pdf->SetFont('times', 'B', 12);
        $pdf->Cell(19.2, 2.5, 'NÃO EMITIMOS E NEM VENDEMOS CERTIDÕES E SIM PRAZOS E SOLUÇÕES', 0, 1, 'C');
        require 'gera_imoveis_busca_' . $id_impresso . '.php';
        $pdf->SetFont('times', '', 12);
        $pdf->Write(0.5, $sub, '');
        $pdf->Write(0.5, '

                        ', '');
        $pdf->SetFont('times', 'B', 10);
        $pdf->Line(1, 25.5, 20, 25.5);
        $pdf->SetY(25.5);
        $pdf->Cell(0, 0.5, $responsavel_empresa, 0, 1, 'C');
        $rodape = $responsavel_endereco . ',
' . $responsavel_cidade . '-' . $responsavel_estado . ' CEP: ' . $responsavel_cep;
        $pdf->Cell(0, 0.5, $rodape, 0, 1, 'C');
        $rodape = 'Tel/Fax: ' . $responsavel_tel . '/' . $responsavel_fax . '

E-mail:' . $responsavel_email;
        $pdf->Cell(0, 0.5, $rodape, 0, 1, 'C');
        $rodape = 'www.cartoriopostal.com.br';
示例#20
0
文件: fp.php 项目: sipsenachi/rep
require 'fpdf.php';
//create a FPDF object
$pdf = new FPDF();
//set document properties
$pdf->SetAuthor('CORCIOVA ENACHI');
$pdf->SetTitle('FISA PARTIDEI');
//set font for the entire document
$pdf->SetFont('Helvetica', 'B', 10);
//$pdf->SetTextColor(50,60,100);
//set up a page
$pdf->AddPage('P');
//$pdf->SetDisplayMode(real,'default');
//display the title with a border around it
//$pdf->SetXY(50,20);
//$pdf->SetDrawColor(50,60,100);
$pdf->Write(7, 'CASA DE AJUTOR RECIPROC A PENSIONARILOR DIN FOCSANI SI JUDETUL VRANCEA');
//$pdf->Ln(2);
$pdf->SetFont('Helvetica', 'B', 12);
$pdf->SetXY(10, 15);
//$pdf->Ln(3);
$s = " ";
$r2 = $s . "Partida nr:  " . $par . "  Nume:    " . $nume . "  CNP: " . $cnp;
$pdf->Write(7, $r2);
$pdf->SetFont('Helvetica', 'B', 10);
$pdf->SetXY(10, 20);
$r3 = $s . "CI/BI: " . $ser . "  " . $nr . " Elib  " . $delib . "  Pol.   " . $pol . "  din  " . $loca . "  Adresa: " . $adr;
$pdf->Write(7, $r3);
//$pdf->Write(7,'C.E.C.nr. ');
//$pdf->Write(7,$decp);
$r4 = $s . "Data inscrierii:  " . $dins . "  Sectia credit:  " . $discre . "  Sotul:  " . $sot . "  Sectia deces: " . $disdec;
$pdf->SetFont('Helvetica', 'B', 10);
示例#21
0
// Set some document variables
$author = "Me McMe";
$x = 50;
$text = <<<EOT
facilisis Praesent ultricies vitae, placerat dapibus, turpis commodo morbi tristique erat et amet egestas. faucibus, lacus Quisque amet, est amet erat. facilisis. Aliquam eget, quam tincidunt ipsum sagittis eros vitae eu Vestibulum cursus dui pharetra. erat metus condimentum felis. pulvinar Vestibulum ac habitant neque rutrum feugiat quam, leo. elit tincidunt id Pellentesque sapien sit condimentum, accumsan vitae, eu egestas eget tortor turpis sit dui. neque wisi. ultricies Nam augue, est. porttitor, et eu fermentum, egestas ac ullamcorper tortor enim ante. netus eros luctus, malesuada amet, magna orci, Aenean in vulputate libero quis, non sit Mauris wisi, volutpat. sed, tempus et eleifend fames Donec sit semper. Aenean mi mi, ornare enim tempor Ut Donec senectus.
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, $text);
示例#22
0
// 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') {
        $pdf->SetFont('Times', 'B', 16);
        $pdf->SetTextColor(255, 0, 0);
        $pdf->Write(5, utf8_decode('*'));
    }
    // Schriftfarbe setzen
    $pdf->SetTextColor(0, 0, 0);
    // Schriftart festlegen
    $pdf->SetFont('Times', '', 11);
    $pdf->Write(5, utf8_decode(sprintf(', %s', $mitglied['vorname'])));
    if ($mitglied['fl_dienst_absprache'] == 'J') {
        // neue Position auf der X-Achse
        $pdf->SetX(80);
        // Schriftart festlegen
        $pdf->SetFont('Times', 'B', 11);
示例#23
0
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;
}
示例#24
0
$mypasswdtxtdir = $partwampp . "\\security\\" . $mypasswdtxt;
if (file_exists($mypasswdtxtdir)) {
    $mypasswd = file_get_contents($mypasswdtxtdir);
    preg_match('/mysql password = (.*)/', $mypasswd, $mypasswd);
    $mypasswd = trim($mypasswd[1]);
} else {
    $mypasswd = "";
}
if ($_REQUEST['action'] == "getpdf") {
    mysql_connect("localhost", "root", $mypasswd);
    mysql_select_db("cdcol");
    include 'fpdf/fpdf.php';
    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->SetFont('Helvetica', '', 14);
    $pdf->Write(5, 'CD Collection');
    $pdf->Ln();
    $pdf->SetFontSize(10);
    $pdf->Write(5, '© 2002/2003 Kai Seidler, oswald@apachefriends.org, GPL');
    $pdf->Ln();
    $pdf->Ln(5);
    $pdf->SetFont('Helvetica', 'B', 10);
    $pdf->Cell(40, 7, $TEXT['cds-attrib1'], 1);
    $pdf->Cell(100, 7, $TEXT['cds-attrib2'], 1);
    $pdf->Cell(20, 7, $TEXT['cds-attrib3'], 1);
    $pdf->Ln();
    $pdf->SetFont('Helvetica', '', 10);
    $result = mysql_query("SELECT titel,interpret,jahr FROM cds ORDER BY interpret");
    while ($row = mysql_fetch_array($result)) {
        $pdf->Cell(40, 7, $row['interpret'], 1);
        $pdf->Cell(100, 7, $row['titel'], 1);
示例#25
0
<?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: codewarrior');
    $pdf->Ln();
    $pdf->Ln(5);
    $pdf->SetFont('Helvetica', 'B', 10);
    $pdf->Cell(50, 7, 'Full Name', 1);
    //$pdf->Cell(30 ,7, 'Last 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 ORDER BY info_id DESC");
    while ($row = mysql_fetch_array($result)) {
        $pdf->Cell(50, 7, $row['fname'] . " " . $row['lname'], 1);
        //$pdf->Cell(30, 7, $row['nname'], 1);
        $pdf->Cell(35, 7, $row['mobile'], 1);
        $pdf->Cell(35, 7, $row['home_phone'], 1);
        $pdf->Cell(35, 7, $row['work_phone'], 1);
        $pdf->Ln();
//set document properties
$pdf->SetAuthor('Alexandr Slovinskiy');
$pdf->SetTitle('Order Annex');
//set font for the entire document
$pdf->AddFont('Times', '', 'times.php');
$pdf->SetFont('Times', '');
$pdf->SetTextColor(0, 0, 0);
//set up a page
$pdf->AddPage('L');
$pdf->SetDisplayMode(real, 'default');
//display the title with a border around it
//Set x and y position for the main text, reduce font size and write content
$pdf->Image('img/form_1-12-2.jpg', 10, 15, 280);
$pdf->SetFontSize(9);
$pdf->SetXY(261, 29.5);
$pdf->Write(5, $_POST["order_number"]);
$pdf->SetXY(197.5, 37);
$pdf->Write(5, $_POST["day"]);
$pdf->SetXY(205, 37);
$pdf->Write(5, $_POST["month"]);
$pdf->SetXY(225.4, 37);
$pdf->Write(5, substr($_POST["year"], 2, 2));
$pdf->SetXY(196, 63);
if ($_POST["search_finance"] == 'b') {
    $pdf->Write(5, "за державним замовленням");
}
if ($_POST["search_finance"] == 'c') {
    $pdf->Write(5, "за рахунок коштів фізичних, юридичних осіб");
}
$pdf->SetXY(222, 51.5);
$pdf->Write(5, strtolower($_POST["search_study_type"]));
示例#27
0
<?php

include 'db.php';
require 'fpdf.php';
if (!empty($_GET['list'])) {
    $list = $_GET['list'];
    $query = mysqli_query($link, "SELECT * FROM lists WHERE id = {$list}");
    $list = mysqli_fetch_array($query);
    $title = $list['title'];
    $description = $list['description'];
    $date = $list['date'];
    $image = "images/uploads/listings/" . $list['image'];
    $pdf = new FPDF();
    //var_dump(get_class_methods($pdf));
    $pdf->AddPage();
    $pdf->SetFont("Arial", "", "14");
    $pdf->Cell(0, 10, "{$title}\n - {$date}", 1, 1, "C");
    $pdf->Ln(10);
    $pdf->SetFont('Arial', '', "10");
    $pdf->Write(5, "{$description}");
    $pdf->Ln(10);
    $pdf->Image('' . "{$image}" . '', 50);
    $pdf->Output();
} else {
    header('Location: categories.php');
    die;
}
if ($nbses > 0) {
    while ($rowS = mysqli_fetch_array($rowsession)) {
        ///recuperer la liste des dates
        $ids = $rowS["id_session"];
        $db = mysqli_connect($host, $userdb, $passdb, $database);
        $sqldates = "SELECT `date_session` FROM `tab_session_dates` WHERE `id_session` ='" . $ids . "'";
        $rowsdates = mysqli_query($db, $sqldates);
        mysqli_close($db);
        $nbrdates = mysqli_num_rows($rowsdates);
        for ($f = 0; $f < $nbrdates; $f++) {
            $rowd = mysqli_fetch_array($rowsdates);
            $dates = $dates . getDatefr($rowd["date_session"]) . "\n";
        }
        $courrier->SetFont('SourceSansPro-Semibold', '', 12);
        $titre = $rowS['session_titre'] . " : ";
        $courrier->Write(7, $titre);
        $courrier->Ln();
        $courrier->SetFont('SourceSansPro-LightItalic', '', 12);
        $courrier->Write(5, $rowS['session_detail']);
        $courrier->Ln(7);
        $courrier->SetFont('SourceSansPro-Regular', '', 12);
        $courrier->SetX(30);
        $courrier->Multicell(0, 5, $dates, 0, 'L', false);
        $courrier->Ln();
        $dates = "";
    }
} else {
    $courrier->Write(5, html_entity_decode("Vous n'&ecirc;tes inscrit &agrave; aucune session actuellement."));
}
$courrier->Ln(15);
//****Liste d'attente aux ateliers
示例#29
0
    $pdf->SetLineWidth(0.05);
    $pdf->SetTextColor(255, 255, 255);
    $wb = $w;
    $pdf->Cell(25, 5, $w, "LR", 0, "C", 1);
    $pdf->Cell(25.1, 5, $wb * 11, "LR", 0, "C", 1);
    $pdf->Cell(25.2, 5, $wb * 13, "LR", 0, "C", 1);
    $pdf->Cell(25.3, 5, $wb * 17, "LR", 0, "C", 1);
    $pdf->Cell(25.4, 5, $wb * 19, "LR", 0, "C", 1);
    $pdf->Cell(25.5, 5, $wb * 23, "LR", 0, "C", 1);
    $pdf->Cell(25.6, 5, $wb * 31, "LR", 0, "C", 1);
    $pdf->Ln();
}
$pdf->Ln();
$pdf->Ln();
$pdf->SetFillColor(160, 20, 123);
$pdf->SetTextColor(1, 300, 1);
$pdf->Write(10, "Go to VitoshAcademy", "http://www.vitoshacademy.com");
$pdf->Ln();
$pdf->SetFillColor(123, 440, 120);
$pdf->SetTextColor(100, 0, 0);
$pdf->Write(10, "More PHP here", "http://www.vitoshacademy.com/?s=php&submit=Go");
$pdf->SetY(-40);
$pdf->Cell(0, 10, "Anything is possible. In any color.", "T", "1", "C");
$pdf->Output("certificate.pdf");
echo "Your certificate is generated!";
?>

</body>
</html>

示例#30
-1
$pdf->SetXY(135, 40);
$pdf->Cell(30, 10, $fecha, 1, 0, 'C');
$pdf->SetXY(144, 55);
$pdf->Cell(1, 10, $idproveedor, 0, 0, 'R');
$pdf->Ln();
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(30, 10, 'Codigo', 1, 0, 'C');
$pdf->Cell(55, 10, 'Nombre', 1, 0, 'C');
$pdf->Cell(18, 10, 'Cantidad', 1, 0, 'C');
$pdf->Cell(20, 10, 'Valor', 1, 0, 'C');
$pdf->Cell(30, 10, 'Total', 1, 1, 'C');
$pdf->SetFont('Arial', '', 10);
while ($resultado = mysql_fetch_array($consulta)) {
    $pdf->Cell(30, 10, $resultado["id"], 1, 0, 'C');
    $pdf->Cell(55, 10, $resultado["nombre"], 1, 0, 'C');
    $pdf->Cell(18, 10, $resultado["cantidad"], 1, 0, 'C');
    $pdf->Cell(20, 10, $resultado["valor"], 1, 0, 'C');
    $total = $resultado["cantidad"] * $resultado["valor"];
    $pdf->Cell(30, 10, $total, 1, 1, 'C');
}
$pdf->Ln();
$pdf->Cell(150, 5, 'Total: ' . $totalsiniva, 0, 1, 'R');
$pdf->Cell(150, 5, 'Iva: ' . $iva, 0, 1, 'R');
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(150, 5, 'Total: ' . $totalconiva, 0, 1, 'R');
$pdf->SetFont('Arial', '', 10);
$pdf->Ln();
$pdf->Write(6, 'Elaborado por: ');
$pdf->Write(6, $encargado);
$pdf->Output();