With the help of Schrödinger's cat I've defined a tikz based command for printing an image saved in a box as a watermark:
\newcommand{\tikzwater}[2][]{%
\tikz[remember picture,overlay]{%
\node[#1] at (current page.center)%
{#2};}}
The optional argument #1 allows me to pass key-value options to the node, like opacity. If I want to print the picture saved in \mybox with an opacity of .1, all I have to do is calling:
(1) \tikzwater[opacity=.1]{\usebox\mybox}
at the begining of each page.
Now comes the challenge of making a command that does this automatically.
More precisely, I want a command:
(2) \beginwater{\usebox\mybox}
that calls (1) at the begining of each page of the document, starting at the page where (2) is called. I also want a command:
(3) \endwater{\usebox\mybox}
that stops the calling of (1), again, at the page where (3) is called.
This command would be the last in a series of commands I made only using the packages tikz and pgfkeys. This is why I'm not satisfied by the answers given to previous similar questions, which are based on using other packages such a background, eco-pic, watermark, etc. The closest I know is David Carlisle's answer, but it doesn't let you decide where to begin and end the printing of the watermark.
I hope someone can give me a hand on this one.
eco-picpackage, where\AddToShipoutPictureBGallows you to add a background picture to this and all subsequent pages, and\AddToShipoutPictureBG*adds a picture to this page only. – Sep 10 '19 at 12:18pgf/tikz. That is, unless you can convince me that there's a good reason for making an exception foreco-pic. – lfba Sep 10 '19 at 12:22eso-picallows you to put things really on the background (and so doesatbegshi). – Sep 10 '19 at 12:25