Possible Duplicate:
Small-caps, old-style numbers, and some ligatures produce odd symbols in PDF copy text?
How can I make XeLaTeX produce PDFs that can be searched/copied? In particular, oldstyle figures don't work for the OpenType fonts I've tested. This my MWE:
\RequirePackage{cmap}
\documentclass{article}
%\input{glyphtounicode} % gives me an error
%\pdfgentounicode=1 % gives me an error
\usepackage{xltxtra}
\defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
\setmainfont[Ligatures=Common,
Numbers=OldStyle,
]{Adobe Garamond Pro}
\begin{document}
Testing 12345678910\\
\textsc{Testing 12345678910}
\end{document}
As you see, I've included the cmap package, as well as glyphtounicode, as most answers in this forum recommend. However, when inputing glyphtounicode, with or without the \pdfgentounicode=1 command, produces the following error:
! Undefined control sequence.
l.19 \pdfglyphtounicode
{A}{0041}
cmapis compatible with XeLaTeX: "The cmap package provides character map tables, which make PDF files generated by pdfLaTeX both searchable and copy-able". – doncherry Sep 18 '12 at 21:03