\documentclass[12pt]{article}
\usepackage[
    web={pro,forcolorpaper,usesf},
    eforms
]{aeb_pro}
% private package
%\usepackage[usecmtt]{myriadpro}

\DeclareDocInfo
{
    title={Seeding a Signature Field with AeB Pro},
    author=D. P. Story,
    university=Acro\negthinspace\TeX.Net,
    email=dpstory@acrotex.net,
    subject={How to sign a signature field},
    keywords={digital signatures, signing},
    talksite=\url{http://www.acrotex.net},
    talkdate={\today},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL=http://www.acrotex.net
}
\preparedLabel{AeB Blog}
\talkdateLabel{Published:}
\nocopyright

\DeclareInitView
{%
    windowoptions={showtitle}
}

\DeclarePageLayout
{%
    textwidth=\paperwidth-3in,
    oddsidemargin=.5in,
    evensidemargin=0pt,
    marginparwidth=0pt,
    marginparsep=0pt,
}

\newcommand{\cs}[1]{\texttt{\char`\\#1}}
\pagestyle{empty}
\parskip\medskipamount
\parindent0pt

\begin{docassembly}
var sv={
    mdp: "defaultAndComments",
    reasons: ["This is a reason", "This is a better reason"],
    flags:0x80|0x100|0x8
};
var oSigField=this.getField("sigOfDPS");
\signatureSetSeedValue(sv);
\end{docassembly}

\begin{document}

\maketitle

\hfill\smash{\raisebox{-\baselineskip}{March 23, 2009}}

\begin{tabular}{@{}ll}
To:         &Honorable Barrister Maxwell Frimpong\\
From:       &D. P. Story\\
Subject:    &On Business Proposal\\
\end{tabular}

\vspace{2\baselineskip}

Dear Mr.\ Frimpong;

Thank you for thinking of me concerning an ``important business
proposal'' in your recent and brief email to me on March 23, 2009.
Recovering \$12,000,000 (twelve million  Us dollars) in claims
sounds intriging and exciting to me. Such a large amount of money
would certainly come in handy in these tough times. Yet,
regrettably, I must decline you kind offer; though I am in
retirement, I am, none-the-less, quite busy lately sorting my button
collection, and don't really have the time to pick up all this easy
money.

Thank you again, Barrister Frimpong, for your offer. Please keep me
in mind should future opportunities arise.


\vspace{2\baselineskip}

Best regards,\\
\sigField{sigOfDPS}{2.5in}{4\baselineskip}\makebox[0pt][l]{\quad Note: Acrobat required so sign}\\[3pt]
Dr.\ D. P. Story\\
Department of Mathematics,\\
The Talking University\\
Talkville, FL 12345\\
\texttt{dpstory@uakron.edu}

\newpage

In this example, we seed the signature field but do not sign it.
Signing, perhaps, comes later through the user interface.

As in the previous blog articles on signatures, we use \cs{sigField}
to create the field.

\begin{verbatim}
Best regards,\\
\sigField{sigOfDPS}{2.5in}{4\baselineskip}\\[3pt]
Dr.\ D. P. Story\\
Department of Mathematics,\\
The Talking University\\
Talkville, FL 12345\\
\texttt{dpstory@uakron.edu}
\end{verbatim}

The field is created then seeded using the \cs{signatureSetSeedValue}
command of AeB Pro. This command expands to execute the security
restricted JavaScript method \texttt{\emph{Field}.signatureSetSeedValue}.
The field is seeded as part of the \texttt{docassembly} event.

\begin{small}
\begin{verbatim}
\begin{docassembly}
var sv={
    mdp: "defaultAndComments",
    reasons: ["This is a reason", "This is a better reason"],
    flags:0x8
};
var oSigField=this.getField("sigOfDPS");
\signatureSetSeedValue(sv);
\end{docassembly}
\end{verbatim}
\end{small}%
We create a JavaScript object \texttt{sv}, and populate it with key-value pairs
that are to be passed to \texttt{\emph{Field}.signatureSetSeedValue}. The first
property (with key \texttt{mdp}) makes this into a certifying signature field,
the \texttt{reasons} key restricts the reason the \texttt{signer} can use when
he/she sign the field. The \texttt{flags} property makes it mandatory that one
of these listed  reasons be used. Next, we get the field object \texttt{oSigField}
for the signature field; the field object \emph{must be named} \texttt{oSigField},
this is the JavaScript variable that \cs{signatureSetSeedValue} expects the field
object to be named. We finish up by
passing this object \cs{signatureSetSeedValue(sv)} and we're done.

Information on signatures can be found
at the \href{http://www.adobe.com/go/acrobat_developer}{Acrobat Developer Center};
or go to the \href{http://www.adobe.com/go/acrobat_security}{Acrobat Security} page;
look for the document titled \textsl{Digital Signature User Guide for Acrobat 9.0
and Adobe Reader 9.0}.

The \emph{JavaScript for Acrobat API Reference}\footnote{Available through the
\href{http://www.adobe.com/go/acrobat_developer}{Acrobat Developer Center}.} for details
on these methods and their parameters.

Now, back to my retirement.


\end{document}

