What are some common pitfalls when using fpdf for generating PDFs in PHP?

One common pitfall when using fpdf for generating PDFs in PHP is forgetting to set the content-type header before outputting the PDF. This can result in corrupted PDF files or unexpected behavior when trying to download or view the generated PDF. To solve this issue, make sure to set the content-type header to "application/pdf" before outputting any PDF content.

header('Content-Type: application/pdf');