That works fine and it looks great, but on pages where I include
graphics (e.g. a screenshot), the watermark is obscured by the
graphic.
Is there a way to make the watermark go on top of the graphic instead?
I'm using pdflatex.
thanks,
--Tim Arnold
fwiw, here's the code I'm using. inside a *.sty file:
\usepackage{eso-pic}
%--
\AddToShipoutPicture{%
\setlength{\@tempdimb}{.5\paperwidth}%
\setlength{\@tempdimc}{.5\paperheight}%
\put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
\makebox(0,0){\rotatebox{45}{\textcolor[gray]{0.8}%
{\sffamily\fontsize{7cm}{7cm}\selectfont{Draft}}}}%
\makebox(-500,-0){\rotatebox{90}{\textcolor[gray]{0.8}%
{\fontsize{1cm}{1cm}\selectfont{\textcopyright
Copyright 2010}}}}%
}%
}
Tim,
I do not have anything constructive to help solve the problem. But I
think that "watermark" is supposed to be under any text or other
printed matter so that it does not obscure anything. In fact, a true
watermark is embedded in the paper itself.
Tariq
Hi Tariq,
That makes sense, but it looks strange to see the graphic on the page
cut off the letters of the string 'Draft'. I'll re-read the docs on
includegraphics and see if there's any way to control the 'layer' it
writes to. It's an interesting problem to me--I've never really
thought about layers when doing LaTeX work.
thanks for the input,
--Tim
Tim,
I agree. I just tried your code with an image in the document and I
can see that a "Draft" partially obscured under a graphic does look
rather strange. It would indeed be nice to have "Draft" overlaid on
top of text and the graphics. My hunch is that perhaps one might have
to mess with the TeX's output routine: for example, getting your code
to be shipped out AFTER the rest of the page is done. Perhaps some
expert will come to the rescue. Good luck.
Tariq
I think you need to clean up the signature file so it
alread has transparent background. I am pretty sure
pdf viewers will honor that setting. I did such a thing
years ago: I converted a jpeg file to png, processed it
with a program that
(a) converted it to monochrome.
(b) converted that to pure black/white.
(c) set white as the transparent color.
Imagemagik's convert can probably do all that, and
probably netpbm as well, but I used a visually oriented
paint program in win95 whose name presently escapes me.
Dan
To reply by email, change LookInSig to luecking
I've run into a bug with using PNG files that have a transparency
channel; the text on the same page as the graphic is slightly jittered
so it appears to be bold. I think it's been fixed in the latest
version of pdflatex, but your suggestion just triggered the memory.
I can try adding the transparency, but I wonder if there is a way to
specify what goes on the paper first, the picture or the graphic. I
read through the docs on the graphics(x) package, but no mention is
made of layers. I guess this is far down the internals of TeX and is
beyond my ken.
Thanks for the suggestion--do you (or others) have an idea if which-
goes-first is tweakable?
thanks,
--Tim
> I've read the FAQ about watermarks and while there are several options
> available, I wanted to create my own by using eso-pic and putting my
> watermark by putting it in a box inside the \AddtoShipoutPicture
> macro.
>
> That works fine and it looks great, but on pages where I include
> graphics (e.g. a screenshot), the watermark is obscured by the
> graphic.
>
> Is there a way to make the watermark go on top of the graphic instead?
Well, eso-pic use \AtBeginShipOut from the atbegshi package. So
naturally it puts its content on the page first and it is obscured
by the rest of the page. If you want to put something last on the
page, use the footer:
\documentclass[]{article}
\usepackage{fancyhdr,color}
\pagestyle{fancy}
\lfoot{%
\begin{picture}(0,0)
\put(0,0){\color{red}\rule{0.5\textwidth}{0.5\textheight}}
\end{picture}}
\lhead{%
\begin{picture}(0,0)
\put(0,0){\hspace{-4cm}\rule[-0.7\textheight]{0.5\textwidth}{0.5\textheight}}
\end{picture}}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{eso-pic}
\AddToShipoutPicture{{\color{green}\rule{0.7\textwidth}{0.7\textheight}}}
\begin{document}
--
Ulrike Fischer
> Well, eso-pic use \AtBeginShipOut from the atbegshi package. So
> naturally it puts its content on the page first and it is obscured
> by the rest of the page. If you want to put something last on the
> page, use the footer:
Or package `atbegshi' can be used via
\AtBeginShipoutUpperLeftForground
instead of \AtBeginShipoutUpperLeft.
--
Heiko Oberdiek
Hi,
Thanks for all the information and suggestions. I've rewritten the
solution, this time using the 'transparent' package and 'eso-pic'.
After looking at the code of eso-pic and atbegshi, I was able to just
'let' AtBeginShipOutUpperLeft to AtBeginShipoutUpperLeftForeground,
which places the watermark on top. If you don't use transparency, the
words underneath the watermark text are blocked.
However, there's one problem with this solution. At least with
pdfTeXk, Version 3.1415926-1.40.9, the text appears jittered (view
with Acrobat reader), just as we've seen before when including a PNG
graphic with a tranparency channel. So the choice is to put the
watermark underneath the text (graphics will block out the watermark)
or put the watermark on top of the text (the transparency will jitter
the text when viewed in Adobe reader).
So, it's not perfect, but hey, the watermark *says* its a draft!
thanks again,
--Tim
\NeedsTeXFormat{LaTeX2e}[2003/12/01]
\ProvidesPackage{mywatermark}
%--
\usepackage{eso-pic}
\usepackage{transparent}
\let\AtBeginShipoutUpperLeft\AtBeginShipoutUpperLeftForeground
%--
\newlength{\@watermark@width}\setlength{\@watermark@width}{.
5\paperwidth}%
\newlength{\@watermark@height}\setlength{\@watermark@height}{.
5\paperheight}%
%
\AddToShipoutPicture{%
\setlength{\unitlength}{1pt}%
\put(\strip@pt\@watermark@width,\strip@pt\@watermark@height){%
\makebox(0,0){\rotatebox{45}{\texttransparent{0.1}%
{\rmfamily\scshape\mdseries\fontsize{5cm}{5cm}
\selectfont{Draft}}}}%
\makebox(-500,-0){\rotatebox{90}{\texttransparent{0.1}%
{\rmfamily\mdseries\fontsize{1cm}{1cm}