[Tex/LaTex] `pdfbookmark` for table of contents points to previous page

bookmarkshyperreftable of contents

In my thesis, I'm using the book class as such:

\documentclass[a4paper,12pt,twoside,openright]{book}
\usepackage[bookmarks=true,
    bookmarksopen,
    bookmarksopenlevel=1,
    colorlinks=true,
    pagebackref
]{hyperref}
\frontmatter
\begin{titlepage}
%\input{tex/universitytitlepage.tex}
\end{titlepage}

\pdfbookmark[0]{Table of Contents}{sumario_label}\tableofcontents

\mainmatter
\openright
%\include{tex/stuff}
\end{document}

But the "Table of contents" bookmark in the PDF points to the blank page after the titlepage instead ofthe TOC page.

Any idea on how to make it point to the start of the TOC page, not the page before it?

Best Answer

This can be solved by adding \cleardoublepage before the \pdfbookmark command, like so:

\cleardoublepage
\pdfbookmark[0]{Table of Contents}{sumario_label}\tableofcontents

There is no need for \phantomsection in this case, AFAIK.

I could not find the exact problem I had because questions such as Hyperref pointing is incorrect in the Table of Contents and How to add the pdf-bookmark of TOC without its name "Contents" in TOC do not explicitly mention the problem of \pdfbookmark pointing to the page before the TOC. So I used the advice on the answers to those questions to make this one.