1

I need to add a watermark on all pages of a latex document but the first.

Currently, I'm using the draftwatermark package, but I haven't suceeded yet.

Any advice or suggestion?

I tried the xwatermark package, as suggested here, but it came out that it is not compatible with other packages I'm using.

5
  • You can modify this answer, it will work in your case. Can you manage to make it work? Let me know here.
    – Alenanno
    Commented Feb 4, 2016 at 8:49
  • I received a notification from a comment of yours. It worked then?
    – Alenanno
    Commented Feb 4, 2016 at 10:33
  • @Aleanno: Yes, thanks! I tried to write down the solution I adopted as a comment, but it was too long. So, I added an answer.
    – PieCot
    Commented Feb 4, 2016 at 11:32
  • I see that, but if the linked question helped you, then your answer is the same as the other one and this question is a duplicate.
    – Alenanno
    Commented Feb 4, 2016 at 11:33
  • Ok, it can be deleted if you think it is not useful for other users, no problem.
    – PieCot
    Commented Feb 4, 2016 at 11:35

1 Answer 1

1

Thanks to @Alenanno: I tried the solution he suggested and it worked like a charm! I slightly modified his code, adding a \watermarkon macro and now watermarks can be easily enabled/disabled for every single page.

This is my code:

\documentclass[12pt,a4paper]{exam}
\usepackage{draftwatermark}
\usepackage{etoolbox} 

%%%% for the 1 page %%%%
\usepackage[final]{pdfpages}
%%%%%%%%%%%%%%%%

\usepackage{blindtext}  
\SetWatermarkAngle{45} 
\SetWatermarkLightness{.8} 
\SetWatermarkFontSize{10cm} 
\SetWatermarkScale{8} 
\SetWatermarkText{\tt{DRAFT}}

%%% Macro to disable watermark
\makeatletter
\def\watermarkoff{%
        \@sc@wm@stampfalse
}
\makeatother

%%% Macro to enable watermark
\makeatletter
\def\watermarkon{%
        \@sc@wm@stamptrue
}
\makeatother


\begin{document} 

%%% no watermark on the first page
\watermarkoff
%%%% for the 1 page %%%%
\includepdf[pages={1},offset=0 0, delta=0 0, scale=1]{./lshort}
%%%%%%%%%%%%%%%%%%


%%% watermark on the second one
\watermarkon
\Blindtext
\newpage

%%% no watermark on the third page
\watermarkoff
\Blindtext
\newpage

%%% watermark on the remaining pages
\watermarkon
\Blindtext
\newpage
\Blindtext
\end{document}

And this is the result:

enter image description here

The first page (lshort) is the cover page of The (Not So) Short Introduction to LaTeX2e.

Not the answer you're looking for? Browse other questions tagged .