Monthly Archives: July 2009

Get started generating PDF’s today! Part 1 – installation

FPDF

FPDF describes itself as

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

Installation

  • Download the library and place it in a directory accessible by your web server

    It generally makes sense to put it in an includes directory.

  • Include it in your web application
/* sample web app */
//include the FPDF library
require_once('includes/fpdf.php');
  • Create the page
//instantiate the object
$fpdf = new FPDF();

//create a page
$fpdf->AddPage();

//set the font, font-style, and size
$fpdf->SetFont('Arial', 'B', 14);

//create the text to be output and go to the next line
$fpdf->Cell(22, 12, "Randy Dustin", 0,1);
//the next line
$fpdf->Cell(22, 12, "Pretty much the coolest person on Earth!");

//create the page
$fpdf->Output();

For more information and tutorials on building pdfs you can go to the FPDF website and reference their tutorials and the manual

We will be continuing this series soon with a closer look at our options when creating a page. Some things to look for are:

  • Changing page orientation and size
  • Changing Font styles
  • Changing the size and style of text cells
  • The different options for saving the final product

Read Part 2 – playing with the options

Miscellaneous Billing: eliminating errors & simplifying the interface

Background

Miscellaneous Billing is used by many departments on Plymouth State’s campus to initiate charges to individuals. The charges can range from Health Services to Residence Hall Damages and are logged in an Oracle table to be accessed and processed by the Bursar.

The Problems

  1. The original system was built in Microsoft Access – having a separate application for each department. This was a maintenance nightmare.
  2. It was extremely easy to charge the wrong individual.
  3. Making adjustments/reversing charges was very complex and error prone.

Problems Solved!

  1. The original plan was to replace the Residential Life Misc Billing application with a web interface; however, when I approached ITS with the idea they asked me to write it to replace all departmental Misc Billing apps. My task was to create the User Interface (UI) that would be used across campus. Any changes that need to be made can be made in one place for all departments. Problem Solved!

  2. The Access version consisted of a form within a form. The outer form contained an alphabetical list of people and always defaulted to the first person on the list. The problem was that users often forgot to select the person they wanted and ended up billing the default person. If the mistake was noticed soon enough, the charge could be removed and re-entered for the correct person. If not, the wrong person could end up with a bill.

    I created the new interface so that the user can enter a student’s name or ID number and return the correct person (see Figure 1 below). Once the user has entered the person’s name the page returns a list of possible people with that name or ID. The user then clicks the correct person to continue the billing process (see Figure 2 below). Problem Solved!

    The search screen of the Misc Billing app
    Figure 1: The search screen of the Misc Billing app

    Figure 2: The results of the search - in this case the correct name was returned
    Figure 2: The results of the search - in this case the correct name was returned
  3. The old application only allowed the user to view one bill at a time which meant that the user had to click through each record to find the one they wanted to reverse. Also, the user had to check to see if the charge had been processed by the Bursar to determine how they needed to proceed. Problem Solved!