# Preserving “\label” in the final PDF to retrieve it with poppler?

Our PDF contains lots of \label{foo} commands, where we jump to from links from within the PDF (using the hyperlinks package)

When I tried to jump to there from within our PDF displaying application, which uses the Poppler library, I however failed to find that label.

// C++ code to find the label 'foo' in the document


When I instead tried to use the \hyperdef command, I was able to do what I wanted

\hyperdef{foo}{bar}{}


Doing in our PDF application

Poppler::LinkDestination *linkDest = m_doc->linkDestination("foo.bar");


Can anyone please explain the technical difference between these commands? We would like to be able to keep using \label if possible, since we have a large LaTex codebase that uses it.

-

Since 2012/07/28 v6.82u package hyperref provides option destlabel for this purpose.
For the time being until we update, I just use \hyperdef and the other form of \hyperref like \hyperref{}{cat}{name}{}. I just couldn't find whether an empty URL is allowed, but it works! :) –  Johannes Schaub - litb Nov 6 '12 at 13:34