What do you mean by "floating", exactly? Are you trying to draw a
watermark image on the page, behind the text? Does the image need to
flow with the text, attached to some particular word, like an <image>
tag? Does the text need to wrap around the image?
There may be a way to do what you need, but we'd need more information.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users
But associated with and/or positioned based on the position of some
specific piece of text? Like, for example, if you wanted to draw a
circle around some specific word? That kind of thing requires you to
create a custom flowable. The standard paragraph flowable looks for an
<image> tag, which allows you to embed an image at a specific point in
the text, but if you need to draw something over a specific word, you'll
have to add that yourself.
It's each to draw something at a specific point on the page (you do that
with the first/next page callbacks, where you get a canvas), but if it
depends on the final positioning of a particular word, that's tricky.
slothy Rulez a lot wrote:
>
> In front of the text, positioned like the canvas.drawImage method.But associated with and/or positioned based on the position of some
specific piece of text? Like, for example, if you wanted to draw a
circle around some specific word? That kind of thing requires you to
create a custom flowable. The standard paragraph flowable looks for an
<image> tag, which allows you to embed an image at a specific point in
the text, but if you need to draw something over a specific word, you'll
have to add that yourself.
to dIt's each raw something at a specific point on the page (you do that
with the first/next page callbacks, where you get a canvas), but if it
depends on the final positioning of a particular word, that's tricky.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users
When you call "build" on your SimpleDocTemplate, you can specify
onFirstPage and onLaterPages functions. Those are called at the
beginning of each page, and they are passed a canvas for the whole
page. They are called before drawing begins. If you need a callback
after drawing ends, you'll have to create your own page templates with
an "afterDrawPage" method. That means using BaseDocTemplate instead of
SimpleDocTemplate.
So if you want you can inherit from SimpleDocTemplate and mess with either of
those two mechanisms.
For the first you can override handle_documentBegin eg
class MyDocTemplate(SimpleDocTemplate):
def handle_documentBegin(self):
do stuff to self.pageTemplates to add onPage end etc etc
SimpleDocTemplate.handle_documentBegin(self)
alternatively and probably easier use the afterPage method
class MyDocTemplate(SimpleDocTemplate):
def afterPage(self):
do stuff to self.canv to draw your watermark
SimpleDocTemplate.afterPage(self)
then just use your derived class instead of SimpleDocTemplate
--
Robin Becker