Welcome to the UK List of
TeX Frequently Asked Questions
on the Web

Searching

The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:
Google

‘Watermarks’ on every page

It’s often useful to place some text (such as ‘DRAFT’) in the background of every page of a document. For LaTeX users, the simplest way to do this uses the draftcopy package. This can deal with many types of DVI processors (in the same way that the graphics package does) and knows translations for the word ‘DRAFT’ into a wide range of languages (though you can choose your own word, too). Unfortunately, however, the package relies on PostScript specials, and will therefore fail if you are viewing your document with xdvi, and won’t even compile if you’re using PDFLaTeX. (PDFLaTeX users need one of the other solutions below.)

The wallpaper package builds on eso-pic (see below). Apart from the single-image backdrops described above (“wallpapers”, of course, to this package), the package provides facilities for tiling images. All its commands come in pairs: one for “general” use, and one applying to the current page only.

The draftwatermark package uses the same author’s everypage package to provide a simple interface for adding textual (‘DRAFT’-like) watermarks.

The xwatermark package provides very flexible watermarking, with a “modern” (key-value) interface.

More elaborate watermarks may be achieved using the eso-pic package, or by using everypage (see below). Eso-pic attaches a picture environment to every page as it is shipped out; the user can put things into that environment: the package provides commands for placing things at certain useful points (like “text upper left” or “text centre”) in the picture, but the user is at liberty to do what he or she likes.

Eso-pic is, in turn, built upon the package atbegshi. That package has the capability to produce watermarks on top of the other material on the page; this doesn’t sound very “watermark-like”, but can be useful on pages where the watermark would otherwise be hidden by graphics or the like. The atbegshi command that eso-pic uses is \AtBeginShipoutUpperLeft; \AtBeginShipoutUpperLeftForeground is what’s needed instead to place the material on top of the rest of the content of the page.

Everypage allows you to add “something” to every page, or to a particular page; you therefore need to construct your own apparatus for anything complicated.

Finally, one can use the pdftk untility; with it, the command:

pdftk a.pdf background b.pdf output c.pdf

will recreate a.pdf as c.pdf, having used the first page of b.pdf as background on every page. If you have a standard background (“DRAFT” or “SECRET”, or whatever) used in several files, pdftk might well be attractive.

Pdftk is available as a command line tool; it is available in most linux distritbutions, but may be downloaded from its home site

atbegshi.sty
Distributed as part of macros/latex/contrib/oberdiek (or browse the directory); catalogue entry
draftcopy.sty
macros/latex/contrib/draftcopy (or browse the directory); catalogue entry
draftwatermark.sty
macros/latex/contrib/draftwatermark (or browse the directory); catalogue entry
eso-pic.sty
macros/latex/contrib/eso-pic (or browse the directory); catalogue entry
everypage.sty
macros/latex/contrib/everypage (or browse the directory); catalogue entry
everyshi.sty
Distributed as part of macros/latex/contrib/ms (or browse the directory); catalogue entry
wallpaper.sty
macros/latex/contrib/wallpaper (or browse the directory); catalogue entry


Go to previous question, or next question

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=watermark

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.27, released on 2013-06-07.