[reportlab-users] Page background image with Platypus?

Erik Wickstrom erik at erikwickstrom.com
Fri Oct 5 13:41:42 EDT 2007


I'm trying to use an image as a background for my pdf. The image is large
enough to cover the page. It seems to work fine when printing straight to
the canvas with "p.drawImage('/root/journal/gazette/paper1.png', 0, 0,
width=None, height=None, mask=None)" but I need to use Platypus.

"elements.append(Image('/root/journal/gazette/paper1.png'))" just results is
the following traceback.

Traceback (most recent call last):
File "/usr/local/lib/python2.4/site-packages/django/core/handlers/base.py"
in get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "/root/journal/gazette/views.py" in some_view
72. doc.build(elements)
in build
911. BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)
in build
740. self.handle_flowable(flowables)
in handle_flowable
671. raise LayoutError(ident)

LayoutError at /gazette/test/
Flowable <Image at -0x4950c374 frame=normal
filename=/root/journal/gazette/paper1.png> too large on page 2

What am I doing wrong?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071005/06345ac5/attachment.html>

More information about the reportlab-users mailing list