pdfpages/hyperref - Contents link jumps to wrong part of page

I'm using pdfpages to combine multiple pdf documents; I would also like a front 'contents' page for the new file, using hyperref to allow me to jump directly to the correct page. The 'addtotoc' option in pdfpages almost works... the link produced by that goes to the correct page, but a few lines down from the start. Any suggestions? The sample code below also shows a workaround using \hyperlink - but this file will potentially have to be maintained/updated by other people who may not be so familiar with \LaTeX, so the more that can be automated (ie the less changes needed for each additional file), the better.

\documentclass{article}
\usepackage{pdfpages}
\usepackage{bookmark}
\bookmarksetup{color=blue}
\setlength\parindent{0pt}

\begin{document}
\tableofcontents

\bookmark[dest=Core1.pdf.1]{Core 1}
\bookmark[dest=Core2.pdf.1]{Core 2}
\bookmark[dest=Core3.pdf.1]{Core 3}
\bookmark[dest=Core4.pdf.1]{Core 4}
\end{document}

-

The default use of addtotoc in \includepdf creates a section and uses that as the anchor. The section is defined to be anonymous within the document but to have a name in the table of contents and bookmarks.

One idea I had would be to use the addtotoc mechanism to just add the entries to the table of contents (and thus the bookmarks), but with the hyperlinks pointing to the already defined anchors instead of the section anchors, like so:

\documentclass{article}
\usepackage{mwe}
\usepackage{pdfpages}
\usepackage{bookmark}
\bookmarksetup{color=blue}
\setlength\parindent{0pt}

\setcounter{errorcontextlines}{\maxdimen}

\makeatletter
\makeatother

\begin{document}
\tableofcontents

\end{document}


This works because pdfpages only creates a section for TOC purposes if the named sectioning command (when prefixed with @) does not exist, otherwise it uses that command instead. Here, I called it pdfpagesphantomsection.

Note that I did not have the PDF files you named, so I used those provided in the mwe package instead.

-
That works perfectly! Many thanks for a speedy response. – JustinT Dec 11 '12 at 8:57

You can also simply change the top margin of the page that contains the included PDF. The anchor added by addtotoc will then be located at the very top of the page.

You can change the margins mid-document using the newgeometry and restoregeometry commands from the geometry package:

\documentclass{article}

\usepackage{geometry}
\usepackage{pdfpages}
\usepackage{hyperref}

\begin{document}

% Your overview page goes here

\newgeometry{top=0pt}  % Remove top margin