[reportlab-users] ParagraphAndImage flowable
Matt Page-Lieberman
mjpl at itautec.cin.ufpe.br
Fri Jun 2 11:18:46 EDT 2006
> Are you saying that IAF ignores the indentation of the first
paragraph style? I can well believe that but it does suggest a bug or a
need for a new feature.
No. I haven't started to work with IAF yet. We're having problems with
PAI because the leftIndent pushed the paragraph further and further away
from the image when the image is too the left. We had to do a horrible
hack where PAI accepts a leftIndent argument and both the image and
paragraph are indented based on that.
I'm going to try working with IAF now. I just installed reportlabs-2.0
a little while ago and was experimenting with the new version of PAI
which accepts the left/right arg.
Andy Robinson wrote:
> Matt Page-Lieberman wrote:
>
>> I found one of the answers to our problem. In version 2.0 of
>> ReportLab, indeed an argument is passed to say in which order the
>> image and paragraph should be displayed. One outstanding question
>> though, is how to indent the whole unit rather than just indenting
>> the text or having to hack the implementation as explained below
>> (applying the paragraph style's leftIndent property to the
>> indentation of the image.
>>
>
> Here's the quick answer:
>
> from reportlab.platypus.doctemplate import Indenter
> story.append(Indenter(newLeftMargin, newRightMargin))
> story.append(myImageAndFlowables)
> story.append(Indenter(-newLeftMargin, -newRightMargin))
>
>
> This causes the packer to adjust the width of the frame while working.
> It's also the right way to do multiple levels of indented lists and
> paragraphs.
>
> Are you saying that IAF ignores the indentation of the first paragraph
> style? I can well believe that but it does suggest a bug or a need
> for a new feature.
>
> - Andy
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
More information about the reportlab-users
mailing list