For those who are not using the memoirs document class, and also need to use table of contents. I would suggest the use of the
background package along with the
calc library in tikz. The inclusion of tikz allows you to have a lot more options including rounded corners (which I personally love).
I have come to this solution after trying out multiple options, including
pgfpages which actually squeezes your page inside instead of adding borders. This leads to displacement of toc links.
\draw [line width=1pt,rounded corners=4pt,]
($ (current page.north west) + (2cm,-2cm) $)
($ (current page.south east) + (-2cm,2cm) $);
I did struggle a lot with this and this seems like the easiest way to have margins, hope it helps :)
The following is the output image for a page from my document