[reportlab-users] Bug in Paragraph class with tags when switching frames

Robin Becker robin at reportlab.com
Fri Nov 16 08:14:48 EST 2007


Dinu Gherman wrote:

> Robin Becker:

>

>> looks like there's a dictionary with an empty key. Can you just wrap

>> the call at line 621 thusly.

>>

>> try:

>> L = [(format(PDFName(k),document)+" "+format(dict[k],document))

>> for k in keys]

>> except:

>> print ['%r=%r' %(k,v) for k,v in dict.items()]

>> raise

>>

>> that may give some clue as to what kind of dictionary it is?

>

> That prints the following:

>

> ["'Subtype'='/Link'",

> "'Rect'=<reportlab.pdfbase.pdfdoc.PDFArray instance at 0x1620490>",

> "'Dest'=<reportlab.pdfbase.pdfdoc.Destination instance at 0x1506b20>",

> "'Type'='/Annot'",

> "'Border'=<reportlab.pdfbase.pdfdoc.PDFArray instance at 0x1506a80>",

> "'Contents'=<reportlab.pdfbase.pdfdoc.PDFString instance at 0x1623a80>"]

>

> Dinu

>

......
OK so it's a link; none of the keys seem to be empty. It's Destination object is
the one that's causing the problem. It seems we have an unnamed destination
which hasn't been set up by one of the definitional methods of the Destination
class. I think all these things have to do with outline trees etc etc. So this
is a Destination which has been referred to, but then never defined. Presumably
if its name is really an empty string then defining it will be fairly hard. This
looks like an empty destination name somewhere in a canvas._bookmarkReference call.
--
Robin Becker


More information about the reportlab-users mailing list