Re: Strange problem with an inline image in a Paragraph
Robin Becker <[email protected]> Fri, 26 Jun 2020 08:44:00 +0100
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <[email protected]> |
On 25/06/2020 21:32, Lele Gaifax wrote: > Robin Becker <[email protected]> writes: > >> I used revision 4583 and that does not show this issue so the images problem >> has arisen since I added in support for soft hyphens. That needed quite a >> few changes to the layout algorithm. I'll try and figure that out in the >> next few days. > > I'm sorry I didn't mention the exact RL version, 3.5.42: given that I'm using > that version since Mar 17 without glitches, I did not even think about that > could be the culprit... subconscious preferred to think about something on my > part, designing a new layout for my "report". > > Thanks a lot Robin. > > ciao, lele. > The problematic image in your example is actually the first one in my experiments because it lacks a size and causes a line overflow. The following code shows the issue (without any frames) > with open("strange.pdf", "wb") as output: > c = Canvas(output, pagesize=defaultPageSize) > s = styles["Normal"] > t = '<img src="/tmp/strange.jpeg" valign="middle"/>' > p = Paragraph(t, s) > p.drawOn(c, cm, 2*cm) > c.showPage() > c.save() so this is actually a bug in the latest code almost certainly because I have messed witht eh hyphenation code. -- Robin Becker