# Watermark on the first page only

I'm modified the following code from this post to add a couple of vertical watermarks on a page. However, the code places these watermarks on every page.

Is there a way to restrict watermarking to the first page or certain pages of my amsbook?

\documentclass{amsbook}
\usepackage{graphicx}
\usepackage{eso-pic}

\makeatletter
\setlength{\@tempdimb}{.5\paperwidth}%
\setlength{\@tempdimc}{.5\paperheight}%
\setlength{\unitlength}{1pt}%
\protect{\put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
\makebox(-515,0){\rotatebox{90}{\textcolor[gray]{0.90}%
{\Huge Draft:  \today}}}
\makebox(515,0){\rotatebox{270}{\textcolor[gray]{0.90}%
{\Huge  Draft:  \today}}}}}}
\makeatother

\begin{document}

Hi
\newpage
Hi, again.

\end{document}

-

The background package allows you to do this easily; simply use the some package option together with the \BgThispage command for those pages which should exhibit the watermark; the package also allows you to control all the aspects of the watermark (opacity, color, scale, placement, etc.). A little example:

\documentclass{amsbook}
\usepackage{graphicx}
\usepackage[some]{background}

\SetBgScale{1}
\SetBgContents{\parbox{10cm}{%
\Huge Draft:  \today\\[14cm]\rotatebox{180}{\Huge Draft:  \today}}}
\SetBgColor{gray}
\SetBgAngle{270}
\SetBgOpacity{0.2}

\begin{document}

Hi\BgThispage
\newpage
Hi, again.

\end{document}

-

You can use directly atbegshi

\documentclass{amsbook}
\usepackage{graphicx,color}
\usepackage{atbegshi,picture}

\AtBeginShipoutNext{\AtBeginShipoutUpperLeft{%
\setlength{\unitlength}{1pt}%
\protect{\put(.5\paperwidth,-.5\paperheight){%
\makebox(-515,0){\rotatebox{90}{\textcolor[gray]{0.90}%
{\Huge Draft:  \today}}}%
\makebox(515,0){\rotatebox{270}{\textcolor[gray]{0.90}%
{\Huge  Draft:  \today}}}}}}}

\begin{document}

Hi
\newpage
Hi, again.

\end{document}


A simpler code, that avoids guessing the number 515 is

\AtBeginShipoutNext{\AtBeginShipoutUpperLeft{%
\Huge
\put(1cm,-.5\paperheight){%
\rotatebox[origin=c]{90}{\textcolor[gray]{0.90}{Draft: \today}}}%
\put(\dimexpr\paperwidth-1cm-\ht\strutbox\relax,-.5\paperheight){%
\rotatebox[origin=c]{270}{\textcolor[gray]{0.90}{Draft: \today}}}%
}}


Or, with eso-pic,

\documentclass{amsbook}
\usepackage{graphicx}
\usepackage{eso-pic,picture}

\setlength{\unitlength}{1pt}%
\protect{\put(.5\paperwidth,.5\paperheight){%
\makebox(-515,0){\rotatebox{90}{\textcolor[gray]{0.90}%
{\Huge Draft:  \today}}}%
\makebox(515,0){\rotatebox{270}{\textcolor[gray]{0.90}%
{\Huge  Draft:  \today}}}}}\ClearShipoutPictureBG}

\begin{document}

Hi
\newpage
Hi, again.

\end{document}


Note that the picture package allows for directly using dimensions in the picture commands.

-

Here is a command that I use frequently for watermarks. It also uses eso-pic. It puts the contents at the center of the text block.

• \WaterMark{<picture>} - puts watermark on ever page (can be stopped with \ClearShipoutPictureBG)

• \WaterMark*{<picture>} - puts watermark on single page

It is also useful if you want to put a logo watermark on every page (use Gimp to downtone the picture)

\documentclass{article}
\usepackage{graphicx}
\usepackage{eso-pic}
\makeatletter
\newcommand\WaterMark{%
\@ifstar{\@WaterMarkS}{\@watermark}}
\newcommand\@WaterMark[1]{%
\newcommand\@WaterMarkS[1]{%
\newcommand\NullGrphBox[1]{%
\parbox[c]{0pt}{\makebox[0pt][c]{#1}}}
\makeatother

\newcommand\draftpictA{%
\setlength{\unitlength}{1mm}%
\begin{picture}(0,0)(0,0)
\makebox(-180,0){\rotatebox{90}{\textcolor[gray]{0.10}%
{\Huge Draft:  \today}}}
\makebox(180,0){\rotatebox{270}{\textcolor[gray]{0.10}%
{\Huge  Draft:  \today}}}
\end{picture}}

\newcommand\draftpictB{%
\rotatebox[origin=c]{60}{\scalebox{15}{%
\textcolor[gray]{0.90}{\textbf{DRAFT}}}}}

\begin{document}
\WaterMark*{\draftpictB}
Hi
\newpage
Hi, again.
\newpage
xx
\end{document}

-

I recommended to use pdftk for such things. If watermark.pdf is the (LaTeX generated) watermark (1 page) with an additional empty page and mydocument.pdf is the (may be LaTeX generated) own document, you can can "watermark" it:

pdftk mydocument.pdf multibackground watermark.pdf output mydocumentwatermark.pdf

-

I use the following, which does what I want, and seems to satisfy your needs as well:

 \usepackage{eso-pic,graphicx}
\definecolor{LtGrey}{rgb}{0.975,0.975,0.975}


 \AddToShipoutPicture*{%