1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
%%
%%
%% This is file 'pdfdraftcopy.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%%
%% pdfdraftcopy.dtx (with options: 'package')
%%
%% File: pdfdraftcopy.dtx Copyright (c) 2003, C. V. Radhakrishnan
%% C. V. Rajagopal
%% River Valley Technologies, Floor III, SJP Buildings
%% Cotton Hills, Trivandrum, India 695014
%% http://www.river-valley.com
%%
%% This package may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
%% $Id: pdfdraftcopy.sty,v 1.2 2003/08/11 20:31:07 cvr Exp cvr $
%%
\NeedsTeXFormat{LaTeX2e}
\def\Fileversion$#1: #2 ${\gdef\fileversion{#2}}
\def\Filedate$#1: #2 #3 ${\gdef\filedate{#2}}
\Fileversion$Revision: 1.2 $
\Filedate$Date: 2003/08/11 20:31:07 $
\ProvidesPackage{pdfdraftcopy}
[\filedate\space\fileversion\space Draft copy in PDF (CVR)]
\PackageWarningNoLine{pdfdraftcopy}
{****************************************\MessageBreak
Package pdfdraftcopy v,\fileversion\space loaded\MessageBreak
[Draft copy in PDF (CVR)]\MessageBreak
****************************************}
\DeclareOption{watermark}{\AtBeginDocument{%
\begingroup\watermark\endgroup}}
\DeclareOption{draft}{\AtBeginDocument{%
\begingroup\draftcopy\endgroup}}
\ExecuteOptions{draft}
\ProcessOptions\relax
\RequirePackage{color,graphicx}
\let\@DRAFTout@Hook\@empty
\newcommand{\DRAFTout}{\g@addto@macro\@DRAFTout@Hook}
\newcommand{\@DRAFTout@Out}{%
\afterassignment\@DRAFTout@Test
\global\setbox\@cclv= %
}
\newcommand{\@DRAFTout@Test}{%
\ifvoid\@cclv\relax
\aftergroup\@DRAFTout@Output
\else
\@DRAFTout@Output
\fi%
}
\newcommand{\@DRAFTout@Output}{%
\@DRAFTout@Hook%
\@DRAFTout@Org@Out\box\@cclv%
}
\newcommand{\@DRAFTout@Org@Out}{}
\newcommand*{\@DRAFTout@Init}{%
\let\@DRAFTout@Org@Out\shipout
\let\shipout\@DRAFTout@Out
}
\AtBeginDocument{\@DRAFTout@Init}
\newcommand{\@DraftOverlay@Hook}{}
\newcommand{\AddToDraftOverlay}{\g@addto@macro\@DraftOverlay@Hook}
\newcommand{\ClearDraftOverlay}{\let\@DraftOverlay@Hook\@empty}
\newcommand{\@DraftOverlay}{%
\ifx\@DraftOverlay@Hook\@empty
\else
\bgroup
\@tempdima=1in
\@tempcnta=\@tempdima
\@tempcntb=-\@tempdima
\advance\@tempcntb\paperheight
\global\setbox\@cclv\vbox{%
\vbox{\let\protect\relax%
\unitlength=1sp%
\pictur@(0,0)(\@tempcnta,\@tempcntb)%
\@DraftOverlay@Hook%
\endpicture}%
\box\@cclv%
}%
\egroup
\fi
}
\definecolor{gray30}{gray}{.7}
\definecolor{gray20}{gray}{.8}
\definecolor{gray10}{gray}{.9}
\DRAFTout{\@DraftOverlay}
\newdimen\LLY
\newdimen\LLX
\newdimen\URX
\newdimen\URY
\newdimen\topmargin
\newdimen\bottommargin
\def\@printdimen{%\ifthenelse{\equal{\@debug}{true}}%
{\PackageWarningNoLine{PDFdraftcopy}%
{\LLX::::::::::::=\the\LLX\MessageBreak
\LLY::::::::::::=\the\LLY\MessageBreak
\URX::::::::::::=\the\URX\MessageBreak
\URY::::::::::::=\the\URY\MessageBreak
\oddsidemargin::=\the\oddsidemargin\MessageBreak
\evensidemargin:=\the\evensidemargin\MessageBreak
\textheight:::::=\the\textheight\MessageBreak
\textwidth::::::=\the\textwidth\MessageBreak
\paperwidth:::::=\the\paperwidth\MessageBreak
\paperheight::::=\the\paperheight\MessageBreak
\topmargin::::::=\the\topmargin\MessageBreak
\headheight:::::=\the\headheight\MessageBreak
\headsep::::::::=\the\headsep\MessageBreak
\footskip:::::::=\the\footskip\MessageBreak
\topskip::::::::=\the\topskip\MessageBreak
Now fixing the overlay in place
}}{}
}
\def\@DRAFTdimen{%
\setlength\LLY{\paperheight}
\addtolength\LLY{-\textheight}
\addtolength\LLY{-\headheight}
\addtolength\LLY{-\headsep}
\addtolength\LLY{-1in}
\addtolength\LLY{-3pt}
\setlength\LLX{1in}
\ifodd\c@page
\addtolength\LLX{\oddsidemargin}\else
\addtolength\LLX{\evensidemargin}\fi
\setlength\URX{\textwidth}
\setlength\URY{\textheight}
}
\def\LoadWaterMark{\watermark}
\def\watermark{\AddToDraftOverlay{%
\@DRAFTdimen%\@printdimen%
\setlength{\@tempdima}{0pt}
\setlength{\@tempdimb}{\paperwidth}
\addtolength{\@tempdimb}{-\@tempdima}
\addtolength{\@tempdimb}{-\@tempdima}
\setlength{\@tempdimc}{\paperheight}
\addtolength{\@tempdimc}{-\@tempdima}
\addtolength{\@tempdimc}{-\@tempdima}
\setlength{\unitlength}{1pt}\thinlines%
%
\put(0,\strip@pt\paperheight){\fboxrule0pt\fboxsep0pt%
%\fcolorbox{white}{red}%
{\begin{minipage}[t][\paperheight][c]{\paperwidth}
\centering
\ifx\@@watermark\@empty\relax\else
\includegraphics%[width=\paperwidth,height=\paperheight]%
{\@@watermark}\fi%
\end{minipage}}}}}%
\let\@@watermark\@empty
\def\watermarkgraphic#1{\gdef\@@watermark{#1}}
\def\draftcopy{\AddToDraftOverlay{%
\@DRAFTdimen%\@printdimen%
\setlength{\@tempdima}{0pt}
\setlength{\@tempdimb}{\paperwidth}
\addtolength{\@tempdimb}{-\@tempdima}
\addtolength{\@tempdimb}{-\@tempdima}
\setlength{\@tempdimc}{\paperheight}
\addtolength{\@tempdimc}{-\@tempdima}
\addtolength{\@tempdimc}{-\@tempdima}
\setlength{\unitlength}{1pt}\thinlines%
%
\put(0,\strip@pt\paperheight){\fboxrule0pt\fboxsep0pt%
%\fcolorbox{white}{red}%
{\begin{minipage}[t][\paperheight][c]{\paperwidth}
\centering
\begingroup
\rotatebox{\@draftangle}{\color{\@draftcolor}
\fontfamily{\@draftfontfamily}%
\fontsize{\@draftfontsize}{\@draftfontsize}\selectfont
{\@draftfontattrib\@draftstring}
}\endgroup
\end{minipage}}}}}%
\def\@draftangle{45}
\def\@draftstring{DRAFT COPY}
\def\@draftcolor{gray10}
\def\@draftfontfamily{ptm}
\def\@draftfontsize{80}
\def\@draftfontattrib{\upshape}
\def\draftstring#1{\gdef\@draftstring{#1}}
\def\draftcolor#1{\gdef\@draftcolor{#1}}
\def\draftfontfamily#1{\gdef\@draftfontfamily{#1}}
\def\draftfontsize#1{\gdef\@draftfontsize{#1}}
\def\draftfontattrib#1{\gdef\@draftfontattrib{#1}}
\def\draftangle#1{\gdef\@draftangle{#1}}
\endinput
%%
%%
%% End of package 'pdfdraftcopy.sty'
%%
|