TCPDF: Add Pagebreak within HTML Code

TCPDF: Add Pagebreak within HTML Code

Today I'd like to tell you about a simple trick, if you use TCPDF and work with HTML to PDF functionality.

Sometimes you would wish to create new page and continue your content there. Simply a pagebreak.

If you don't have the $pdf object available and want to do everything in code, you may use the HTML Element to control this behaviour.

Simply add <tcpdf method="AddPage" /> to your HTML content and a pagebreak will happen!

Please leave a comment if that trick saved your day ;)

<tcpdf method="AddPage" />



It works :D

Hi, it is working. Thanks for your post.