%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
% This is file 'xwatermark-examples2.tex', version 1.5.2d.                   %
%                                                                            %
% This work (ie, all the files in the xwatermark manifest) may be            %
% distributed and/or modified under the conditions of the LaTeX              %
% Project Public License, either version 1.3 of this license or any          %
% later version. The latest version of this license is at                    %
% http://www.latex-project.org/lppl.txt and version 1.3 or later             %
% is part of all distributions of LaTeX version 2005/12/01 or later.         %
%                                                                            %
% The LPPL maintenance status of this software is 'author-maintained'.       %
%                                                                            %
% This software is provided 'as it is', without warranty of any kind,        %
% either expressed or implied, including, but not limited to, the            %
% implied warranties of merchantability and fitness for a particular         %
% purpose.                                                                   %
%                                                                            %
% Copyright (c) 2009-2012 Ahmed Musa (amusa22@gmail.com).                    %
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%

\documentclass[final,showpagenos]{article}
\makeatletter

\InputIfFileExists{xwatermark-examples.cfg}{}{%
  \errmessage{No file xwatermark-examples.cfg or wrong path}}

\thispagestyle{empty}

%\watermarkpaths*[.](/){{},/Graphics}
\watermarkpaths[.](/){{}{/Graphics}}

\newwatermark*[%
  page=2,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,
  textscale=1,textalign=center,textangle=45,picangle=90,
  picontoptext=false,boxalign=center,picxpos=50,
  picypos=.25\paperheight,textxpos=-70,textypos=-50,
  picbb=116 428 477 718,picscale=1,picfile=tabu-test1,
  picfileext=eps
]{\ttcl{Green}{\texttt{xwatermark\\package}}}

\newwallpaper[%
  page=2,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,
  textscale=2,textalign=center,textangle=45,picangle=45,
  tilexoffset=0pt,squaretiles,tileyoffset=0pt,picontoptext=true,
  boxalign=center,picbb=54 54 483 242,picscale=2,picfile=fant,
  tileno=4,picfileext=epsx,graphicsoptions={keepaspectratio,hiresbb}
]{\texttt{fant}}


% * (star) means 'put on foreground';
% ' (prime) means 'ignore this mark':
\newwallpaper*[%
  page=3,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,textscale=2,
  textalign=center,textangle=45,picangle=45,tilexoffset=0pt,%squaretiles,
  tileyoffset=0pt,picontoptext=false,boxalign=center,
  picbb=116 428 477 718,picscale=2,picfile=tabu-test1,tileno=4,
  % The package will look for the right file extension in each mode,
  % ignoring the following 'epsx':
  picfileext=epsx
]{\texttt{test}}

\newwallpaper[%
  page=5,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,textscale=2,
  textalign=center,textangle=0,picangle=0,tilexoffset=0pt,squaretiles,
  tileyoffset=0pt,picontoptext=false,boxalign=center,showpagecenter,
  picbb=116 428 477 718,picscale=2,picfile=tabu-test1,tileno=4,
  picfileext=eps
]{\texttt{test}}

\newwallpaper*[%
  page=4,fontfamily=put,textcolor=violet!70,fontsize=1cm,textscale=1,
  textalign=center,textangle=45,picangle=0,tilexoffset=0pt,squaretiles,
  tileyoffset=0pt,picontoptext=false,boxalign=center,%top-left,
  picbb=20 21 590 400,picscale=1,picfile=comet1,%tileno=8,
  picfileext=epsx
]{Comet}

\dummywallpaper[%
  page=5,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,textscale=2,
  textalign=center,textangle=45,picangle=45,squaretiles,tilexoffset=0pt,
  tileyoffset=0pt,picontoptext=false,%boxalign=l-t,
  picbb=115 623 238 747,picscale=2,picfile=xwatermarkpic1,
  picfileext=eps
]{YES}

\newwatermark[%
  pages=4,fontfamily=put,textcolor=blue,fontsize=1.2cm,textscale=1,
  width=.8\paperheight,textalign=center,textangle=90,textxpos=0,textypos=0
]{%
  \xwmcolorbox[framesep=4pt,framerule=4pt,fillcolor=brown!70!yellow!55,
    innerframecolor=white,outerframecolor=blue,height=1.5cm,
    depth=1cm,textalign=center,width=.8\paperheight]%
  {\tt\string\advance\ttcl{red}{\string\knowledge}%
  \string\by\ttcl{red}{\string\inquiry}}%
}

