16

So I have my CV publicly available on my website and it has both my email address on it, and the email addresses of my references. In the interest of protecting my self and them from spam, I was wondering if there was a good way of adding extra resistance to email addresses when in PDF form. Currently to display the email addresses I use:

\href{mailto:name@domain.tld}{\nolinkurl{name@domain.tld}}

Can I change this somehow to make things a little bit more secure?

Velox
  • 263
  • 1
    I'd insert mail addresses as bitmap images. – AlexG Dec 17 '13 at 14:00
  • I thought about that, but it doesn't deal with scaling. It's not a huge problem, but it would be nice to solve it. – Velox Dec 17 '13 at 15:31
  • 1
    @velox: You can scale the graphics to suit your needs. On a related note, you might be interested in What can cause generated PDF document whose text are not correctly copyable?, which deals with security in a PDF. – Werner Dec 17 '13 at 16:58
  • Yes, you can scale and insert them, however if the user zooms in on the PDF then the bitmap will appear pixellated while the rest of the text remains clear.

    Also, just looked at the link and there is a good example there. Thanks.

    – Velox Dec 17 '13 at 17:29
  • name@dom$\,\!$ain.tld typesets the same as name@domain.tld. Is that of any use? – Steven B. Segletes Dec 17 '13 at 17:52
  • @StevenB.Segletes, while that would stop it from being taken from the .tex file, you can still get the actual email address from the PDF. – Velox Dec 17 '13 at 20:40
  • Why not use something like inkscape to make an SVG or Postscript image of your email, then insert that? It would be a vector graphic, and thus no pixilation, but still be an image. – Canageek Dec 18 '13 at 01:42
  • Do osf figures copy? If not and your address includes numbers, you could try that. – cfr Dec 18 '13 at 03:29
  • 1
    Is there any evidence that protective measures actually decrease the amount of spam you receive? – StrongBad Dec 21 '13 at 12:59
  • 1
    @StrongBad I would also be interested to know that, especially given that these methods all seem to break (further) the accessibility of PDFs. Given that the PDFs TeX produces are broken in any case, I tend to think anything which exacerbates that needs a fairly robust justification. – cfr Feb 14 '14 at 03:25
  • @cfr Hopefully I will get an answer over at IS.SE: http://security.stackexchange.com/questions/51518/is-it-useful-to-use-dot-and-at-in-email-addresses-in-documents-on-the-web – StrongBad Feb 14 '14 at 09:55
  • @Velox That link fails for me but the one StrongBad gave includes a similar link in one of the answers. (Marked NSFW for reasons I don't understand though I didn't read the comments.) – cfr Feb 14 '14 at 18:35
  • @StrongBad Thanks for asking that question. I take the links there to suggest that using is probably much more effective than people think and much more effective than some of the other methods people use. Very happy about that because unlike many of the other methods, is pretty accessible. Not much help when your employer has already plastered your addresses on the net and is, in any case, directly responsible for 90% of the spam you receive but definitely worth knowing! – cfr Feb 14 '14 at 18:39
  • @cfr Sorry, I was using markdown in the comments for links. Try this: http://techblog.tilllate.com/2008/07/20/ten-methods-to-obfuscate-e-mail-addresses-compared/ – Velox Feb 15 '14 at 12:28
  • @Velox Thanks. That's the link I mentioned in the answer StrongBad linked to and it works fine. – cfr Feb 15 '14 at 15:15

2 Answers2

12

Here are two approaches. In the first, I use the actual @ character, but when I write it out, I overlay it with some really tiny white text. Thus, during the copy/paste of the PDF, you get the extra text as part of the copy:

\documentclass{article}
\usepackage{stackengine}
\usepackage{graphicx}
\usepackage{xcolor}
\def\fauxat{\stackinset{c}{}{c}{}{\color{white}\scalebox{.01}{foobar}}{@}}
\parindent 0pt
\begin{document}
Using the actual symbol, @,\\
mailto:name\fauxat domain.tld\\
in the PDF copy/paste, appears as\\
``mailto:name@foobar domain.tld''
\end{document}

enter image description here

In this second approach, I avoid the use of the @ symbol, but that means that I must create something that looks reasonably like an @ symbol by overlaying an italic a inside a sans-serif O. That way, when it is copied from the PDF, there is no @ in the copy.

\documentclass{article}
\usepackage{stackengine}
\usepackage{graphicx}
\def\fauxat{\raisebox{-1.4pt}{\stackinset{c}{-.4pt}{c}{}{%
  \scalebox{.92}{\itshape{a}}}{\textsf{O}}}}
\parindent 0pt
\begin{document}
mailto:name\fauxat domain.tld

in the PDF copy/paste, appears as\\
``mailto:nameOa domain.tld``
\end{document}

enter image description here

David Carlisle
  • 757,742
  • Seems like it would work, but I'll hold off for now until I see what alternative there are. – Velox Dec 20 '13 at 15:55
  • That first option seems like it would be the best compromise between obfuscating the address for spam-crawlers and accessibility, especially if the "foobar " was replaced by something that would make more sense to someone using a screenreader for example. – Chris H Mar 31 '14 at 12:02
12

If you want to include the email address as an image but don't want to loose quality, why not use a PostScript image? If Adobe Illustrator is available to you, it's easy to convert any font in a PDF to a vector path. I'm sure there are open source tools that can do the same.

  • Create a New Illustrator Document
  • File > Place... > Select the PDF with your CV
  • Object > Flatten Transparency... > check 'Convert All Text to Outlines' > OK
  • Delete everything except your email address
  • Adjust the Artboard and Export as PDF

enter image description here

This export can replace the email address in your CV. It can't be selected, and its quality is as a good as any text.

enter image description here enter image description here

\documentclass{article} 
\usepackage{graphicx}
\begin{document}
This is my CV. You can reach me at \smash{\raisebox{-2pt}{\includegraphics{email}}} if you like.
\end{document}

Update:

Several free tools can vectorize PDFs. Some tools automatically replace unknown embedded fonts with standard fonts. These shouldn't be used. Inkscape is still among them unfortunately (see this bug report from 2009).

The Wikipedia Graphics Lab pages mention a few other tools: PDF2SVG or online service misc2svg. I tried misc2svg, it worked fine. The SVG output can be cropped and converted to a PDF in Inkscape. You might even be able to convert the SVG to TikZ/PGF paths that can be included in LaTeX source code (using e.g. the inkscape2tikz extension).

u17
  • 4,976