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

Robin Becker robin at reportlab.com
Thu Apr 3 05:01:53 EDT 2008


reportlab at richardshea.fastmail.fm wrote:

> 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.

.......
target is unsupported because it is a pure html concept ie the window in which
to open the document. When you click on an http protocol link in PDF it uses
your browser to open the document, parent top etc are probably not relevant.
--
Robin Becker


More information about the reportlab-users mailing list