summaryrefslogtreecommitdiff
path: root/texmf-dist/tex/latex/mkstmpdad/mkstmp_pro.sty
blob: 7139e7f7f53bfcaef6e4a194b76e24caceaaef01 (plain)
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
%%
%% This is file `mkstmp_pro.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mkstmp_pro.dtx  (with options: `copyright,package')
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% mkstmp_pro package                                   %%
%% Copyright (C) 2012-2016  D. P. Story                 %%
%%   dpstory@uakron.edu                                 %%
%%                                                      %%
%% This program can redistributed and/or modified under %%
%% the terms of the LaTeX Project Public License        %%
%% Distributed from CTAN archives in directory          %%
%% macros/latex/base/lppl.txt; either version 1 of the  %%
%% License, or (at your option) any later version.      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mkstmp_pro}
 [2016/08/21 v1.1 Make Stamps for stamp annotations (dps)]
\RequirePackage{aeb_pro}[2012/11/09]
\RequirePackage{xkeyval}
\providecommand{\definePath}[1]{\def\ef@ctrlName{#1}%
    \hyper@normalise\ef@definePath}
\def\ef@definePath#1{\expandafter\xdef\ef@ctrlName{#1}}
\newcommand{\setStampPath}[1]{\definePath{\msp@stampPath}{#1}}
\define@key{makeStamp}{name}[]{\def\makeStamp@name{\##1}}
\let\msp@stampPath\@empty
\define@key{makeStamp}{path}[\msp@stampPath]{\edef\makeStamp@path{#1}}
\define@key{makeStamp}{page}[0]{\def\aeb@stamp@page{#1}}
\newcommand{\makeStamps}[1]{%
    \edef\@tforExp{\noexpand\@tfor\noexpand\msp@Args:=#1}%
    \@tforExp\do{\expandafter\ms@makeStamp
        \expandafter{\msp@Args}%
    }%
}
\newcommand{\ms@makeStamp}[1]{%
    \setkeys{makeStamp}{name,path,page,#1}%
    \ifx\make@Stamps@name\@empty
        \PackageError{mkstmp_pro}{The `name' key is required}
            {Please give the path of the stamp image.}\fi
    \ifx\makeStamp@path\@empty
        \PackageError{mkstmp_pro}{The `path' key is required}
            {Please give the path of the stamp image, or \MessageBreak
            use \string\setStampPath.}\fi
    \xdef\predocassemJS{%
        var retn=\insertPages({nPage:0, cPath:"\makeStamp@path",%
        nStart:\aeb@stamp@page});^^J%
        if ( retn==-1 ) console.println("The file
        \string\"\makeStamp@path\string\" could not be opened.");^^J%
        if ( retn==-2 ) console.println("Selected page
        (page=\aeb@stamp@page) for \string\"\makeStamp@path\string\"
        is invalid.");^^J%
        \createTemplate({cName:"\makeStamp@name",nPage:1});^^J%
        \predocassemJS%
    }%
}
\endinput
%%
%% End of file `mkstmp_pro.sty'.