chrisglass/xhtml2pdf — Issue #41: Crash with images bigger than page height
Author: frol
Created: 2012-03-07 20:53:41+00:00
State: open

If I have two or more images in HTML with sum height bigger than pdf page height, then I have crash in reportlab! I'm not really know where is reportlab issues list, so I write it here, may be someone fix this bug.

Here is example HTML, which crashes:
```

```

Python-code:
```
pdf = pisa.pisaDocument(_content, pdf_file, raise_exception=False)
```

Traceback:
```
File "/mnt/storage/projects/escalibro/project/apps/poetry/utils/html2pdf.py", line 9, in convert
pdf = pisa.pisaDocument(_content, pdf_file, raise_exception=False)
File "/mnt/storage/projects/escalibro/env/local/lib/python2.7/site-packages/xhtml2pdf/document.py", line 131, in pisaDocument
doc.build(context.story)
File "/mnt/storage/projects/escalibro/env/local/lib/python2.7/site-packages/reportlab/platypus/doctemplate.py", line 888, in build
self.handle_flowable(flowables)
File "/mnt/storage/projects/escalibro/env/local/lib/python2.7/site-packages/reportlab/platypus/doctemplate.py", line 801, in handle_flowable
raise LayoutError(ident)
LayoutError: Flowable (538.582677165 x 786.005338766) too large on page 2 in frame 'body'(538.582677165 x 785.196850394*) of template 'body'
```

Here is converted PDF with changed height of second image to 670px instead of 675px: http://bb.escalibro.com/other/reportlab_bug.pdf