abumandour
abumandour

Reputation: 1369

How to have multi-page table row cells converted properly using rst2pdf Shpinx?

I have a table of which one-row cell has so much data that it could span multiple pages in the finally-generated PDF file. rst2pdf ungracefully fails when I feed it my file, with the following output:

[ERROR] pdfbuilder.py:161 Failed to build doc
Traceback (most recent call last):
  File "/home/pwng/.local/lib/python3.9/site-packages/rst2pdf/pdfbuilder.py", line 158, in write
    docwriter.write(doctree, destination)
  File "/usr/lib/python3/dist-packages/docutils/writers/__init__.py", line 78, in write
    self.translate()
  File "/home/pwng/.local/lib/python3.9/site-packages/rst2pdf/pdfbuilder.py", line 697, in translate
    createpdf.RstToPdf(
  File "/home/pwng/.local/lib/python3.9/site-packages/rst2pdf/createpdf.py", line 689, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 1167, in multiBuild
    self.build(tempStory, **buildKwds)
  File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 1080, in build
    self.handle_flowable(flowables)
  File "/home/pwng/.local/lib/python3.9/site-packages/rst2pdf/createpdf.py", line 859, in handle_flowable
    self.handle_frameEnd()
  File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 726, in handle_frameEnd
    self.handle_pageEnd()
  File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 668, 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.
FAILED
build succeeded.

and make latexpdf produce undesirable output depicted in the following screenshot.

enter image description here

Is there a way to remedy this problem using either latexpdf or rst2pdf? Ideally, I would like a solution that works for both spaced text (i.e. space-separated words) and consecutive, wrapped non-separated text.

Upvotes: 0

Views: 276

Answers (1)

Lorna Mitchell
Lorna Mitchell

Reputation: 1986

This isn't the answer you want, but rst2pdf won't split the cell across pages, so if it doesn't fit onto the page, it won't be able to generate the document. The project (I'm a maintainer) is open to patches, in case you end up fixing it yourself. I'm not aware of a workaround, other than reformatting the content to be more printable.

Upvotes: 0

Related Questions