PHP : Function Reference : PDF Functions : PDF_set_info
Examples ( Source code ) » PDF_set_info
<?php
//Create & Open PDF-Object
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_set_info($pdf, "Author","Bob Nijman");
pdf_set_info($pdf, "Title","www.nijman.de");
pdf_set_info($pdf, "Creator", "bob@nijman.de");
pdf_set_info($pdf, "Subject", "pdf_open_image_file");
pdf_begin_page($pdf, 200, 200);
$pdfimage = pdf_open_image_file($pdf, "jpeg", "test.jpg");
pdf_place_image($pdf, $pdfimage, 10, 10, 0.6);
//close it up
pdf_end_page($pdf);
pdf_close($pdf);
$data = pdf_get_buffer($pdf);
header('Content-type: application/pdf');
header('Content-disposition: inline; filename=image.pdf');
header('Content-length: ' . strlen($data));
echo $data;
?>
mrmueller
If the first example does'nt show the correct dcoument property in Acrobat Reader, you should change first letters of the paramentes in capital letter. Instead "author" you should type "Author"...
// $pdf is the name of the pdf ducoment you created.
pdf_set_info($pdf, "Author", "Ahmed");
pdf_set_info($pdf, "Title", "PDF tutorial");
pdf_set_info($pdf, "Subject" , "PDF tutorial");
pdf_set_info($pdf, "Creator", "phpnet");
|