[reportlab-users] Using Anchor tags with 'target' - any chance ?

reportlab at richardshea.fastmail.fm reportlab at richardshea.fastmail.fm
Wed Apr 2 22:55:08 EDT 2008


Hi - I'm building a PDF with anchor tags like this ...

def buildAnchor(strAssociatedText, strLiteral="EDIT",
strURL="http://www.forbar.co.nz/"):
strAnchor = '''<a target='_parent' href='%s'color="red">%s</a>''' % (strURL, strLiteral)
strOut = "%s [%s]" % (strAssociatedText, strAnchor)
return strOut

... everything was fine until I added the target='_parent' bit and now I
get ...

C:\bin\installed\Python2.5\lib\site-packages\reportlab\platypus\paragraph.py:548:
DeprecationWarning: raising a string exception is deprecated
% (_parser.errors[0],text[:min(30,len(text))])

... which given that the use of the target attribute doesn't seem to be
documented is fair enough. I just thought I would double check though as
the error message seems a bit weird and .... I need this pretty badly
;-)

I'm displaying the PDF from within an IFrame on a HTML page; the links
embedded in the PDF need to be able to get the user out of the IFrame -
hence my interest in the target attribute (which as far I know is the
only way to get out of IFrame).

thanks

Richard.






More information about the reportlab-users mailing list