How to insert watermark in Latex/PdfLatex documents

Category : How to

Sometimes I have been writing a document and I want to send a draft version to someone. However, since it is a draft version, I would like to make it clear and avoid doubts about it.

A useful solution is to insert a watermark in the document. In Latex there is a easy way to do that:

1
2
3
4
5
6
7
8
9
10
11
12
13
\usepackage{graphicx,type1cm,eso-pic,color}

\makeatletter
          \AddToShipoutPicture{
            \setlength{\@tempdimb}{.5\paperwidth}
            \setlength{\@tempdimc}{.5\paperheight}
            \setlength{\unitlength}{1pt}
            \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){
        \makebox(0,0){\rotatebox{55}{\textcolor[gray]{0.85}
        {\fontsize{5cm}{5cm}\selectfont{DRAFT}}}}
            }
       
}
\makeatother

You should put this code in your preamble, and it will put a watermark in all your pages.

And, of course, you can customize the text, size, etc.

Here is an screenshot of the output:



And click here to download the example.zip file used to produce that output (compile using: pdflatex example.tex).

Don’t forget to follow us on twitter and receive updates everytime I post something here: http://twitter.com/goodcomptips

Popularity: 100% [?]

No related posts.