1

This is how I am making the border:

\documentclass{article}

\usepackage{background} \usepackage{tikz} \usetikzlibrary{calc}

\backgroundsetup{angle = 0, scale = 1, vshift = -2ex, contents = {\tikz[overlay, remember picture] \draw [rounded corners = 15pt, line width = 2pt, color = black] ($(current page.north west)+(2cm,-2cm)$) rectangle ($(current page.south east)+(-2,2)$);}}

\begin{document} Hello World! \end{document}

  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – samcarter_is_at_topanswers.xyz Mar 12 '24 at 12:19
  • @samcarter_is_at_topanswers.xyz Noted, Thank you! – TheInidealPrakrutiGuy Mar 12 '24 at 12:30

1 Answers1

1

As a quick workaround, you could use a coloured page and fill your frame with white:

\documentclass{article}

\usepackage{background} \usepackage{tikz} \usetikzlibrary{calc} \pagecolor{red}

\backgroundsetup{angle = 0, scale = 1, vshift = -2ex, opacity=1, contents = {\tikz[overlay, remember picture] \path [fill=white,rounded corners = 15pt, line width = 2pt, draw=black] ($(current page.north west)+(2cm,-2cm)$) rectangle ($(current page.south east)+(-2,2)$);}}

\begin{document} Hello World! \end{document}

enter image description here

If you need a transparent background, e.g. because you use the pdfpages package, you could use the inverted clipping method from https://tex.stackexchange.com/a/290508/36296

\documentclass{article}

\usepackage{background} \usepackage{tikz} \usetikzlibrary{calc}

\tikzset{ clip even odd rule/.code={\pgfseteorule}, % Credit to Andrew Stacey invclip/.style={ clip,insert path= [clip even odd rule]{ reset cmrectangle(\maxdimen,\maxdimen) } } }

\backgroundsetup{ angle = 0, scale = 1, vshift = -2ex, opacity= 1, contents = { \begin{tikzpicture}[overlay, remember picture] \draw [rounded corners = 15pt, line width = 4pt, color = black] ($(current page.north west)+(2cm,-2cm)$) rectangle ($(current page.south east)+(-2,2)$); \clip[invclip,rounded corners=15pt] ($(current page.north west)+(2cm,-2cm)$) rectangle ($(current page.south east)+(-2,2)$); \fill[red] (current page.south west) rectangle (current page.north east);
\end{tikzpicture} } }

\begin{document} Hello World! \end{document}

enter image description here