# Problem copying text from pdf - spaces being stripped

I have the following minimal working example:

\documentclass{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

é canção

\end{document}


I need to use the utf8 argument in order to have special characters in a simpler way and I need the T1 argument in order to copy the special characters correctly from pdf.

The problem is, when I copy the text from the pdf reader (I am using Foxit Reader) the space won't come out with the text, resulting in écanção being copied (notice that the space didn't come out with the text).

How to solve this?

-
This is down to the PDF viewer: TeX does not use 'space' characters for spacing, so they have to be interpreted as such by the program showing the PDF. –  Joseph Wright Sep 10 '11 at 20:51
@Joseph so does that make TeX created documents problematic w.r.t. accessibility for the blind, for example? –  Alan Munn Sep 10 '11 at 20:55
@Joseph You are right, since I've tried another example (without inputenc being loaded) and Foxit Reader didn't handle the spaces when copying the text. However, even being a problem of the pdf viewer, isn't there a workaround? –  Weslei Sep 10 '11 at 20:59
@Alan: The 'space' character has a fixed width - not just an issue for TeX, but for anything that is typesetting as opposed to writing text. Many viewers (most obviously Adobe Reader) handle this quite well. There is the 'ActualText' feature in the PDF spec, but I'm not sure how easy it would be to set up all spaces to use it. –  Joseph Wright Sep 10 '11 at 21:06
@Weslei There's a similar question in SuperUser that might help you: superuser.com/questions/50496/… –  Paulo Cereda Sep 10 '11 at 21:07

\pdfmapline{+dummy-space <dummy-space.pfb}