2

I need to fill the page (100%) with the watermark text repeated and rotated under 45 degrees. I should to do it for every page in document. This code works good, but in this case I have only one watermark at center.

\documentclass{article}
\usepackage{tikz}
\usepackage{pdfpages}
\pagestyle{empty}
\newcommand{\filename}{/home/Documents/c.pdf}
\newcommand{\watermark}{\tikz[remember picture, overlay]  \node [black,opacity=0.1,rotate=45,scale=4.0] at (current page.north west)  {This is watermark text to repeat again and again} -- (current page.south east);}

\begin{document}
\foreach \index in {1,...,\the\pdflastximagepages}
{
\includepdf[pages=\index,pagecommand={\watermark}]{\filename}
}
\end{document}

Any ideas or suggestions are welcome?

Thank you for your time and help.

Andy
  • 123
  • 5

1 Answers1

4
\documentclass{article}
\usepackage{tikz}
\usepackage{pdfpages}
\pagestyle{empty}

\newcommand*\watermarktext[1]{\leavevmode\hbox to 2\textwidth{\leaders\vbox to 2\textheight{\leaders\hbox{#1}\vfil}\hfil}}


\newcommand{\watermark}{\tikz[remember picture, overlay]  
 \node [black,opacity=0.1,rotate=45,scale=4.0] at (current page.center)  
   {\watermarktext{This is watermark text to repeat again and again}};}

\begin{document}

\includepdf[pages=1,pagecommand={\watermark}]{example-image}

\end{document}

enter image description here

Ulrike Fischer
  • 327,261