\newwatermark[%
  page=6,fontfamily=put,textcolor=BurntOrange!70,fontsize=1cm,textscale=2,
  picbb=78 563 304 788,picscale=2,picfile=xwatermarkpic3,
  picfileext=epsx,width=\paperwidth,textalign=center,textangle=0,
  textxpos=0,textypos=0,picontoptext=false
]{\ttcl{black}{Yes}}

\newwatermark*[%
  page=6,fontfamily=put,textcolor=violet!70,fontsize=2cm,textscale=1,
  width=\paperwidth,textalign=center,textangle=0,textxpos=0,textypos=0
]{\fbox{Brought to front}}

\newwatermark[%
  page=7,fontfamily=put,textcolor=MidnightBlue!80,fontsize=2cm,textscale=1,
  width=\paperwidth,textalign=center,textangle=-50,textxpos=-30,textypos=80
]{\fbox{Taken to back}}

\csndef*{watermark-2a}#1#2{%
  \newwatermark[%
    pages=6-7,fontfamily=pbk,textcolor=gray!35,fontsize=12pt,fontseries=n,
    textalign=center,textangle=#2,textscale=1,textxpos=#1,textypos=0,
    width=\paperheight
  ]{%
    \xwmcolorbox[framesep=5pt,framerule=2pt,fillcolor=teal,
      innerframecolor=magenta,outerframecolor=green,
      textalign=center,width=.98\paperheight]%
      {%
        \color{white}\framebox[2cm][t]{\phantom{Hello}}\hspace{1cm}%
        \color{orange!85!red!55}\ttcl{red}{$\blacktriangleright$}%
        \hspace{2.1cm}Page \thepage~of~\pageref{xwmlastpage}%
        \hspace{2.1cm}\ttcl{red}{$\blacktriangleleft$}\hspace{1cm}%
        \color{white}\framebox[2cm][t]{\phantom{Hello}}%
        \xwmstrut{9mm}{6mm}%
    }%
  }%
}

\begin{ltscomment}
The same watermark is placed twice on the same page.
Compare this with one of the examples in  xwatermark-examples1.tex:
\end{ltscomment}

\usecsn{watermark-2a}{-.428\paperwidth}{90}
\usecsn{watermark-2a}{.428\paperwidth}{-90}

\begin{ltscomment}
Here is an inefficient example. \scalebox and \rotatebox
could have been more efficiently achieved in the following
example:
\end{ltscomment}
\newwatermark[page=\lastdocpage,width=\paperheight]{%
  \setbox\xwm@boxb=\hb@xt@.9\paperheight{%
  \hfuzz\maxdimen\hss
  \xwmcolorbox[framesep=4pt,framerule=4pt,fillcolor=brown!70,
    innerframecolor=white,outerframecolor=MidnightBlue,height=1cm,
    depth=.8cm,textalign=center,width=.8\paperheight]%
    {\scalebox{1.2}{\bf\tt\ttcl{white}{\char`\\advance}%
      \ttcl{red}{\string\knowledge}%
      \string\by\ttcl{blue}{\char`\\inquiry}}}\hss}%
  \begin{center}\rotatebox{45}{\box\xwm@boxb}\end{center}%
}

\begin{document}

\title{%
  {\setbox\z@\vbox to.25\paperheight{}\box0}%
  \bfseries The \texttt{\ttcl{blue}{xwatermark}} Package
  \xcopyright{red}\\[1ex]
  \large Version 1.5.2d\\[2ex]
  \Large EXAMPLES (File 2)%
}
\author{%
  \textbf{Ahmed Musa}\\Preston, United Kingdom\\
  \email{amusa22@gmail.com}
}
\maketitle
\thispagestyle{empty}

\newpage

\ltslipsum[1-4]

\ltslipsum

\newpage

\ltslipsum[1-4]

\newpage

\ltslipsum[1-4]

\newpage

\ltslipsum[1-4]

\newpage

\ltslipsum[1-4]

\newpage

\ltslipsum[1-4]

\end{document}
