Hi all,

I am learning how to create pdf files on the fly with PHP. I am using the R&OS classes, together with Sitepoint's Harry Fuecks PHP book.

I was able to make the pdf file, but:
-in IE I get lots of weird characters, in FF it works fine. I have already reset everything, restarted, etc, doesn't work.
-My first page does not show the logo, and the text disappears when I scroll down and up again. The text on page two and three stays ok.

Can anyone help me or give me some points to look for?

Below is the code of the file:

PHP Code:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>



//Set up general info
$title 'Allthegigs.com - Concert Reviews';
$author 'Michel';
$producer 'Allthegigs.com';
$articleurl 'http://www.allthegigs.com';
$date '12 Juni 2007';

$intro file('intro.txt');
$intro implode('',$intro);

$body file('body.txt');
$body implode('',$body);

//New pdf file
$pdf = new Cezpdf();

//Add doc information

//Set size in points (1 point = 1/72 of an inch)

//Set up header and footer as recurring object
$headfoot $pdf->openObject(); //Create object
$pdf->saveState(); //Save document sate
$pdf->addJpegFromFile('../images/logo.jpg'3408137020); //Add logo
$pdf->setStrokeColor(00.20.4); //Set line color
$pdf->setLineStyle(2'round'); //set line style
$pdf->line(155.28811.89505.28811.89); //Add top line
$pdf->line(155.2830505.2830); //Add bottom line
$pdf->restoreState(); //Restore document state
$pdf->closeObject(); // Close the object

//Set up bottom link object
$bottomurl $pdf->openObject(); //Create object
$pdf->addText(155.28246'Found at: ' .$articleurl);

//Add the $headfoot object to every page
$pdf->addObject($headfoot'all'); //Add to all pages

//Add the bottom url to even pages

//Add the title page
$pdf->ezSetY(650); //Set current Y-position
$pdf->setColor(10.40); //Change text color
$pdf->ezText($title20, array('justification' => 'center'));
$pdf->restoreState(); //Color back to black
$pdf->ezSetDy(-50); //Move down 50
$pdf->ezText('by ' $author15, array('justification' => 'center')); //Author
$pdf->ezSetDy(-50); //Move down 50
$pdf->ezText("c:alink:" $articleurl ">" $articleurl "</c:alink>" 11, array ('justification' => 'center'));
$pdf->ezSetDy(-50); //Move down 50
$pdf->ezText($date13, array('justification' => 'center'));
$pdf->ezSetDy(-50); //Move down 50
$pdf->ezText($intro10, array('justification' => 'full'));
$pdf->ezNewPage(); //New page

//Start rest of document
$pdf->ezText($body10, array('justification' => 'full'));

//Display the document

if (isset(
$d) && $d){
$pdfcode $pdf->output(1);
$end_time getmicrotime();
$pdfcode str_replace("\n","\n<br>",htmlspecialchars($pdfcode));
} else {

Kind regards,