Installing fpdf

Hi,
I am trying to install fpdf on a server with the hosting company Bluehost. fpdf is a free php class for creating pdf documents from php from http://www.fpdf.org/
There is a closed thread on this in these forums here This created a directory fpdf17 a level above my root directory which I copied to my web directory, in which is the install.txt file,

The FPDF library is made up of the following elements:

- the main file, fpdf.php, which contains the class
- the font definition files located in the font directory

The font definition files are necessary as soon as you want to output some text in a document.
If they are not accessible, the SetFont() method will produce the following error:

FPDF error: Could not include font definition file


Remarks:

- Only the files corresponding to the fonts actually used are necessary
- The tutorials provided in this package are ready to be executed

I am not sure what to do next. I tried accessing it using http://mydomain/web/fpdf17/fpdf.php
but I just get a blank page.
Do I need to change some directory path? It doesn’t actually say that in the install.txt, in fact it doesn’t say to do anything.
Thanks,
Shane

Hi,
Right I got the first tutorial to work. So i get it now.
Thanks,
Shane

Would be good to hear what the problem was and how you sorted it, in case someone else has the same issue.

Hi,
The problem was getting the tutorials to run and basically setting it up.
All I had to do was was include the FPDF.php file at the top of the page which uses this fpdf class.

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/artgibney/includes/magicquotes.inc.php';

require_once $_SERVER['DOCUMENT_ROOT'] . '/artgibney/includes/access.inc.php';

require_once $_SERVER['DOCUMENT_ROOT'] . '/artgibney/fpdf17/fpdf.php';

if (!userIsLoggedIn())
{
	include '../login.html.php';
	exit();
}

if (!userHasRole('Content Editor'))
{
	$error = 'Only Content Editors may access this page.';
	include '../accessdenied.html.php';
	exit();
}

if (isset($_GET['pdf']))
{

class PDF extends FPDF
    {
function FancyTable($header,$teachingpts)
        {
	// Colors, line width and bold font
	$this->SetFillColor(103,184,227);
	$this->SetTextColor(255);
	$this->SetDrawColor(128,0,0);
	$this->SetLineWidth(.3);
	$this->SetFont('','B');
	// Header
	$w = array(40, 40, 45);
	for($i=0;$i<count($header);$i++)
		$this->Cell($w[$i],7,$header[$i],1,0,'C',true);
	$this->Ln();
	// Color and font restoration
	$this->SetFillColor(190,216,232);
	$this->SetTextColor(0);
	$this->SetFont('');
	// Data
	$fill = false;
	foreach(array_reverse($teachingpts) as $row)
	{
		$this->Cell($w[0],6,$row['tp'],'LR',0,'L',$fill);
		$this->Cell($w[1],6,$row['code'],'LR',0,'L',$fill);
		$this->Cell($w[2],6,$row['currno'],'LR',0,'L',$fill);
		$this->Ln();
		$fill = !$fill;
	}
	// Closing line
	$this->Cell(array_sum($w),0,'','T');
         }
    }

  include $_SERVER['DOCUMENT_ROOT'] . '/artgibney/includes/db.inc.php';

  try
  {
    $result = $pdo->query('SELECT id, tp, code, currno FROM teachingpts');
  }
  catch (PDOException $e)
  {
    $error = 'Error fetching list of teachingpoints.';
    include 'error.html.php';
    exit();
  }

  foreach ($result as $row)
  {
    $teachingpts[] = array('id' => $row['id'], 'tp' => $row['tp'], 'code' => $row['code'], 'currno' => $row['currno']);
  }

$pdf = new PDF();
// Column headings
$header = array('Teaching Pts', 'Code', 'Currno');
$pdf->SetFont('Arial','',10);
$pdf->AddPage();
$pdf->FancyTable($header,$teachingpts);
$pdf->Output();
exit();
}

//the following creates an array called topics[] and populates it with the topics for display.
  include $_SERVER['DOCUMENT_ROOT'] . '/artgibney/includes/db.inc.php';

  try
  {
    $result = $pdo->query('SELECT id, tp, code, currno FROM teachingpts');
  }
  catch (PDOException $e)
  {
    $error = 'Error fetching list of teacgingpoints.';
    include 'error.html.php';
    exit();
  }

  foreach ($result as $row)
  {
    $teachingpts[] = array('id' => $row['id'], 'tp' => $row['tp'], 'code' => $row['code'], 'currno' => $row['currno']);
  }

include 'searchform.html.php';

where the HTML file a just a hyper link which sends an empty variable ‘pdf’ using $_GET
searchform.html.php

<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/artgibney/includes/helpers.inc.php'; ?>
<!DOCTYPE html>
<html lang="en">
  <head>
  <style>
table,th,td
{
border:1px solid black;
border-collapse:collapse;
}
th, td
{
padding:6px;
}
        td { width: 50px; overflow: hidden; }
</style>
    <meta charset="utf-8">
  </head>
  <body>
    <p><a href="?pdf">Generate a pdf document.</a></p>
  </body>
</html>

Thanks,
Shane