% Add a decoration in the corner of each page
% The image is selected using pdfornament, and is positionned using the margin
% of the pages.

\usepackage{tikz}
\usepackage{eso-pic}
\usepackage{pgfornament}
\usepackage{tikzpagenodes}
\usepackage{ifthen}
\usetikzlibrary{positioning}

% Apply a decoration over each page
% Arguments
%   1: the size of the decoration
%   2: the distance to the page (not the text margin but the page itself
%   3: the color
\newcommand{\pageornament}[3]{%
   \begin{tikzpicture}[remember picture, overlay]
       \node[yshift=-#2,xshift=-#2, anchor=north east] at (current page.north east){%
           \pgfornament[color=#3,width=#1,symmetry=v]{41}
       };
       \node[yshift=#2,xshift=-#2,anchor=south east] at (current page.south east){%
           \pgfornament[color=#3,width=#1,symmetry=c]{61}};
       \node[yshift=-#2,xshift=#2,anchor=north west] at (current page.north west){%

           \pgfornament[color=#3,width=#1]{41}
       };
       \node[yshift=#2,xshift=#2,anchor=south west] at (current page.south west){%
           \pgfornament[color=#3,width=#1,symmetry=h]{61}
       };
   \end{tikzpicture} 
}

\AddToShipoutPictureBG{%
    \pageornament{1.75cm}{0.5cm}{altColor}
}

