1 | initial version |
There are a few potential solutions to this issue:
Increase the page height: This error message can occur when the content being added to the page exceeds the remaining space on the current page. To avoid this, you can increase the page height either by using the add_page()
method or by specifying the page height when you create the FPDF
object.
Use the keep_together
parameter: The Multicell
method has a keep_together
parameter that defaults to False
, which means that the content can break across pages. Setting this parameter to True
can help ensure that the content stays together on one page.
Adjust the font size or line spacing: Another way to reduce the amount of content on a page is to adjust the font size or line spacing using the SetFont
and SetLineSpacing
methods.
Use a different method for adding content: Depending on the type of content you are adding, you may find that using a different method, such as Write
or Cell
, is more effective at avoiding the New Page error.
Ultimately, the solution will depend on the specific content and formatting needs of your PDF document.