Security
Digitally Signing PDF Documents
12
Applying the Signature
Now that the security handler and signature information have been created, you may
invoke the signature field’s
signatureSign
method, as shown in the code below:
// Obtain the signature field object:
var f = this.getField("myAuthorSignatureField");
// Sign the field:
f.signatureSign(
oSig: ppklite,
oInfo: myInfo,
cDIPath: "/C/mySignedFile.pdf",
bUI: true,
cLegalAttest: "Fonts are not embedded to reduce file size"
); //end of signature
Creating a New Signature Appearance
You may create a new signature appearance through the Acrobat user interface, access
signature appearances through the
appearances
property of the
securityHandler
object, and use the signature field’s
signatureSetSeedValue
method, which accepts
a
SeedValue
object used to control signature properties.
One of the
SeedValue
properties is called
subFilter
, which is an array of acceptable
formats to use for the signature. In the following example, the signing handler is set to
PPKMS
and the format is set to
adbe.pksc7.sha1
:
var f = this.getField("mySignatureField");
f.signatureSetSeedValue({
filter: "Adobe.PPKMS",
subFilter: ["adbe.pksc7.sha1"],
flags: 0x03
});
Clearing a Digital Signature from a Signature Field
To clear a signature, invoke the
doc
object’s
resetForm
method. In the example below,
mySignatureField
is cleared:
var f = this.getField("mySignatureField");
this.resetForm(f);
Acrobat JavaScript Scripting Guide
207