Document Classesan old problem with pdfdraftcopy.sty

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
lnewton
Posts: 17
Joined: Mon Mar 31, 2008 3:01 pm

an old problem with pdfdraftcopy.sty

Post by lnewton »

This question resurrects a problem from 2006 to which I looked up the
answer, applied the proposed workaround, and find it is still broken.

We cannot build documents using pdflatex using pdfdraftcopy.sty under
conditions that are firm requirements for us.

The original problem and proposed solution are shown at this URL:

http://sarovar.org/tracker/index.php?fu ... 2&atid=289

The essential instructions from the workaround are to add two lines to
pdfdraftcopy.sty, namely, \RequirePackage{chngpage} at the appropriate
place near the beginning, and later, to change \ifodd\thepage to
\checkoddpage \ifcpoddpage

Someone reports that this works for him, but it does not for us. I do not know
why.

We use a local style file that is routinely loaded with options like this:

\usepackage[draft]{interhack}

Internally, in processing the draft option, it loads pdfdraftcopy,
then sets some parameters defined therein.

Upon running a typical document through latex, we get this sort of log
output:

! Missing = inserted for \ifnum.
<to be read again>
-
l.31 \draftstring
{DRAFT}

We are sure this is a manifestation of the same bug reported above.

It's absolutely necessary for us to use pdfdraftcopy to print the word
DRAFT as a watermark. We also use the hyperref package, which causes
output to clickable links. This does not work in DVI or when creating
files in DVI and then using dvipdf to translate it.

Is it possible to crosspost an inquiry? I might get broader feedback
in the General froum. Or is that inappropriate?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

an old problem with pdfdraftcopy.sty

Post by T3. »

lnewton wrote:Is it possible to crosspost an inquiry? I might get broader feedback
in the General froum. Or is that inappropriate?
I doubt that you would get more feedback that way. After all, it's the same forum. I would rather suggest trying more groups. Have you considered posting to comp.text.tex? A lot of TeX developers is hanging out there.

Cheers,

Tomek
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

an old problem with pdfdraftcopy.sty

Post by Stefan Kottwitz »

Hi Lynn,

for example I read the active topics no matter to what subforum they were posted, I usually check the active topics using the link View active topics.
I noticed that helpful answers usually appeared most rapidly if a compilable minimal example was given. For users willing to help it might be easier to compile and examine and even look at the source code of involved packages or classes then to try to construct a test example (showing the same described behaviour) by oneself before looking for a solution.

Stefan
LaTeX.org admin
lnewton
Posts: 17
Joined: Mon Mar 31, 2008 3:01 pm

an old problem with pdfdraftcopy.sty

Post by lnewton »

I was able to resolve this problem on the basis of
responses in comp.text.tex. Because the problem is one
that others might stumble across, I post the solution
here.

pdfdfraftcopy.sty is flat out broken. The fix involves
a patch that I put into our company style file.

First of all pdfdraftcopy.sty depends internally on its
version number, so if anyone tries to make a change to
it and then checks it in to a CVS repository, it will
evaluate the keyword strings, and no longer work at
all.

I put the following in the style file, which defines a
macro to execute that patches a command from
pdfdraftcopy after it is loaded, and then executes the
macro if the draft option is passed in:

\

Code: Select all

RequirePackage{chngpage}
\def\DoDraftStuff{%
\RequirePackage{pdfdraftcopy}
\RequirePackage{etoolbox}
\patchcmd{\@DRAFTdimen}
{\ifodd\thepage}{\checkoddpage \ifcpoddpage}{}{}
\draftstring{DRAFT}
\draftfontsize{215}
\draftangle{60}}
%
\if@draft \DoDraftStuff \fi
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This seems to work quite nicely.

Thank you all for your excellent support.
Lynn
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

Re: an old problem with pdfdraftcopy.sty

Post by T3. »

Good to know that you've finally sorted out this problem. Thanks for posting back. Looking at c.t.t. thread there was quite some level of expertise required to solve this one.

Cheers,

Tomek
Post Reply