0

i want to place on a document randomly a small picture. I use for that the xwatermark and lcg package. The newwatermark within the dokument works fine with the lcg, appart from the fact there is sometimes a text showing up "gray!55".

Now i want a command \randsign that allows me to say how often i want this watermark on the page. But unfortunatley this is not working.

I used this Method for lcg, but it does not work for me. Creating random problems by using rand option

Code snippet below:

\documentclass{article}
\usepackage{lipsum}
\usepackage[printwatermark]{xwatermark}
\usepackage{lcg}


\newcommand{\randsign}[1]{
\foreach \i in {1,...,#1}{
\reinitrand[first=0, last=360, counter=rangle] \rand
\reinitrand[first=-90, last= 90, counter=rxpos] \rand
\reinitrand[first= -130, last=130, counter=rypos] \rand
\newwatermark[allpages,scale=1,align=center,angle=\value{rangle},xpos=\value{rxpos},ypos=\value{rypos},textmark={\includegraphics[width=0.9cm]{./signature.png}}]{} \rand
}
}
\begin{document}


\newwatermark[allpages,scale=1,align=center,angle=\value{rangle},xpos=\value{rxpos},ypos=\value{rypos},textmark={\includegraphics[width=0.9cm]{./signature.png}}]{} \rand

\section{Section watermark}
\randsign{10}
\lipsum[1-6]

\end{document}
  • Hello, your MWE is not compilable. First there are images in it, please dont do that. Secondly, you are missing the package pdffor. Without that package the foreach loop does not work. Try to add that and see if it works. – Sango Sep 27 '19 at 12:57
  • i can not find the package pdffor in my repository. Yes, the image is missing. But any image can be use. Since the MWE is a copy of the link above, it should acutally work. The MWE there does not need a pdffor package. – user198499 Oct 01 '19 at 12:22

0 Answers0