How to write multiple lines as watermark?... and images with transparency?
Using the draftwatermark
package, you can use a \parbox
, or a minipage
, to have the text spanning several lines:
\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage{draftwatermark}
\usepackage{url}
\usepackage{lipsum}
\SetWatermarkText{\parbox{12cm}{%
Mika Ike \\
\url{[email protected]} \\
At My house}}
\SetWatermarkScale{.5}
\SetWatermarkColor{red}
\begin{document}
\lipsum[4]\lipsum[4]
\lipsum[4]\lipsum[4]
\end{document}
In the case of opacity for images, the draftwatermark
package apparently doesn't provide many possibilities.
As an alternative, I'd suggest you to use the background
package; since this package internally uses TikZ, you can easily control the attributes (opacity, color, position, etc.) for the background material. A little example:
\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage[scale=2.5,opacity=1,color=red]{background}
\usepackage{url}
\usepackage{varwidth}
\usepackage{lipsum}
\backgroundsetup{
contents={\begin{varwidth}{8cm}{%
Mika Ike \\
\url{[email protected]} \\
At My house}\end{varwidth}}
}
\begin{document}
\lipsum[4]\lipsum[4]
\lipsum[4]\lipsum[4]
\end{document}
The varwidth
environment was used to have a box of adjustable width allowing multiple lines of text; a minipage
or a \parbox
could also have been used instead.
And, using an image:
\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage[scale=1,opacity=0.75,angle=0]{background}
\usepackage{url}
\usepackage{varwidth}
\usepackage{lipsum}
\backgroundsetup{
contents={\includegraphics[height=\textheight,width=\textwidth,keepaspectratio]{ctanlion}}
}
\begin{document}
\lipsum[4]\lipsum[4]
\lipsum[4]\lipsum[4]
\end{document}
CTAN lion drawing by Duane Bibby.
One solution is to use \shortstack{}
which can be found in the manual of the draftwatermark package.
Example:
\documentclass{article}
\usepackage{lipsum}
\usepackage{draftwatermark}
\SetWatermarkText{
\shortstack{
\includegraphics[scale=0.8]{ctan_lion_600.png}
}
}
\SetWatermarkScale{0.15}
\begin{document}
\lipsum[1]
\lipsum[2]
\lipsum[3]
\lipsum[4]
\end{document}
Example:
\documentclass{article}
\usepackage{lipsum}
\usepackage{draftwatermark}
\SetWatermarkText{
\shortstack{
this is the first line \\[1em] second line
}
}
\SetWatermarkScale{2}
\SetWatermarkColor[gray]{0.5}
\begin{document}
\lipsum[1]
\lipsum[2]
\lipsum[3]
\lipsum[4]
\end{document}