I have tried moving that line everywhere and the closest I get is with the following code and it just spits out a blank browser page! What gives? Sorry, Im new to this and am being pushed to get it working. Here is my code thus far.
<?
header("Content-type: application/pdf");
header("Content-Length: ".strlen($buffer));
header("Content-Disposition: inline; filename=chairitable_reciept.pdf");
//start the pdf
$pdf = PDF_new();
PDF_open_file($pdf);
//set up some stuff
PDF_set_info($pdf, "author", "Brad Taylor");
PDF_set_info($pdf, "title", "testing pdf");
PDF_set_info($pdf, "creator", "Brad Taylor");
PDF_set_info($pdf, "subject", "testing pdf");
//set page size
PDF_begin_page($pdf, 450, 700);
$font = PDF_findfont($pdf, "Helvetica-Bold", "winansi",0);
PDF_setfont($pdf, $font, 12);
PDF_show_xy($pdf, "Hello, this is a test of php to pdf", 5, 225);
//end the document
PDF_end_page($pdf);
PDF_close($pdf);
$buffer = PDF_get_buffer($pdf);
echo $buffer;
PDF_delete($pdf);
?>
any help with the code above would save me an ear full!! 😃