i can't open pdf -file after creating new one. i think it's some header problem, but i have no idea how to solve it.
end of cration code is:
.... PDF_end_page($p);
PDF_close($p);
$buf = PDF_get_buffer($p);
$len = strlen($buf);
/* i tried also with octet-stream */
// header ("Content-type: application/octet-stream");
header ("Content-type: application/pdf");
header ("Content-length:".$len);
$thefile = "newPdf.pdf";
header ("Content-Disposition: inline; filename=".$thefile);
$fp2 = "../generated_pdfs/".$thefile;
copy("../generated_pdfs/temp.pdf",$fp2);
when i'm trying to open newPdf.pdf with Acrobat reader 6, i get error:
Adobe reader could not open newPdf.pdf because it's either not a supported file type or because file has been corrupted