Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shing_shing's avatar

TCPDF - Footer and Main content overlapping

Good day, Laracasts!

I actually tried using dompdf but I still got the same issue, so am gonna stick with TCPDF.

I have set a footer (since it appears in every page), yes and it was so easy. Please click the link below to view footer when main content isn't overflowing. https://drive.google.com/file/d/1kwFj8A9YWG8UM3RgJBCaW-Uv5aKoRzQO/view?usp=sharing

When the main content is overflowing, click this link to check what it looks like https://drive.google.com/file/d/1m6RKggua3LtSVoE1X2UKq5ul1wc6mRhr/view?usp=sharing

0 likes
4 replies
shing_shing's avatar

Okay, I just found myself a solution based on my realization, I set the <body> tag's margin-bottom. Now my only problem is my header.

I have an image in my header. It doesn't appear in the following pages.

shing_shing's avatar

Yep, Image on header solved.

I put the image on my custom tcpdf header class.

I didn't do this earlier because, I will surely be in trouble later for some reasons. Putting the image on a table <thead> is way more convenient for me to automatically display it every page.

Please or to participate in this conversation.