[reportlab-users] Possible bug in line wrapping

Roberto Alsina ralsina at netmanagers.com.ar
Fri Jul 24 23:39:33 EDT 2009


This is hard to trigger, but it seems that if there is a linebreak immediately
after a link, the line doesn't break.

Here is a test case which produced the attached PDF:

# -*- coding: utf-8 -*-
from reportlab.platypus import SimpleDocTemplate, Paragraph
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.enums import TA_JUSTIFY

def go():
styles = getSampleStyleSheet()
doc = SimpleDocTemplate("phello.pdf")
style = styles['Normal']
style.alignment=TA_JUSTIFY
p1 = Paragraph('''PADDING PADDING PADDING PADDING PADDING PADDING The
computer will always be better than you at parsing SQL
and the bad guys have years of experience finding and using <a
href="http://en.wikipedia.org/wiki/SQL_injection" color="navy">SQL
injection attacks</a><a name="sql-injection-attacks"/> in
ways you never even thought possible.''', style)
doc.build([p1,])

go()


--
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH)
(_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar
_..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia
(l)-'' ((i).' ((!.' according to alexa.com (27/5/2007)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phello.pdf
Type: application/pdf
Size: 2524 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20090725/3d12dbe0/attachment.pdf>


More information about the reportlab-users mailing list