# Adjust Frame Option of pdfpages-Package

I'm currently writing a report for university and want to include some pdf documents as appendices. I'm using pdfpages (of course) to include these pdfs but i ran into one small problem:

I scaled the pdf pages down a little bit, so that i can keep the pagenumbering of my report visible. Also, i'm including the first page of each pdf in a minipage, so that i can print the name of the appendix-element (\chapter{})

I want to make these pdf pages stand out a little bit. the pdfpages-Packages gives the frame option, that draws a small border around the pdf page. However, not the whole page is inside the frame (See picture below)

What am i doing wrong?

Example Code:

\chapter{Unterrichtsentwurf E2GS2}\label{append:E2GS2}
\begin{minipage}{1.0\linewidth}
\includepdf[clip=0mm 0mm 0mm 0mm,
trim=20mm 40mm 20mm 15mm,
frame,
width=.7\textwidth,
pagecommand={}
]{../../Unterrichtsvorbereitung/E2GS2/Leitermagnetfeld.pdf}
\end{minipage}

\includepdf[clip=0mm 0mm 0mm 0mm,
trim=20mm 40mm 20mm 15mm,
pages=2-,
width=.9\textwidth,
frame,
pagecommand={}
]{../../Unterrichtsvorbereitung/E2GS2/Leitermagnetfeld.pdf}


Furthermore, í noticed, that when i include my pdf in two parts like this, omitting the frame option in the first part, but including it in the second part still draws a border around the page i included in the first part! Can someone explain, why this is?

After spending much too much time on this issue, i basically came to think that it's not possible to achieve what i wanted - at least not without redefining or extending something in the pdfpages-package.

I stumbled over a similar, but not identical, issue: I wanted to have more control over how the frame is drawn. I simply used TikZ to draw the frame (and not the frame option directly). In case anyone is interested, here's my solution.

\tikzset{
myborder/.pic = {
\path [-, draw=green, line width=2pt]
($(current page.north west)+(1pt,-1pt)$) -|
($(current page.south east)+(-1pt,1pt)$) -|
cycle;
}
}
\includepdf[
pages={11,14},
pagecommand={%
\tikz[overlay, remember picture]{%
\pic {myborder};
}%
},
width=.99\paperwidth
]{other.pdf}%


This needs calc and positioning TikZ libraries, I think:

\usetikzlibrary{positioning, calc}