This question has been raised hundred of times in various fora; some have been solved, some not. I checked plenty of resources, but my issue could not be resolved. I am gene
Most probably there's a whitespace or new line somewhere in your code causing this. Here's a simple way to debug it:
echo "end!";exit;
Another possibility is that you are using a language string somewhere that introduces an unprintable character. If your application is multilingual, make sure you're testing using english
Be sure your editor does not add a Unicode Bom description - save code to file by Notepad, or (if you work in Dreamweaver) remove check by Asign Unicode Signature (BOM) or something. ;)
I tried to echo out, but no white spaces or line breaks were found. At the end, I redirected the php to another page instead of PHP_SELF and the problem vanished. I did not alter any code. Looks like presence of html tags after the php ended was the offending factor.
I came across this issue. You want to check all the variables you are using. One or even more than one variable you are passing comes empty and is messing the render.
Start gradually, by getting rid of all the php
and try to generate the pdf, then if it works for you add code block by block.
This will help you identify where the problem is.