This is the code - it is out of a book i'm using as i'm trying to learn how to create pdfs on the fly. I've got my system administrator to install pdflib
<?php
//create a pdf document in memory
$pdf = pdf_new();
pdf_open_file($pdf, '');
pdf_set_info($pdf, "Creator", "pdftest.php");
pdf_set_info($pdf, "Author", "Luke Welling and Laura Thomson");
pdf_set_info($pdf, "Title", "Hello World");
pdf_begin_page($pdf, 8.572, 1172);
//add a bookmark
pdf_add_bookmark($pdf, 'Page 1', 0, 0);
$font = pdf_findfont($pdf, 'Times-Roman', 'host', 0);
pdf_set_font($pdf, $font, 24);
pdf_set_text($pdf, 50, 700);
//write text
pdf_show($pdf, 'Hello, world!');
pdf_continue_text($pdf, '(says PHP)');
//end the document
pdf_end_page($pdf);
pdf_close($pdf);
$data = pdf_get_buffer($pdf);
//generate headers
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename=tet.pdf');
header('Content-Length: ' . strlen($data));
//output pdf
echo $data;
?>