[reportlab-users] Anchors (was: Re: Table column width - problem with >2 cols)
Juha Tuomala
Juha.Tuomala at iki.fi
Tue Jan 30 08:29:42 EST 2007
On Tuesday 30 January 2007 14:37, Juha Tuomala wrote:
> I tried to use those and for some reason I face a wierd problem
> with it.
> --------------------------------------------------------------------------
> #!/usr/bin/python
>
> from reportlab.lib.styles import getSampleStyleSheet
> from reportlab.platypus.doctemplate import SimpleDocTemplate
> from reportlab.platypus.paragraph import Paragraph
>
> def firstPage(c, t):
> pass
>
> def laterPages(c, t):
> pass
>
> f = []
> gs = getSampleStyleSheet()
> s = gs['Normal']
> text = '<a href="#CHAPTER">CHAPTER</a>\n'
> text2 = '<a name="CHAPTER" />'
If I add whatever than whitespace before or after
the text, for example:
text2 = '.<a name="CHAPTER" />
it works (starting with period). That is, a Paragraph()
cannot contain plain tag, but also some text. Does it
apply to other 'inline markup tags', I haven't tried yet.
>
> f.append(Paragraph(text, s) )
> f.append(Paragraph(text2, s) )
>
> t = SimpleDocTemplate('o.pdf')
> t.build(f, onFirstPage=firstPage, onLaterPages=laterPages)
> -----------------------------------------------------------------------------
I assume this is a bug?
BR,
Tuju
--
Ajatteleva ihminen tarvitsee unta.
More information about the reportlab-users
mailing list