I'm creating a PDF file in PHP:
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=\"file.pdf\"");
echo "Hello";
The downloaded file.pdf
was not able to open. It says "Adobe Reader could not open the file because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)".
But when opening the file with a text editor, only "hello" is there within the file. It looks as if it's not encoded correctly as a PDF. Any help please?