104

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}
4
  • 2
    Are you looking for \SetWatermarkLightness{0}? Jun 13, 2013 at 6:00
  • 5
    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. Jun 13, 2013 at 6:48
  • The problem is that the watermark is displayed on the text but not the images
    – Tak
    Jun 13, 2013 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? Jun 13, 2013 at 7:23

1 Answer 1

99

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

10
  • 3
    Is it possible to make the foreground watermark tranparent, so that it doesn't render the text illegible?
    – SFAB
    Sep 10, 2013 at 13:10
  • 3
    Done, see tex.stackexchange.com/q/132582/8277.
    – SFAB
    Sep 10, 2013 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, 2017 at 13:29
  • 7
    And is there any way to get transparency for the foreground watermark?
    – s.k
    Jun 25, 2017 at 13:41
  • 4
    xwatermark stopped working in some recent latex version (I'm using the latest TinyTex), looking in the community it seems related to the catoptions package
    – Mojimi
    Feb 23, 2021 at 1:57

You must log in to answer this question.

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