[reportlab-users] Parsing of <table> & ICU wordWrap

Buganini buganini at gmail.com
Wed Nov 4 00:52:39 EST 2015


> Hi,
>
> I'm not exactly sure what the use case is here. Form a quick inspection of
> the change sets it looks like you are using the cbDefn stuff to add a
> flowable (table) in the middle of a paragraph like an <img>; is that
> correct?

That's correct, BTW I don't know the meaning of cbDefn.

> I can imagine that people might want to put a table of figures into flowing
> text as a float, but the in line usage kind of escapes me.

Since I wrap it with available width, it renders as a block element
(in terms of CSS):

    def wrap(self, availWidth, availHeight):
        # work out widths array for breaking
        self.width = availWidth
        style = self.style
        leftIndent = style.leftIndent
        first_line_width = availWidth -
(leftIndent+style.firstLineIndent) - style.rightIndent
        later_widths = availWidth - leftIndent - style.rightIndent
        self._wrapWidths = [first_line_width, later_widths]

+        for f in self.frags:
+            cb = getattr(f, 'cbDefn', None)
+            if cb and cb.kind=='flowable':
+                cb.width, cb.height = cb.flowable.wrap(availWidth, None)
+                f.width = cb.width


> --
> Robin Becker
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> https://pairlist2.pair.net/mailman/listinfo/reportlab-users


More information about the reportlab-users mailing list