67

I want to put a draft watermark using the below script but the problem is that the watermark don't come over the images and I want it to come over it.

\usepackage{draftwatermark}
\SetWatermarkText{DRAFT}
\SetWatermarkScale{1}
  • 1
    Are you looking for \SetWatermarkLightness{0}? – karlkoeller Jun 13 '13 at 6:00
  • 4
    Note that images in PDFs are stored in their original form and the watermark is just placed on top of it by the PDF viewer. As long the PDF is not encrypted the original images can be extracted using a PDF editing tool. – Martin Scharrer Jun 13 '13 at 6:48
  • The problem is that the watermark is displayed on the text but not the images – Tak Jun 13 '13 at 7:03
  • As Martin said, there might be problems when your images are in .pdf format. What kind of images are you dealing with? Can you add some more details in your question? – karlkoeller Jun 13 '13 at 7:23
67

The problem is that the draftwatermark places the material in the background, so other elements (for example, figures and listings) might cover the included material; to prevent this, instead of using the draftwatermark package, you can use the xwatermark package; the starred variant of \newwatermark places the material in the foreground which seems to be what you need. A little example:

First, with the unstarred variant (material on the background, so a figure will be placed on top of it):

\documentclass{article}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{lipsum}

\newwatermark[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}

\begin{document}

\lipsum[1-2]
\begin{figure}[!ht]
\centering
\includegraphics[width=3cm]{example-image-a}
\end{figure}
\lipsum[1-2]
\end{document}

enter image description here

And now, with the starred variant (material on the foreground, so it will appear on top of figures):

\documentclass{article}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{lipsum}

\newwatermark*[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}

\begin{document}

\lipsum[1-2]
\begin{figure}[!ht]
\centering
\includegraphics[width=3cm]{example-image-a}
\end{figure}
\lipsum[1-2]
\end{document}

enter image description here

  • 2
    Is it possible to make the foreground watermark tranparent, so that it doesn't render the text illegible? – SFAB Sep 10 '13 at 13:10
  • 1
    @SFAB please open a follow-up question with this requirement. – Gonzalo Medina Sep 10 '13 at 13:20
  • 1
    Done, see tex.stackexchange.com/q/132582/8277. – SFAB Sep 10 '13 at 13:41
  • 2
    I got an error with \newwatermark: ! Missing number, treated as zero.<to be read again>X ...=60,scale=3,xpos=0,ypos=0]{DRAFT} – s.k Jun 25 '17 at 13:29
  • 3
    And is there any way to get transparency for the foreground watermark? – s.k Jun 25 '17 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.