Review, Markup, and Approval
Using Commenting Tools
7
For example, the following code adds an "Approved" stamp to the document:
var annot = this.addAnnot({
page: 0,
type: "Stamp",
author: "Me",
name: "myStamp",
rect: [400,400,550,500],
contents: "Good work!",
AP: "Approved"
});
Header and Footer Functionality
You may use Acrobat JavaScript to add headers and footers to your documents. For
example, you may use the
doc
object’s
addWatermarkFromText
method, which has
several properties useful for this specific purpose:
●
●
●
cText
:
The actual text displayed in the header or footer.
nTextAlign
:
How the text is aligned in the header or footer.
vTextAlign
:
How the watermark is aligned vertically: a value of
0
aligns it at the top
of the page (header), and a value of
2
aligns it at the bottom of the page (footer).
●
nStart
:
The starting page for the watermark. A value of
-1
causes the resultant header
or footer to appear on every page of the document.
Control of Font, Size, Placement, Rotation, and Opacity
There are several properties to the
doc
object’s watermark addition methods useful for
controlling font, size, placement, rotation and opacity. These are listed below:
●
●
●
●
●
cFont
:
The font name.
cFontSize
:
The font size (in points).
nTextAlign
:
The text alignment.
nRotation
:
The rotation in degrees.
nOpacity
:
The opacity from 0.0 to 1.0, where 0 means transparent and 1 means
opaque.
Approval
Approval workflows may include an automated process in which a PDF document is
automatically sent via email to a recipient for their approval. For example, this may be
accomplished through the usage of the
doc
object’s
mailDoc
method. The user may then
use a standard approval stamp (set through the
annot
object’s
AP
property), use a custom
stamp, or use a Hanko stamp to create a secure digital signature.
Acrobat JavaScript Scripting Guide
135