[reportlab-users] Turn off automatic mailto links?
Robin Becker
robin at reportlab.com
Wed Jul 29 06:25:36 EDT 2009
David Ostroske wrote:
> Can somebody please show me how to write email addresses (or strings
> that look like email addresses) without having them treated like
> mailto links in Adobe Reader?
>
> The documentation contains email addresses without links, so it must
> be possible. But code as simple as the following makes a mailto link
> out of example at example.com automatically.
>
> from reportlab.platypus.doctemplate import SimpleDocTemplate
> from reportlab.platypus.paragraph import Paragraph
> from reportlab.lib.styles import ParagraphStyle
>
> doc = SimpleDocTemplate('C:/TEMP/test.pdf')
> defaultstyle = ParagraphStyle(name='default')
> story = [Paragraph("example at example.com", defaultstyle)]
> doc.build(story)
.......
I'm fairly sure that is being done by the display application rather than
anything we do. I looked at what's produced by your example
> BT 1 0 0 1 0 5.17 Tm /F2 10 Tf 12 TL (example at example.com) Tj T* ET
so our code isn't doing anything to promote the idea that we want a link. Even
so, acrobat demented reader insists on showing it as a clickable mailto link.
I've tried a few experiments and nothing obvious seems to do the right thing.
--
Robin Becker
More information about the reportlab-users
mailing list