目次のハイパーリンクが正しいページを参照していません

目次のハイパーリンクが正しいページを参照していません

私は、PDF だけを格納し、特定のページを参照する目次を持つシンプルな texfile を作成しようとしています。セクション/サブセクションのタイトルは表示されず、PDF は元のサイズのままです。つまり、PDF 内を移動するためのシンプルな TOC であるはずです。問題は、TOC が適切なページをハイパー参照しないことです。

\documentclass[11pt,a4paper]{report}

\usepackage[german]{babel}
\usepackage[utf8]{inputenc}

\usepackage[left=2.5cm,right=2.5cm,top=2cm,bottom=4cm]{geometry}
\usepackage{tocbasic}
\usepackage{pdfpages}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}

\begin{document}

% --- FIRST PDF ---
\addcontentsline{toc}{section}{PDF1}
\includepdf[noautoscale=true]{path/pdf1.pdf}

% --- TOC ---
\tableofcontents
\newpage

% --- PDF2 ---
\addcontentsline{toc}{section}{pdf2}
\includepdf[pages={1-2}, noautoscale=true]{path/pdf2.pdf}

% --- PDF3+4 ---
\addcontentsline{toc}{section}{Title}
% --- PDF3 ---
\addcontentsline{toc}{subsection}{pdf3}
\includepdf[pages={1}, noautoscale=true]{path/pdf3.pdf}

% --- PDF4 ---
\addcontentsline{toc}{subsection}{pdf4}
\includepdf[pages={1}, noautoscale=true]{path/pdf4.pdf}

\end{document}

コードをコンパイルすると、TOC は最初の PDF を正しくハイパー参照しますが、他の TOC ハイパー参照は間違ったページにリンクされます。ただし、TOC のページ番号は適切に指定されています。私の問題が理解できることを願っています。どんな助けでも大歓迎です!

答え1

\phantomsectionを使用する前にを追加することで問題を解決しました\addcontentsline

関連情報