PHP TCPdf 防止内容溢出时分页

PHP TCPdf prevent page break if content overflows

有没有办法防止内容溢出时分页?

我想隐藏溢出的内容而不是创建新页面。

您可以使用TCPDF::SetAutoPageBreak()方法打开自动分页:

来自文档:

SetAutoPageBreak( $auto, $margin = 0 )

Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.

https://tcpdf.org/docs/srcdoc/tcpdf/class-TCPDF/