Search code examples
phppdffpdf

update php version pdf error


I try to update the version of php on my server from 5.3 to 5.5. I have one last bug with pdf. When I try to print a pdf (the same pdf that works in 5.3), the pdf doesn't open on the screen. I have this error: Invalid XRef stream header. The response type is already change in my php file to this 'application/pdf'. I am using fpdf to generate my pdf. Have you an idea of the problem to help me.


Solution

  • Just add this line "ob_end_clean();" before $pdf->Output(); and also check this link