Last active
August 29, 2017 10:56
-
-
Save agrahn/bb6e6c6911f8cb919a64d9b7ba3daf59 to your computer and use it in GitHub Desktop.
[obsolete¹] Replacement for Powerdot clock. (1) as of Powerdot-1.5c, 2017-08-28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Copyright 2017--today Alexander Grahn | |
% | |
% This material is subject to the LaTeX Project Public License. See | |
% http://mirrors.ctan.org/help/Catalogue/licenses.lppl.html | |
% for the details of that license. | |
% | |
% This work has the LPPL maintenance status "maintained". | |
\NeedsTeXFormat{LaTeX2e} | |
\def\@pdclock@version{2017/08/18} | |
\ProvidesPackage{pdclock} | |
[\@pdclock@version\space replacement for Powerdot clock] | |
\RequirePackage{pdfbase} | |
\ExplSyntaxOn | |
\let\pd@PdfAnnot\pbs_pdfannot:nnnn\let\pd@PdfLastAnn\pbs_pdflastann: | |
\let\pd@AppendToFields\pbs_appendtofields:n | |
\ExplSyntaxOff | |
\newcount\pd@clockcnt | |
\def\pd@startclock#1#2{% | |
function pdshowtime(){% | |
var pdtime=new Date();% | |
this.getField("pdclock.\the\pd@clockcnt").value=util.printd("#1",pdtime);% | |
this.dirty=false;% | |
}% | |
pdshowtime();% | |
var pdclock_\the\pd@clockcnt=app.setInterval("pdshowtime()",#2);% | |
}% | |
\let\pdclock@pdftrans\pd@pdftrans | |
\def\pd@pdftrans{% | |
\def\pd@tempa##1,##2,##3\@nil{##1 ##2 ##3}% | |
\extractcolorspec\pd@@clockcolor\pd@tempb | |
\expandafter\convertcolorspec\pd@tempb{rgb}\pd@tempb | |
\edef\pd@tempa{\expandafter\pd@tempa\pd@tempb\@nil}% | |
\ifx\pd@@clockpos\@empty\else | |
\@tempdima=\pd@@clockcharsize | |
\rput[\pd@@clockhook](\pd@@clockpos){% | |
\makebox[\pd@@clockwidth][l]{\rule{0pt}{\pd@@clockheight}% | |
\pd@PdfAnnot{\pd@@clockwidth}{\pd@@clockheight}{0pt}{% | |
/Subtype/Widget/FT/Tx/T (pdclock.\the\pd@clockcnt) /Ff 1 | |
/DA (/Helv \strip@pt\@tempdima\space Tf \pd@tempa\space rg) | |
/MK<</R \ifnum\pd@orient=\z@ 90\else 0\fi /BG []/BC []>> | |
/Q \pd@@clockalign\space | |
/AA << | |
/PO << /S/JavaScript/JS(\pd@startclock\pd@@clockformat\pd@@clockrefresh) >> | |
/PC << /S/JavaScript/JS(app.clearInterval(pdclock_\the\pd@clockcnt);) >> | |
>> | |
}% | |
}% | |
\pd@AppendToFields{\pd@PdfLastAnn}% | |
\global\advance\pd@clockcnt by \@ne% | |
}% | |
\fi | |
\pdclock@pdftrans% | |
} | |
\endinput | |
%% | |
%% End of file `pdclock.sty'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use package
pdclock
as follows: