[reportlab-users] Using Anchor tags with 'target' - any chance ?
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",
> 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 ...
> DeprecationWarning: raising a string exception is deprecated
> % (_parser.errors,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).
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.
More information about the reportlab-users