question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

make pdf for sphinx-build fails with LayoutError in reportlab/platypus/doctemplate.py

See original GitHub issue

I can build each individual .rst file using “rst2pdf <file>.rst” and get .pdf file. However when running “make pdf” I get:

[ERROR] pdfbuilder.py:130 More than 10 pages generated without content - halting layout.  Likely that a flowable is too large for any frame.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf/pdfbuilder.py", line 127, in write
    docwriter.write(doctree, destination)
  File "/usr/local/lib/python2.7/dist-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf/pdfbuilder.py", line 621, in translate
    compressed=self.compressed)
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf/createpdf.py", line 653, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/local/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 1125, in multiBuild
    self.build(tempStory, **buildKwds)
  File "/usr/local/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 1038, in build
    self.handle_flowable(flowables)
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf/createpdf.py", line 801, in handle_flowable
    self.handle_frameEnd()
  File "/usr/local/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 689, in handle_frameEnd
    self.handle_pageEnd()
  File "/usr/local/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 632, in handle_pageEnd
    raise LayoutError(ident)
LayoutError: More than 10 pages generated without content - halting layout.  Likely that a flowable is too large for any frame.
FAILED

Where should I look, or what should I try next? Versions:

$ sphinx-build --version
sphinx-build 1.7.6

# ls /usr/local/lib/python2.7/dist-packages/{rst2pdf,reportlab}*.dist-info
/usr/local/lib/python2.7/dist-packages/reportlab-3.5.4.dist-info:
INSTALLER  METADATA  RECORD  top_level.txt  WHEEL

/usr/local/lib/python2.7/dist-packages/rst2pdf-0.93.dev_r0.dist-info:
dependency_links.txt  entry_points.txt  METADATA       RECORD         WHEEL
DESCRIPTION.rst       INSTALLER         metadata.json  top_level.txt

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
akrabatcommented, Aug 24, 2018

Usually, “more than 10 pages generated without content” occurs when an image is too large and isn’t being scaled or there’s a really large block of text or a table that can’t fit onto one page or be wrapped.

In this case, as you can build each rst file, I’m confused! Maybe try building just 2 rst files with make and then add each rst file until you find which one it’s upset with?

0reactions
sachin-suresh-rapyutacommented, Aug 5, 2022

I have used pdf_use_index = False and still get the same error. I also tried to remove the width: attribute in the img.

Here is my error trace:

[ERROR] pdfbuilder.py:161 Failed to build doc
Traceback (most recent call last):
  File "/home/sachin/.local/lib/python3.8/site-packages/rst2pdf/pdfbuilder.py", line 158, in write
    docwriter.write(doctree, destination)
  File "/home/sachin/.local/lib/python3.8/site-packages/docutils/writers/__init__.py", line 78, in write
    self.translate()
  File "/home/sachin/.local/lib/python3.8/site-packages/rst2pdf/pdfbuilder.py", line 697, in translate
    createpdf.RstToPdf(
  File "/home/sachin/.local/lib/python3.8/site-packages/rst2pdf/createpdf.py", line 689, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 1143, in multiBuild
    self.build(tempStory, **buildKwds)
  File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 1056, in build
    self.handle_flowable(flowables)
  File "/home/sachin/.local/lib/python3.8/site-packages/rst2pdf/createpdf.py", line 862, in handle_flowable
    self.handle_frameEnd()
  File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 709, in handle_frameEnd
    self.handle_pageEnd()
  File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 651, in handle_pageEnd
    raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: More than 10 pages generated without content - halting layout.  Likely that a flowable is too large for any frame.
Read more comments on GitHub >

github_iconTop Results From Across the Web

while creating pdf for repaortlab layout error - Stack Overflow
I make a PDF(A4) size for it and got the error, while I enter code here make A3 for it the problem is...
Read more >
Sphinx PDFs with Unicode - Read the Docs
By default Sphinx uses pdflatex , which does not have good support for Unicode characters and may make the PDF builder fail. To...
Read more >
Create and Modify PDF Files in Python
In this tutorial, you'll explore the different ways of creating and modifying PDF files in Python. You'll learn how to read and extract...
Read more >
Why am I getting the error message “Failed to Load PDF ...
Even if Adobe Acrobat Reader is already installed on your computer, if another program (like Chrome) tries to open the file you will...
Read more >
Technical PDF Related Questions | Central District of California
Why am I receiving an Internal Server Error when e-filing a PDF document? ... How do you start the Adobe Acrobat Reader program...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found