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.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-10-10 11:00:00 +0000
Seen: 7 times
Last updated: Mar 29 '22
How can I set up Gunicorn with a Django Project?
Looking for a Python Module that finds Tags for a Text describing its Content
Need a Function in Python to remove entries less than 2 digits from an Array
How can I convert a Document in Python?
How can I program a Loop in Python?
How can I enable Python Code Highlighting in Askbot?