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

deepak379's avatar

Auto page break in dompdf is not working fine need help.

some text here...

Some space


page break

then some text again

the problem is why is ther some space before page break.This is not working in some places but working fine in some places

0 likes
1 reply
aurawindsurfing's avatar

Hey @deepak379

Add this at the end of your html it will always produce new page after it, omit it in your last page:

<div style="page-break-after:always;">

Hope it helps!

1 like

Please or to participate in this conversation.