Ok i have been using a tutorial on creating pdf files with php and its outputting alright but i cant figgure out how to do the header(); code that it says to use plz help....
This is what im having problems with (what do i do?)
header("Content-type: application/pdf");
header("Content-Length: ".strlen($buffer));
header("Content-Disposition: inline; filename=zend.pdf");
This is my whole code...
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!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">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
/* ********************************************* */
/* This PHP PDF Script was written by Tom Lynch */
/* To use this script you must obtain permission */
/* from the author. */
/* Email: [email]tom@unknowndomain.co.uk[/email] */
/* ********************************************* */
/* Set pdf variable */
$pdf = PDF_new();
PDF_open_file($pdf);
/* Set pdf author information */
PDF_set_info($pdf, "author", "Tom Lynch");
PDF_set_info($pdf, "title", "Example");
PDF_set_info($pdf, "creator", "Tom Lynch");
PDF_set_info($pdf, "subject", "Example of PHP creation of a PDF file");
/* Set Page Size - Postscript points = 72 in an inch*/
PDF_begin_page($pdf, 450, 450);
/* Set Font */
$font = PDF_findfont($pdf, "Helvetica-Bold", "winansi", 0);
PDF_setfont($pdf, $font, 12);
/* Page Contents */
PDF_show_xy($pdf, "Hello, Dynamic PDF's!", 5 , 225);
/* End Page */
PDF_end_page($pdf);
/* Close PDF */
PDF_close($pdf);
/* Output PDF */
$buffer = PDF_get_buffer($pdf);
header("Content-type: application/pdf");
header("Content-Length: ".strlen($buffer));
header("Content-Disposition: inline; filename=zend.pdf");
echo $buffer;
/* Clean Up */
PDF_delete($pdf);
?>
</body>
</html>