Holger Schieferdecker
2024-09-23 11:35:25 UTC
Hi,
I include single page PDF documents with \includepdf. They have the same
size and aspect ratio as the output document (A4). With the option
"addtotoc" I can add an entry to the tableofcontents and the bookmarks.
But clicking on that doesn't jump to the top of the included page.
It seems like the link target set by \includepdf is set with respect of
the page margins of the output document. I didn't find any hints in the
manual of pdfpages, besides that "addtotoc" is experimental. Is there a
way of positioning the link target at the top of the included pdf page?
In the example below the link to the first pdf jumps somewhere inside
the pdf. The link target of the second pdf is a bit above of the
embedded page.
Holger
%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\includepdf[landscape, scale=0.97,
addtotoc={1, section, 1, Example A, sp:ex-a}]{example-image-a}
\includepdf[scale=0.97,
addtotoc={1, section, 1, Example B, sp:ex-b}]{example-image-b}
\clearpage
Nothing here.
\end{document}
%%%%%%%%%%%%%%%%%%
I include single page PDF documents with \includepdf. They have the same
size and aspect ratio as the output document (A4). With the option
"addtotoc" I can add an entry to the tableofcontents and the bookmarks.
But clicking on that doesn't jump to the top of the included page.
It seems like the link target set by \includepdf is set with respect of
the page margins of the output document. I didn't find any hints in the
manual of pdfpages, besides that "addtotoc" is experimental. Is there a
way of positioning the link target at the top of the included pdf page?
In the example below the link to the first pdf jumps somewhere inside
the pdf. The link target of the second pdf is a bit above of the
embedded page.
Holger
%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\includepdf[landscape, scale=0.97,
addtotoc={1, section, 1, Example A, sp:ex-a}]{example-image-a}
\includepdf[scale=0.97,
addtotoc={1, section, 1, Example B, sp:ex-b}]{example-image-b}
\clearpage
Nothing here.
\end{document}
%%%%%%%%%%%%%%%%%%