another example : PHP 5 & PDFLIB 6.0.2
<?
$pdf = pdf_new();
if (pdf_begin_document($pdf,"", "") == 0)
{die("Error: " . pdf_get_errmsg());}
pdf_set_parameter($pdf, "SearchPath", "./");
pdf_set_parameter($pdf, "hypertextencoding", "winansi");
pdf_set_parameter($pdf, "imagewarning", "false");
pdf_set_info($pdf, "Creator", "some INformations");
pdf_set_info($pdf, "Author", "author");
pdf_set_info($pdf, "Title", "Raport");
$logo = pdf_open_image_file($pdf, "jpeg", "foto.jpg", "", 0);
pdf_begin_page($pdf, 595, 842);
pdf_place_image($pdf, $logo, 28, 324, 0.125);
pdf_close_image($pdf, $logo);
pdf_end_page($pdf);
pdf_close($pdf);
$buf = pdf_get_buffer($pdf);
$len = strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: attachment; filename=raport.pdf");
echo $buf;
?>