Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reportlab LayoutError: Flowable Spacer too large #4

Open
kouroshparsa opened this issue Feb 19, 2016 · 0 comments
Open

reportlab LayoutError: Flowable Spacer too large #4

kouroshparsa opened this issue Feb 19, 2016 · 0 comments

Comments

@kouroshparsa
Copy link

With reportlab 3.2.0, I get

SPACER = Spacer(0, 10)
buff = BytesIO()
doc = SimpleDocTemplate(buff, rightMargin=0.2 * inch,
                        leftMargin=0.2 * inch,\
                        topMargin=100, bottomMargin=68)
elements = []
# here add elements
elements.append(SPACER)
# here add more elements
doc.build(elements)

I sometimes get this exception:

File "/venv/lib/python2.7/site-packages/reportlab/platypus/doctemplate.py", line 1171, in build
    BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)
  File "/venv/lib/python2.7/site-packages/reportlab/platypus/doctemplate.py", line 927, in build
    self.handle_flowable(flowables)
  File "/venv/lib/python2.7/site-packages/reportlab/platypus/doctemplate.py", line 829, in handle_flowable
    raise LayoutError(ident)
LayoutError: Flowable <Spacer at 0x4c87d40 frame=normal>...(0 x 10) too large on page 2 in frame 'normal'(554.475590551 x 661.88976378) of template 'Later'

This is happening when trying to insert the SPACER near the bottom of the page.
Increasing bottomMargin would avoid the exception meaning that whenever
SPACER height * character height >= doc.bottomMargin
the reporter might fail if the space is close to the bottom of the page.
discussed:
http://stackoverflow.com/questions/35494584/reportlab-layouterror-flowable-spacer-too-large/35516604#35516604

The expected behavious is that it should not fail. It should somehow handle that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant