[powerdot] Re: pdclock.sty and PDFLaTeX

  • From: "Hendri Adriaens" <spotje@xxxxxxxxx>
  • To: powerdot <powerdot@xxxxxxxxxxxxx>
  • Date: Sun, 24 Jun 2007 18:33:49 +0200

Pablo,

you don't need \makeatletter in a package, see the LaTeX Companion.
Regarding your problem, read the hyperref docs on drivers.

\RequirePackage[setpagesize=false,dvips,pdfstartview=Fit,%
pageanchor=false,bookmarks=false]{hyperref}

'dvips' is the driver and that doesn't work with pdflatex. Your code
only contains hyperref stuff, so please look there first.

-Hendri.

---------------------

Dear Hendri,

I have succeed in my efforts to create a pdclock.sty! Please, see its
content below. It works in a test like:
\documentclass{report}
\usepackage{pdclock}
\begin{document}
\pdclock
\end{document}

but, only with LaTeX. Could you clue in a way to do it also with
PDFLaTeX? I tried changing the driver option to pdftex, but it returns
the error:

! pdfTeX error (ext1): \pdfstartlink cannot be used in vertical mode.
<argument> ...apeform \PDFForm@Text \pdfstartlink
                                               user {\PDFForm@Text
}\rela...
l.7 \pdclock

Best regards,
Pablo.
%pdclock.sty

\makeatletter

\RequirePackage[setpagesize=false,dvips,pdfstartview=Fit,%
pageanchor=false,bookmarks=false]{hyperref}

 \AtBeginDocument{%
   \@Form[]%
 }%

 \def\pd@startclock{%
   function pdshowtime(){
     var pdtime=new Date();
     this.getField("pdclock.time").value=
       util.printd("H:MM:ss",pdtime);
   }
   var tempa=app.setInterval("pdshowtime()",1000);
   this.getField("pdstartclock").readonly=true;
   this.getField("pdclock").readonly=true;
 }%

\newcommand{\pdclock}{%
     \TextField[format=\pd@startclock,name=pdstartclock,%
       bordercolor={},backgroundcolor={},height=0bp,width=0bp]{}%
     \TextField[name=pdclock.time,bordercolor={},%
       backgroundcolor={},align=1,color=0 0 0,%
       charsize=9pt,width=2cm,%
       height=0.25cm]{}%
}

\makeatother

Other related posts:

  • » [powerdot] Re: pdclock.sty and PDFLaTeX