[reportlab-users] Using Anchor tags with 'target' - any chance ?
reportlab at richardshea.fastmail.fm
reportlab at richardshea.fastmail.fm
Thu Apr 3 07:31:40 EDT 2008
On Thu, 03 Apr 2008 10:01:53 +0100, "Robin Becker" <robin at reportlab.com>
said:
> 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.
> --
OK thanks for the info. Unfortunately I'm displaying the PDF within an
IFrame and clicking on a link embedded in the PDF results in the target
page also opening in the IFrame - not what I had intended ! Never mind I
will find another way around it. Thanks again for your help.
R.
More information about the reportlab-users
mailing list