Javascript API: Class List

Javascript API
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
C Annotation | This object represents an Phantom annotation. Annotations can be created using the Phantom annotation tool or by using the Doc object method addAnnot. Before an annotation can be accessed, it must be bound to a JavaScript variable through a Doc object method such as getAnnot: var a = this.getAnnot(0, "f70f59c4-2dc8-4512-b15c-abdc90376c36"); The script can then manipulate the annotation named"f70f59c4-2dc8-4512-b15c-abdc90376c36" on page 1 (0-based page numbering system) by means of the variable a. For example, the following code first stores the type of annotation in the variable thetype, then changes the author to “John Q. Public”. var thetype = a.type; // read property a.author = "John Q. Public"; // write property Another way of accessing the Annotation object is through the Doc object getAnnots method
C app | This object is used to set and get the properties and to set the JavaScript action of a link
C attachment | The annotAttachment object represents the file stored as the attachment for a FileAttachment type annotation. annotAttachment is similar to the Data object and represents the file content and metadata of the attachment
C Bookmark | A Bookmark object represents a node in the bookmark tree that appears in the bookmarks navigational panel. Bookmarks are typically used as a table of contents allowing the user to navigate quickly to topics of interest
C Certificate | The Certificate object provides read-only access to the properties of an X.509 public key certificate
C console | The console object is a static object that enables access to the Phantom JavaScript Console for executing JavaScript and displaying debug messages
C Doc | This object provides the interface between a PDF Doc open in the viewer and the JavaScript interpreter. It provides methods and properties for accessing the PDF Doc
C Field | This object represents an form field (that is, a field created using the form tool or the Doc addField method). In the same manner that a form author can modify an existing field’s properties, such as the border color or font, the JavaScript user can use the Field object to perform the same modifications
C Index | An object that represents a Catalog-generated index. It is non-creatable and returned by various methods of the search object and catalog object. You use this object to perform various indexing operations using Catalog. You can find the status of the index with a search
C Link | This object is used to set and get the properties and to set the JavaScript action of a link
C OCG | An OCG object represents an optional content group in a PDF file. Content in the file can belong to one or more optional content groups. Content belonging to one or more OCGs is referred to as optional content and its visibility is determined by the states (ON or OFF) of the OCGs to which it belongs. In the simplest case, optional content belongs to a single OCG, with the content being visible when the OCG is on and hidden when the OCG is off. More advanced visibility behavior can be achieved by using multiple OCGs and different visibility mappings. Use the Doc getOCGs method to get an array of OCG objects for a PDF document. The Doc methods addWatermarkFromFile and addWatermarkFromText add watermarks in an OCG. See the PDF Reference for additional details on optional content groups
C search | The search object is a static object that accesses the functionality provided by the Phantom Search plug-in. This plug-in must be installed to interface with the search object (see available). See also the Index object, which is returned by some of the methods of the search object. The results for query calls are displayed in the Find dialog box of Phantom
C Span | A generic object that represents a length of text and its associated properties in a rich text form field or annotation. A rich text value consists of an array of span objects representing the text and formatting
Generated by doxygen 1.8.15


Javascript API: Annotation Class Reference

Public Member Functions | List of all members
Annotation Class Reference

This object represents an Phantom annotation. Annotations can be created using the Phantom annotation tool or by using the Doc object method addAnnot. Before an annotation can be accessed, it must be bound to a JavaScript variable through a Doc object method such as getAnnot: var a = this.getAnnot(0, "f70f59c4-2dc8-4512-b15c-abdc90376c36"); The script can then manipulate the annotation named"f70f59c4-2dc8-4512-b15c-abdc90376c36" on page 1 (0-based page numbering system) by means of the variable a. For example, the following code first stores the type of annotation in the variable thetype, then changes the author to “John Q. Public”. var thetype = a.type; // read property a.author = "John Q. Public"; // write property Another way of accessing the Annotation object is through the Doc object getAnnots method.

Public Member Functions

FX_BOOL | alignment (OBJ_PROP_PARAMS)
Controls the alignment of the text for a FreeText annotation. More...
FX_BOOL | AP (OBJ_PROP_PARAMS)
The named appearance of the stamp to be used in displaying a stamp annotation. The names of the standard stamp annotations are given below: Approved Void Verified Revised Reviewed Received Final Expired Emergency Draft Confidential Completed. More...
FX_BOOL | arrowBegin (OBJ_PROP_PARAMS)
Determines the line cap style that specifies the shape to be used at the beginning of a line annotation. Permissible values are:
None (default)
OpenArrow
ClosedArrow
ROpenArrow
RClosedArrow
Butt
Diamond
Circle
Square
Slash
. More...
FX_BOOL | arrowEnd (OBJ_PROP_PARAMS)
Determines the line cap style that specifies the shape to be used at the end of a line annotation. The following list shows the allowed values:
None (default)
OpenArrow
ClosedArrow
ROpenArrow
RClosedArrow
Butt
Diamond
Circle
Square
Slash
. More...
FX_BOOL | attachIcon (OBJ_PROP_PARAMS)
The name of an icon to be used in displaying the annotation. Recognized values are listed below: Paperclip
PushPin (default)
Graph
Tag
. More...
FX_BOOL | author (OBJ_PROP_PARAMS)
Gets or sets the author of the annotation. More...
FX_BOOL | borderEffectIntensity (OBJ_PROP_PARAMS)
The intensity of the border effect, if any. This represents how cloudy a cloudy rectangle, polygon, or oval is. More...
FX_BOOL | borderEffectStyle (OBJ_PROP_PARAMS)
If non-empty, the name of a border effect style. Currently, the only supported border effects are the empty string (nothing) or “C” for cloudy. More...
FX_BOOL | callout (OBJ_PROP_PARAMS)
An array of four or six numbers specifying a callout line attached to the free text annotation. See the PDF Reference for additional details. More...
FX_BOOL | caretSymbol (OBJ_PROP_PARAMS)
The symbol associated with a Caret annotation, which is a visual symbol that indicates the presence of text edits. Valid values are “” (nothing), “P” (paragraph symbol) or “S” (space symbol). More...
FX_BOOL | contents (OBJ_PROP_PARAMS)
Accesses the contents of any annotation that has a pop-up window. For sound and file attachment annotations, specifies the text to be displayed as a description. More...
FX_BOOL | creationDate (OBJ_PROP_PARAMS)
The date and time when the annotation was created. More...
FX_BOOL | dash (OBJ_PROP_PARAMS)
A dash array defining a pattern of dashes and gaps to be used in drawing a dashed border. For example, a value of [3, 2] specifies a border drawn with 3-point dashes alternating with 2-point gaps. To set the dash array, the style property must be set to D. More...
FX_BOOL | delay (OBJ_PROP_PARAMS)
If true, property changes to the annotation are queued and then executed when delay is set back to false. (Similar to the Field object delay property.) More...
FX_BOOL | doc (OBJ_PROP_PARAMS)
The Doc object of the document in which the annotation resides. More...
FX_BOOL | doCaption (OBJ_PROP_PARAMS)
If true, draws the rich contents in the line appearance itself. More...
FX_BOOL | fillColor (OBJ_PROP_PARAMS)
Sets the background color for circle, square, line, polygon, polyline, and free text annotations. Values are defined by using transparent, gray, RGB or CMYK color. See Color arrays for information on defining color arrays and how values are used with this property. More...
FX_BOOL | gestures (OBJ_PROP_PARAMS)
An array of arrays, each representing a stroked path. Each array is a series of alternating x and y coordinates in default user space, specifying points along the path. When drawn, the points are connected by straight lines or curves in an implementation-dependent way. See the PDF Reference for more details. More...
FX_BOOL | hidden (OBJ_PROP_PARAMS)
If true, the annotation is not shown and there is no user interaction, display, or printing of the annotation. More...
FX_BOOL | inReplyTo (OBJ_PROP_PARAMS)
If non-empty, specifies the name value of the annotation that this annotation is in reply to. More...
FX_BOOL | intent (OBJ_PROP_PARAMS)
This property allows a markup annotation type to behave differently, depending on the intended use of the annotation. For example, the Callout Tool is a free text annotation with intent set to FreeTextCallout. Though this property is defined for all annotations, currently, only free text, polygon,and line annotations have non-empty values for intent. More...
FX_BOOL | leaderExtend (OBJ_PROP_PARAMS)
Specifies the length of leader line extensions that extend from both endpoints of the line, perpendicular to the line. These lines extend from the line proper 180 degrees from the leader lines. The value should always be greater than or equal to zero. The default is zero (no leader line extension). More...
FX_BOOL | leaderLength (OBJ_PROP_PARAMS)
Specifies the length of leader lines that extend from both endpoints of the line, perpendicular to the line. The value may be negative to specify an alternate orientation of the leader lines. The default is 0 (no leader line). More...
FX_BOOL | lineEnding (OBJ_PROP_PARAMS)
This property determines how the end of a callout line is stroked. It is relevant only for a free text annotation when the value of intent is FreeTextCallout. Recognized values are listed below:
None (default)
OpenArrow
ClosedArrow
ROpenArrow
RClosedArrow
Butt
Diamond
Circle
Square
Slash
. More...
FX_BOOL | lock (OBJ_PROP_PARAMS)
If true, the annotation is locked, which is equivalent to readOnly except that the annotation is accessible through the properties dialog box in the UI. More...
FX_BOOL | modDate (OBJ_PROP_PARAMS)
The last modification date for the annotation. More...
FX_BOOL | name (OBJ_PROP_PARAMS)
The name of an annotation. This value can be used by the Doc object getAnnot method to find and access the properties and methods of the annotation. More...
FX_BOOL | noteIcon (OBJ_PROP_PARAMS)
The name of an icon to be used in displaying the annotation. Recognized values are given below: Check Circle Comment Cross Help Insert Key NewParagraph Note(default) Paragraph RightArrow RightPointer Star UpArrow UpLeftArrow. More...
FX_BOOL | noView (OBJ_PROP_PARAMS)
If true, the annotation is hidden, but if the annotation has an appearance, that appearance should be used for printing only. More...
FX_BOOL | opacity (OBJ_PROP_PARAMS)
The constant opacity value to be used in painting the annotation. This value applies to all visible elements of the annotation in its closed state (including its background and border), but not to the pop-up window that appears when the annotation is opened. Permissible values are 0.0 - 1.0. A value of 0.5 makes the annotation semitransparent. More...
FX_BOOL | page (OBJ_PROP_PARAMS)
The page on which the annotation resides. More...
FX_BOOL | point (OBJ_PROP_PARAMS)
An array of two numbers, [xul, yul] that specifies the upper left-hand corner in default user space of the icon for a text, sound or file attachment annotation. More...
FX_BOOL | points (OBJ_PROP_PARAMS)
An array of two points, [[x1, y1], [x2, y2]], specifying the starting and ending coordinates of the line in default user space. More...
FX_BOOL | popupOpen (OBJ_PROP_PARAMS)
If true, the pop-up text note appears open when the page is displayed. More...
FX_BOOL | popupRect (OBJ_PROP_PARAMS)
An array of four numbers [xll, yll, xur, yur] specifying the lower-left x, lower-left y, upper-right x, and upper-right y coordinates—in default user space—of the rectangle of the pop-up annotation associated with a parent annotation. It defines the location of the pop-up annotation on the page. More...
FX_BOOL | print (OBJ_PROP_PARAMS)
Indicates whether the annotation should be printed (true) or not (false). More...
FX_BOOL | quads (OBJ_PROP_PARAMS)
An array of 8 x n numbers specifying the coordinates of n quadrilaterals in default user space. Each quadrilateral encompasses a word or group of contiguous words in the text underlying the annotation. See the PDF Reference for more details. The quads for a word can be obtained through calls to the Doc object getPageNthWordQuads method. More...
FX_BOOL | readOnly (OBJ_PROP_PARAMS)
If true, the annotation should display but not interact with the user. More...
FX_BOOL | rect (OBJ_PROP_PARAMS)
The rect array consists of four numbers [xll, yll, xur, yur] specifying the lower-left x, lower-left y, upper-right x, and upper-right y coordinates—in default user space—of the rectangle defining the location of the annotation on the page. See also the popupRect property. More...
FX_BOOL | refType (OBJ_PROP_PARAMS)
The reference type of the annotation. The property distinguishes whether inReplyTo indicates a plain threaded discussion relationship or a group relationship. Recognized values are “R” and “Group”. See the PDF Reference for additional details. More...
FX_BOOL | soundIcon (OBJ_PROP_PARAMS)
The name of an icon to be used in displaying the sound annotation. A value of “Speaker” is recognized. More...
FX_BOOL | strokeColor (OBJ_PROP_PARAMS)
Sets the appearance color of the annotation. Values are defined by using transparent, gray, RGB or CMYK color. In the case of a free text annotation, strokeColor sets the border and text colors. See Color arrays for information on defining color arrays and how values are used with this property. More...
FX_BOOL | style (OBJ_PROP_PARAMS)
This property gets and sets the border style. Recognized values are S (solid) and D (dashed). The style property is defined for all annotation types but is only relevant for line, free text, circle, square, polyline, polygon and ink annotations. More...
FX_BOOL | subject (OBJ_PROP_PARAMS)
Text representing a short description of the subject being addressed by the annotation. The text appears in the title bar of the pop-up window, if there is one, or the properties dialog box. More...
FX_BOOL | textFont (OBJ_PROP_PARAMS)
Determines the font that is used when laying out text in a free text annotation. Valid fonts are defined as properties of the font object (see the Field object textFont property). An arbitrary font can be used when laying out a free text annotation by setting the value of textFont equal to a string that represents the PostScript name of the font. More...
FX_BOOL | textSize (OBJ_PROP_PARAMS)
The text size (in points) for a free text annotation. Valid text sizes include zero and the range from 4 to 144, inclusive. Zero indicates the largest point size that allows all the text to fit in the annotation’s rectangle. More...
FX_BOOL | toggleNoView (OBJ_PROP_PARAMS)
If true, the noView flag is toggled when the mouse hovers over the annotation or the annotation is selected. If an annotation has both the noView and toggleNoView flags set, the annotation is usually invisible. However, when the mouse is over it or it is selected, it becomes visible. More...
FX_BOOL | type (OBJ_PROP_PARAMS)
The type of annotation. The type of an annotation can only be set within the object-literal argument of the Doc object addAnnot method. The valid values are:
Text
FreeText
Line
Square
Circle
Polygon
PolyLine
Highlight
Underline
Squiggly
StrikeOut
Stamp
Caret
Ink
FileAttachment
Sound
. More...
FX_BOOL | vertices (OBJ_PROP_PARAMS)
An array of coordinate arrays representing the alternating horizontal and vertical coordinates, respectively, of each vertex, in default user space of a polygon or polyline annotation. See the PDF Reference for details. More...
FX_BOOL | width (OBJ_PROP_PARAMS)
The border width in points. If this value is 0, no border is drawn. The default value is 1. More...
FX_BOOL | destroy (OBJ_METHOD_PARAMS)
Destroys the annotation, removing it from the page. The object becomes invalid. More...

Member Function Documentation

◆ alignment()

FX_BOOL Annotation::alignment ( OBJ_PROP_PARAMS )
Alignment | Value
Left aligned | 0
Centered | 1
Right aligned | 2
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Annotations
FreeText, Redact
Example
var gAnnot= this.getAnnot(0,"f70f59c4-2dc8-4512-b15c-abdc90376c36");// annot must be exist.
app.alert(gAnnot.alignment);
gAnnot.alignment = 2;
app.alert(gAnnot.alignment);

◆ AP()

FX_BOOL Annotation::AP ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
Stamp
Example
Programmatically add a stamp annotation.
var annot = this.addAnnot({
page: 0,
type: "Stamp",
author: "abc",
name: "myStamp",
rect: [400, 400, 550, 500],
contents: "Try it again, this time with order and method!",
AP: "Approved" });
Note:The name of a particular stamp can be found by opening the PDF file in the Stamps folder that contains the stamp in question. For a list of stamp names currently in use in the document, see the Doc object icons property.

◆ arrowBegin()

FX_BOOL Annotation::arrowBegin ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
Line, PolyLine
Example
var gAnnot= this.getAnnot(0,"3df1483e-6b0a-4651-85bc-174a2caf3927");
gAnnot.arrowBegin="OpenArrow";

◆ arrowEnd()

FX_BOOL Annotation::arrowEnd ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
Line, PolyLine
Example
var gAnnot= this.getAnnot(0,"3df1483e-6b0a-4651-85bc-174a2caf3927");
gAnnot.arrowEnd="OpenArrow";

◆ attachIcon()

FX_BOOL Annotation::attachIcon ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
FileAttachment
Example
var gannot1= this.getAnnot(0,"4326c763-2518-48ba-9cbf-067f20313e06");
gannot1.attachIcon="Paperclip";

◆ author()

FX_BOOL Annotation::author ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
var annots = this.getAnnots(0, ANSB_Type, true);
var newAuthor = "new author";
for (var i = 0; i < annots.length; i++)
{
annots[i].author= newAuthor ;
console.println(util.printf(annots[i].name+" author is ："+annots[i].author));
}

◆ borderEffectIntensity()

FX_BOOL Annotation::borderEffectIntensity ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
{
annots[i].borderEffectIntensity =2;
console.println(annots[i].borderEffectIntensity);
}

◆ borderEffectStyle()

FX_BOOL Annotation::borderEffectStyle ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
{
annots[i].borderEffectStyle ="C";
console.println(annots[i].borderEffectStyle);
}

◆ callout()

FX_BOOL Annotation::callout ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Annotations
FreeText
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
{
console.println(annots[i].callout)
}

◆ caretSymbol()

FX_BOOL Annotation::caretSymbol ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
Caret
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
{
console.println(annots[i].caretSymbol)
}

◆ contents()

FX_BOOL Annotation::contents ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
Create a text annotation, with author and contents specified.
var annot = this.addAnnot({
page: 0,
type: "Text",
point: [400,500],
author: "abc",
contents: "Call Smith to get help on this paragraph.",
noteIcon: "Help"
});
See also the Doc object addAnnot method.

◆ creationDate()

FX_BOOL Annotation::creationDate ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Date
Access
R
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
{
console.println(annots[i].creationDate)
}

◆ dash()

FX_BOOL Annotation::dash ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Annotations
FreeText, Line, PolyLine, Polygon, Circle, Square, Ink
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].dash));

◆ delay()

FX_BOOL Annotation::delay ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
Assuming annot is an Annotation object, the code below changes the border to dashed.
annot.delay=true;
annot.style = "D";
annot.dash = [4,3];
annot.delay = false;

◆ doc()

FX_BOOL Annotation::doc ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Doc object
Access
R
Availability:
Phantom/Reader
Annotations
All
Example
Construct an annotation, and illustrate the use of the doc property.
var inch = 72;
var annot = this.addAnnot({
page: 0,
type: "Square",
rect: [1*inch, 3*inch, 2*inch, 3.5*inch]
});
console.println(annot.doc.URL);

◆ doCaption()

FX_BOOL Annotation::doCaption ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
Line
Example
function Annotation_doCaption()
{
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].doCaption));
}
Annotation_doCaption();

◆ fillColor()

FX_BOOL Annotation::fillColor ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Color
Access
R/W
Availability:
Phantom/Reader
Annotations
Circle, Square, Line, Polygon, PolyLine, FreeText
Example
Create a Circle annotation and set the background color.
var annot = this.addAnnot(
{
type: "Circle",
page: 0,
rect: [200,200,400,300],
author: "abc",
name: "myCircle",
popupOpen: true,
popupRect: [200,100,400,200],
contents: "Hi World!",
strokeColor: color.red,
fillColor: ["RGB",1,1,.855]
});

◆ gestures()

FX_BOOL Annotation::gestures ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Annotations
Ink
Example
function Annotation_gestures()
{
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].gestures));
}
Annotation_gestures();

◆ hidden()

FX_BOOL Annotation::hidden ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
function Annotation_hidden()
{
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].hidden));
}
Annotation_hidden();

◆ inReplyTo()

FX_BOOL Annotation::inReplyTo ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
function Annotation_hidden()
{
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].inReplyTo));
}
Annotation_hidden();

◆ intent()

FX_BOOL Annotation::intent ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All The table below lists the tools available through the UI for creating annotations with special appearances.
UI | Annotation type | Intent
Callout Tool | FreeText | FreeTextCallout
Cloud Tool | Polygon | PolygonCloud
Arrow Tool | Line | LineArrow
Dimensioning Tool | Line | LineDimension
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].intent));

◆ leaderExtend()

FX_BOOL Annotation::leaderExtend ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Annotations
Line
Example
function Annotation_leaderExtend()
{
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);;
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].leaderExtend));
}
Annotation_leaderExtend();

◆ leaderLength()

FX_BOOL Annotation::leaderLength ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Annotations
Line
Example
function Annotation_leaderLength()
{
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);;
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].leaderLength));
}
Annotation_leaderLength();

◆ lineEnding()

FX_BOOL Annotation::lineEnding ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
FreeText
Example
function Annotation_lineEnding()
{
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].lineEnding));
}
Annotation_lineEnding();

◆ lock()

FX_BOOL Annotation::lock ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
All
var annots = this.getAnnots(0, ANSB_Type, true);
for (var i = 0; i < annots.length; i++)
{
console.println(util.printf(annots[i].lock));
annots[i].lock = true;
console.println(util.printf(annots[i].lock));
}

◆ modDate()

FX_BOOL Annotation::modDate ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Date
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
Print the modification date to the console.
console.println(util.printd("mmmm dd, yyyy", annot.modDate));

◆ name()

FX_BOOL Annotation::name ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].name));

◆ noteIcon()

FX_BOOL Annotation::noteIcon ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
Text
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].noteIcon));

◆ noView()

FX_BOOL Annotation::noView ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
{
console.println(util.printf(annots[i].noView));
annots[i].noView = true;
console.println(util.printf(annots[i].noView));
}

◆ opacity()

FX_BOOL Annotation::opacity ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].opacity));

◆ page()

FX_BOOL Annotation::page ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
The following code moves the Annotation object annot from its current page to page 3 (0-based page numbering system).
annot.page = 2;

◆ point()

FX_BOOL Annotation::point ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Annotations
Text, Sound, FileAttachment
Example
Place a help note icon at specified coordinates. The icon is located at the upper right corner of the popup note.
var annot = this.addAnnot({
page: 0,
type: "Text",
point: [400,500],
contents: "Call Smith to get help on this paragraph.",
popupRect: [400,400,550,500],
popupOpen: true,
noteIcon: "Help"
});
See also the noteIcon property and the Doc object addAnnot method.

◆ points()

FX_BOOL Annotation::points ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Annotations
Line
Example
Draw a line between two specified points.
var annot = this.addAnnot({
type: "Line",
page: 0,
author: "abc",
doCaption: true,
contents: "Look at this again!",
points: [[10,40],[200,200]],
});
See the arrowBegin and arrowEnd properties, the setProps method, and the Doc object addAnnot method.

◆ popupOpen()

FX_BOOL Annotation::popupOpen ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
All except FreeText, Sound, FileAttachment
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].popupOpen));

◆ popupRect()

FX_BOOL Annotation::popupRect ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Annotations
All except FreeText, Sound, FileAttachment
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].popupRect));

◆ print()

FX_BOOL Annotation::print ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].print));

◆ quads()

FX_BOOL Annotation::quads ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Annotations
Highlight, StrikeOut, Underline, Squiggly,Redact
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].quads));

◆ readOnly()

FX_BOOL Annotation::readOnly ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].readOnly));

◆ rect()

FX_BOOL Annotation::rect ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].rect));

◆ refType()

FX_BOOL Annotation::refType ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].refType));

◆ soundIcon()

FX_BOOL Annotation::soundIcon ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
Sound
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].soundIcon));

◆ strokeColor()

FX_BOOL Annotation::strokeColor ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Color
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
Make a text note red.
var annot = this.addAnnot({type: "Text"});
annot.strokeColor = color.red;

◆ style()

FX_BOOL Annotation::style ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].style));

◆ subject()

FX_BOOL Annotation::subject ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].subject));

◆ textFont()

FX_BOOL Annotation::textFont ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Annotations
FreeText
Example
Create a FreeText annotation using the Helvetica font.
var annot = this.addAnnot({
page: 0,
type: "FreeText",
textFont: font.Helv, // or, textFont: "Viva-Regular",
textSize: 10,
rect: [200, 300, 200+150, 300+3*12], // height for three lines
width: 1,
alignment: 1 });

◆ textSize()

FX_BOOL Annotation::textSize ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Annotations
FreeText
Example
See the textFont property.

◆ toggleNoView()

FX_BOOL Annotation::toggleNoView ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Annotations
All
Example
function Annotation_toggleNoView()
{
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
var msg = "%s toggleNoView is %s";
for (var i = 0; i < annots.length; i++)
console.println(util.printf(msg,annots[i].type, annots[i].toggleNoView));
}
Annotation_toggleNoView();

◆ type()

FX_BOOL Annotation::type ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader
Annotations
All
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].type));

◆ vertices()

FX_BOOL Annotation::vertices ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array of arrays
Access
R/W
Availability:
Phantom/Reader
Annotations
Polygon, PolyLine
Example
function Annotation_vertices()
{
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
for (var i = 0; i < annots.length; i++)
console.println(util.printf(annots[i].vertices));
}
Annotation_vertices();

◆ width()

FX_BOOL Annotation::width ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Annotations
Square, Circle, Line, Ink, FreeText
Example
this.syncAnnotScan();
var annots = this.getAnnots(0, ANSB_Type, true);
console.println("Number of Annotations: " + annots.length);
var msg="%s width is %s";
for (var i = 0; i < annots.length; i++)
console.println(util.printf(msg,annots[i].name,annots[i].width));

◆ destroy()

FX_BOOL Annotation::destroy ( OBJ_METHOD_PARAMS )
Example
Remove all "FreeText" annotations on page 0.
var annots = this.getAnnots({ nPage:0 });
for (var i = 0; i < annots.length; i++)
if (annots[i].type == "FreeText") annots[i].destroy();


Javascript API: app Class Reference

Public Member Functions | List of all members
app Class Reference

This object is used to set and get the properties and to set the JavaScript action of a link.

Public Member Functions

FX_BOOL | activeDocs (OBJ_PROP_PARAMS)
An array containing the Doc object for each active document. If no documents are active, activeDocs returns nothing; that is, it has the same behavior as d = new Array(0) in core JavaScript. The array returned by app.activeDocs includes any documents opened by app.openDoc with the bHidden parameter set to true, subject to the security restrictions described above. More...
FX_BOOL | calculate (OBJ_PROP_PARAMS)
If true (the default value), calculations can be performed. If false, calculations are not permitted. The use of this property is discouraged; the Doc object property calculate is preferred. More...
FX_BOOL | fs (OBJ_PROP_PARAMS)
A FullScreen object, which can be used to access the fullscreen properties. More...
FX_BOOL | fullscreen (OBJ_PROP_PARAMS)
The use of this property is discouraged; it has been superseded by the FullScreen object property isFullScreen. The fs method returns a FullScreen object that can be used to access the fullscreen properties. Controls whether the viewer is in full screen mode or regular viewing mode. Note:A PDF document being viewed from within a web browser cannot be put into full screen mode. Full screen mode can be initiated from within the browser, but applies only to a document open in the Phantom viewer application, if any, not to the browser itself. More...
FX_BOOL | language (OBJ_PROP_PARAMS)
The language of the running Phantom viewer. It can be one of the following strings. More...
FX_BOOL | printerNames (OBJ_PROP_PARAMS)
A list of available printers. Each of these values is suitable to use in the printerName property of the PrintParams object. If no printers are installed on the system, an empty array is returned. More...
FX_BOOL | media (OBJ_PROP_PARAMS)
Defines an extensive number of properties and methods useful for setting up and controlling a multimedia player. See the app.media object for a listing of the properties and methods of this object, as well as numerous examples of use. More...
FX_BOOL | platform (OBJ_PROP_PARAMS)
The platform that the script is currently executing on. There are three valid values: WIN MAC UNIX. More...
FX_BOOL | runtimeHighlight (OBJ_PROP_PARAMS)
If true, the background color and hover color for form fields are shown. More...
FX_BOOL | runtimeHighlightColor (OBJ_PROP_PARAMS)
Sets the color for runtime highlighting of form fields. The value of this property is a color array. (See Color arrays for details.) More...
FX_BOOL | viewerType (OBJ_PROP_PARAMS)
A string that indicates which viewer application is running. It can be one of these values. More...
FX_BOOL | viewerVariation (OBJ_PROP_PARAMS)
Indicates the packaging of the running viewer application. It can be one of these values: Reader Fill-In Business Tools Full. More...
FX_BOOL | viewerVersion (OBJ_PROP_PARAMS)
Indicates the version number of the current viewer application. More...
FX_BOOL | alert (OBJ_METHOD_PARAMS)
Displays an alert dialog box. More...
FX_BOOL | beep (OBJ_METHOD_PARAMS)
Causes the system to play a sound. Note:On Mac OS and UNIX systems the beep type is ignored. More...
FX_BOOL | browseForDoc (OBJ_METHOD_PARAMS)
Presents a file system browser and returns an object containing information concerning the user’s response. Note:This method can only be executed during a batch or console event. See the event object for a discussion of JavaScript events. See Privileged versus non-privileged context for details. More...
FX_BOOL | clearInterval (OBJ_METHOD_PARAMS)
Cancels a previously registered interval initially set by the setInterval method. See also setTimeOut and clearTimeOut. More...
FX_BOOL | clearTimeOut (OBJ_METHOD_PARAMS)
Cancels a previously registered time-out interval. Such an interval is initially set by setTimeOut. See also setInterval and clearInterval. More...
FX_BOOL | execDialog (OBJ_METHOD_PARAMS)
Presents a modal dialog box to the user. Modal dialog boxes must be closed by the user before the host application can be directly used again. The monitor parameter specifies a dialog descriptor, which is a generic object literal that consists of a set of handler functions for various events and a set of properties that describe the contents of the dialog box. Dialog box items are identified by an ItemID, which is a unique 4-character string. An ItemID is necessary only if the element must be referred to elsewhere in the dialog box description (for example, to set or get a value for the element, to add a handler for the element, or to set a tab order including the element). Note:To distinguish Phantom dialog boxes from those created by JavaScript, dialog boxes that are added at the document level have a title of “JavaScript Dialog” and display the text “Warning: JavaScript Dialog” at the bottom. More...
FX_BOOL | execMenuItem (OBJ_METHOD_PARAMS)
Executes the specified menu item. More...
FX_BOOL | launchURL (OBJ_METHOD_PARAMS)
Launches a URL in a browser window. More...
FX_BOOL | mailMsg (OBJ_METHOD_PARAMS)
Sends out an e-mail message with or without user interaction. See also the Doc object mailDoc and mailForm methods, the FDF object mail method and the Report object mail method. Note:On Windows: The client machine must have its default mail program configured to be MAPI enabled to use this method. More...
FX_BOOL | newDoc (OBJ_METHOD_PARAMS)
Creates a new document and returns its Doc object. The optional parameters specify the media box dimensions of the document in points. Note:This method can only be executed during a batch or console event. See Privileged versus non-privileged context. See the event object for a discussion of JavaScript events. More...
FX_BOOL | openDoc (OBJ_METHOD_PARAMS)
Opens a specified PDF document and returns its Doc object. This object can be used by the script to call methods, or to get or set properties in the newly opened document. More...
FX_BOOL | popUpMenuEx (OBJ_METHOD_PARAMS)
Creates a pop-up menu at the current mouse position. Each of the parameters is a MenuItem object that describes a menu item to be included in the pop-up menu. This method is preferred over the use of popUpMenu. More...
FX_BOOL | popUpMenu (OBJ_METHOD_PARAMS)
Note:popUpMenuEx is preferred over this method. Creates a pop-up menu at the current mouse position, containing the specified items. More...
FX_BOOL | response (OBJ_METHOD_PARAMS)
Displays a dialog box containing a question and an entry field for the user to reply to the question. More...
FX_BOOL | setInterval (OBJ_METHOD_PARAMS)
Specifies a JavaScript script and a time period. The script is executed every time the period elapses. The return value of this method must be held in a JavaScript variable. Otherwise, the interval object is subject to garbage-collection, which would cause the clock to stop. To terminate the periodic execution, pass the returned interval object to clearInterval. More...
FX_BOOL | setTimeOut (OBJ_METHOD_PARAMS)
Specifies a JavaScript script and a time period. The script is executed one time only, after the period elapses. The return value of this method must be held in a JavaScript variable. Otherwise, the timeout object is subject to garbage-collection, which would cause the clock to stop. To cancel the timeout event, pass the returned timeout object to clearTimeOut. More...
FX_BOOL | addMenuItem (OBJ_METHOD_PARAMS)
Adds a menu item to a menu. Note:Starting Phantom X, the number of top-level menu items has been reduced. The menu items available from Phantom X onwards are: File, Edit, View, Window, and Help. If any of your previous scripts referred to a top-level menu item that no longer exists, the reference will not work. Note:This method can only be executed during application initialization or console events. See the event object for a discussion of JavaScript events. See also the addSubMenu, execMenuItem, hideMenuItem, and listMenuItems methods. More...
FX_BOOL | listMenuItems (OBJ_METHOD_PARAMS)
Beginning with Phantom 6.0, returns an array of TreeItem objects, which describes a menu hierarchy. Prior to Phantom 6.0, this method returned a list of menu item names to the console. See also addMenuItem, addSubMenu, execMenuItem, and hideMenuItem. More...

Member Function Documentation

◆ activeDocs()

FX_BOOL app::activeDocs ( OBJ_PROP_PARAMS )
Type
Array
Access
R
Availability:
Phantom/Reader
Example
var d = app.activeDocs;
var name =" ";
for(var i = 0 ; i < d.length ; i++)
{
name = d[i].info.Title+name;
}
console.println(name);

◆ calculate()

FX_BOOL app::calculate ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ fs()

FX_BOOL app::fs ( OBJ_PROP_PARAMS )
Type
Object
Access
R
Availability:
Phantom/Reader
Example
// This code puts the viewer into fullscreen (presentation) mode.
app.fs.isFullScreen = true;

◆ fullscreen()

FX_BOOL app::fullscreen ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ language()

FX_BOOL app::language ( OBJ_PROP_PARAMS )
String | Language
CHS | Chinese Simplified
CHT | Chinese Traditional
DAN | Danish
DEU | German
ENU | English
ESP | Spanish
FRA | French
ITA | Italian
KOR | Korean
JPN | Japanese
NLD | Dutch
NOR | Norwegian
PTB | Brazilian Portuguese
SUO | Finnish
SVE | Swedish
Type
String
Access
R
Availability:
Phantom/Reader
Example
app.alert(app.language)

◆ printerNames()

FX_BOOL app::printerNames ( OBJ_PROP_PARAMS )
Type
Array of Strings
Access
R
Availability:
Phantom/Reader
Example
Print out a listing of available printers:
var l = app.printerNames.length
for ( var i = 0; i < l; i++)
console.println("(" + (i+1) + ") " + app.printerNames[i]);

◆ media()

FX_BOOL app::media ( OBJ_PROP_PARAMS )
Type
Object
Access
R
Availability:
Phantom/Reader

◆ platform()

FX_BOOL app::platform ( OBJ_PROP_PARAMS )
Type
String
Access
R
Availability:
Phantom/Reader
Example
app.alert(app.platform)

◆ runtimeHighlight()

FX_BOOL app::runtimeHighlight ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Example
If run-time highlighting is off (false), do nothing, otherwise change the preferences.
if (!app.runtimeHighlight)
{
app.runtimeHighlight = true;
app.runtimeHighlightColor = color.red;
}

◆ runtimeHighlightColor()

FX_BOOL app::runtimeHighlightColor ( OBJ_PROP_PARAMS )
Type
Color array
Access
R/W
Availability:
Phantom/Reader
Example
See the runtimeHighlight property.

◆ viewerType()

FX_BOOL app::viewerType ( OBJ_PROP_PARAMS )
Type
String
Access
R
Availability:
Phantom/Reader
Example
app.alert(app.viewerType)

◆ viewerVariation()

FX_BOOL app::viewerVariation ( OBJ_PROP_PARAMS )
Type
String
Access
R
Availability:
Phantom/Reader
Example
app.alert(app.viewerVariation)

◆ viewerVersion()

FX_BOOL app::viewerVersion ( OBJ_PROP_PARAMS )
Type
Number
Access
R
Availability:
Phantom/Reader
Example
app.alert(app.viewerVersion)

◆ alert()

FX_BOOL app::alert ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cMsg A string containing the message to be displayed.
nIcon (optional) An icon type. Possible values are these:
0 — Error (default)
1 — Warning
2 — Question
3 — Status
Note:In Mac OS, there is no distinction between warnings and questions.
nType (optional) A button group type. Possible values are these:
0 — OK (default)
1 — OK, Cancel
2 — Yes, No
3 — Yes, No, Cancel
cTitle (optional) The dialog box title. If not specified, the title “Foxit Alert” is used.
Returns
nButton, the type of the button that was pressed by the user:
1 — OK
2 — Cancel
3 — No
4 — Yes
Example
Close the document with the user’s permission:
// A MouseUp action
var nButton = app.alert({
cMsg: "Do you want to close this document?",
cTitle: "A message from abc",
nIcon: 2, nType: 2
});
if ( nButton == 4 ) this.closeDoc();

◆ beep()

FX_BOOL app::beep ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
nType (optional) The sound type. Values are associated with sounds as follows:
0 — Error
1 — Warning
2 — Question
3 — Status
4 — Default (default value)

◆ browseForDoc()

FX_BOOL app::browseForDoc ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
bSave (optional) A Boolean value that, if true, specifies that the file system browser should be presented as it would be for a save operation. The default is false.
cFilenameInit (optional) A string that specifies the default file name for the file system browser to be populated with.
cFSInit (optional) A string that specifies the file system that the file system browser operates on initially. Two values are supported: “” (the empty string) representing the default file system and “CHTTP”. The default is the default file system. This parameter is only relevant if the web server supports WebDAV.
Returns
On success, returns an object that has three properties.
Property Description
cFS A string containing the resulting file system name for the chosen file.
cPath A string containing the resulting path for the chosen file.
cURL A string containing the resulting URL for the chosen file
If the user cancels, the return value is undefined. On error, throws an exception.
Example
//bSave: true,cFSInit: ""
var oRetn = app.browseForDoc({
bSave: true,
cFilenameInit: "appbrowseForDoctest1.pdf",
cFSInit: "",
});
if ( typeof oRetn != "undefined" )
{
for ( var o in oRetn )
console.println( "oRetn." + o + "=" + oRetn[o]);
}
else
console.println("User cancelled!");

◆ clearInterval()

FX_BOOL app::clearInterval ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
oInterval The registered interval to cancel.
Example
See setTimeOut.

◆ clearTimeOut()

FX_BOOL app::clearTimeOut ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
oTime The previously registered time-out interval to cancel.
Example
See setTimeOut.

◆ execDialog()

FX_BOOL app::execDialog ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
monitor An object literal. It consists of several handlers (see Dialog box handlers) and a description property that describes the dialog box elements (see description property).
inheritDialog (optional) A Dialog object that should be reused when displaying this dialog box. It is useful when displaying a series of dialog boxes (such as a wizard) to prevent one from disappearing before the new one is displayed. The default is not to reuse a dialog box.
parentDoc (optional) A Doc object to use as the parent for this dialog box.
Returns
A string, which is the ItemID of the element that caused the dialog box to be dismissed. The return value is “ok” or “cancel” if the dismissing element is the ok or cancel button.
Dialog box handlers
The dialog box handlers are called when specific dialog box events occur. Each handler is optional and is passed a Dialog object that can be used to query or set values in the dialog box. The supported handlers are listed in the table that follows.
Dialog box handler | Description
initialize | Called when the dialog box is being initialized.
validate | Called when a field is modified to determine if the value is acceptable (by returning true) or unacceptable (by returning false).
commit | Called when the OK button of the dialog box is clicked.
destroy | Called when the dialog box is being destroyed.
ItemID | Called when the dialog box element ItemID is modified. For a text box, it is when the text box loses focus. For other controls, it is when the selection changes. If ItemID is not a JavaScript identifier, the name must be enclosed in double quotes when the method is defined, as in the following example. "bt:1": function () { .... } If ItemID is a JavaScript identifier, the double quotes are optional. For example, the following are both correct. "butn": function () { .... } butn: function () { .... }
description property
The description property is an object literal that contains properties describing the dialog. Its elements property specifies the elements of the dialog box, and each of the elements in turn can have an elements property describing subelements. The dialog properties at the root level of the description property are listed in the table that follows.
Property Type Description
name String The title bar of the dialog box, which should be localized.
first_tab String An ItemID for the dialog box item that should be first in the tab order. This dialog box item will also be active when the dialog box is created. This property is required for setting up a tabbing order. See the next_tab property defined below.
width Numeric The width of the dialog box in pixels. If no width is specified, the combined width of the contents is used.
height Numeric The height of the dialog box in pixels. If no height is specified, the combined height of the contents is used.
char_width Numeric The width of the dialog box in characters. If no width is specified, the combined width of the contents is used.
char_height Numeric The height of the dialog box in characters. If no height is specified, the combined height of the contents is used.
align_children String The alignment for all descendants. Must be one of the following values:
“align_left”: Left aligned
“align_center”: Center aligned
“align_right”: Right aligned
“align_top”: Top aligned
“align_fill”: Align to fill the parent’s width; may widen objects.
“align_distribute”: Distribute the contents over the parent’s width.
“align_row”: Distribute the contents over the parent’s width with a consistent baseline.
elements Array An array of object literals that describe the dialog box elements contained within this dialog (see elements property).
elements property
A dialog box elements property specifies an object literal with the following set of properties.
Property Type Description
name String The displayed name of the dialog box element, which should be localized.
Note:This property is ignored for the “edit_text” type.
item_id String An ItemID for this dialog box, which is a unique 4-character string.
type String The type of this dialog box element. It must be one of the following strings:
“button” - A push button.
“check_box” - A check box.
“radio” - A radio button.
“list_box” - A list box.
“hier_list_box” - A hierarchical list box.
“static_text” - A static text box.
“edit_text” - An editable text box.
“popup” - A pop-up control.
“ok” - An OK button.
“ok_cancel” - An OK and Cancel Button.
“ok_cancel_other” - An OK, Cancel, and Other button.
“view” - A container for a set controls.
“cluster” - A frame for a set of controls.
“gap” - A place holder.
next_tab String An ItemID for the next dialog box item in the tab order.
Note:Tabbing does not stop at any dialog box item that is not the target of the next_tab (or first_tab) property. Tabbing should form a circular linked list.
width Numeric Specifies the width of the element in pixels. If no width is specified, the combined width of the contents is used.
height Numeric Specifies the height of the element in pixels. If no height is specified, the combined height of the contents is used.
char_width Numeric Specifies the width of the element in characters. If no width is specified, the combined width of the contents is used.
char_height Numeric Specifies the height of the element in characters. If no height is specified, the combined height of the contents is used.
font String The font to use for this element. Must be one of the following strings:
“default” - Default font
“dialog” - Dialog box font
“palette” - Palette (small) Font
bold Boolean Specify if the font is bold.
italic Boolean Specify if the font is italic.
alignment String Sets the alignment for this element. Must be one of the following values:
“align_left”: Left aligned
“align_center”: Center aligned
“align_right”: Right aligned
“align_top”: Top aligned
“align_fill”: Align to fill the parent’s width; may widen objects.
“align_distribute”: Distribute the contents over the parent’s width.
“align_row”: Distribute the contents over the parent’s width with a consistent baseline.
align_children String Sets the alignment for all descendants. Possible values are the same as for alignment.
elements Array An array of object literals that describe the subelements of this dialog box element. Its properties are the same as those described in this table.
Additional attributes of some dialog box elements
Some of the element types have additional attributes, as listed below.
Element type Property Type Description
static_text multiline Boolean If true, this static text element is multiline.
Note:For Mac OS, the height property must be at least 49 to display the up/down buttons, which allow users to read the whole box content.
edit_text multiline Boolean If true, this edit text element is multiline.
readonly Boolean If true, this text element is read only.
Note:This property is ignored when password is set to true.
password Boolean If true, this text element is a password field.
PopupEdit Boolean If true, it is a pop-up edit text element.
SpinEdit Boolean If true, it is a spin edit text element.
radio group_id String The group name to which this radio button belongs.
ok, ok_cancel,
ok_cancel_other 		ok_name String The name for the OK button.
cancel_name String The name for the cancel button.
other_name String The name for the other button.
Example 1
The following dialog box descriptor can be a document-level or folder-level JavaScript. The dialog box created contains text fields for your first and last name. When the OK button is clicked, the names entered are reported to the console.
var dialog1 = {
initialize: function (dialog) {
// Create a static text containing the current date.
var todayDate = dialog.store()["date"];
todayDate = "Date: " + util.printd("mmmm dd, yyyy", new Date());
dialog.load({ "date": todayDate });
},
commit:function (dialog) { // called when OK pressed
var results = dialog.store();
// Now do something with the data collected, for example,
console.println("Your name is " + results["fnam"]
+ " " + results["lnam"] );
},
description:
{
name: "Personal Data", // Dialog box title
align_children: "align_left",
width: 350,
height: 200,
elements:
[
{
type: "cluster",
name: "Your Name",
align_children: "align_left",
elements:
[
{
type: "view",
align_children: "align_row",
elements:
[
{
type: "static_text",
name: "First Name: "
},
{
item_id: "fnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
}
]
},
{
type: "view",
align_children: "align_row",
elements:
[
{
type: "static_text",
name: "Last Name: "
},
{
item_id: "lnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
}
]
},
{
type: "static_text",
name: "Date: ",
char_width: 25,
item_id: "date"
},
]
},
{
alignment: "align_right",
type: "ok_cancel",
ok_name: "Ok",
cancel_name: "Cancel"
}
]
}
};
Now, the following line can be executed from actions such as the mouse-up action of a button or a menu action.
app.execDialog(dialog1);
Example 2
The following example uses a check box and a radio button field. This code might be a document-level JavaScript.
var dialog2 =
{
initialize: function(dialog) {
// Set a default value for radio button field
dialog.load({"rd01": true });
this.hasPet = false;
// Disable radio button field
dialog.enable({
"rd01" : this.hasPet,
"rd02" : this.hasPet,
"rd03" : this.hasPet
});
},
commit: function(dialog) {
// When the user presses "Ok", this handler will execute first
console.println("commit");
var results = dialog.store();
// Do something with the data, for example,
var hasPet = (this.hasPet) ? "have" : "don't have";
console.println("You " + hasPet + " a pet.");
if (this.hasPet)
console.println("You have " + this.getNumPets(results)
+ " pet(s).");
},
getNumPets: function (results) {
for ( var i=1; i<=3; i++) {
if ( results["rd0"+i] ) {
switch (i) {
case 1:
var nPets = "one";
break;
case 2:
var nPets = "two";
break;
case 3:
var nPets = "three or more";
}
}
};
return nPets;
},
ok: function(dialog) {
// The handler for the Ok button will be handed after commit
console.println("Ok!");
},
ckbx: function (dialog) {
// Process the checkbox, if the user has a pet, turn on radios
this.hasPet = !this.hasPet;
dialog.enable({
"rd01" : this.hasPet,
"rd02" : this.hasPet,
"rd03" : this.hasPet
});
},
cancel: function(dialog) { // Handle the cancel button
console.println("Cancel!");
},
other: function(dialog){ // Handle the other button
app.alert("Thanks for pressing me!");
dialog.end("other"); // End the dialog box, return "other"!
},
// The dialog box description
description:
{
name: "More Personal Information",
elements:
[
{
type: "view",
align_children: "align_left",
elements:
[
{
type: "static_text",
name: "Personal Information",
bold: true,
font: "dialog",
char_width: 30,
height: 20
},
{
type: "check_box",
item_id: "ckbx",
name: "Pet Owner"
},
{
type: "view",
align_children: "align_row",
elements:
[
{
type: "static_text",
name: "Number of pets: "
},
{
type: "radio",
item_id: "rd01",
group_id: "rado",
name: "One"
},
{
type: "radio",
item_id: "rd02",
group_id: "rado",
name: "Two",
},
{
type: "radio",
item_id: "rd03",
group_id: "rado",
name: "Three or more",
}
]
}
]
},
{
type: "gap", //Add a small vertical gap between
height: 10 //..radio fields and buttons
},
{
type: "ok_cancel_other",
ok_name: "Ok",
cancel_name: "Cancel",
other_name: "Press Me"
}
]
}
};
The following line can be executed in situations such as the mouse-up action of a button or a menu action.
var retn = app.execDialog(dialog2);
The value of retn is “ok” if the Ok button was clicked, “cancel” if the Cancel button was clicked, and “other” if the button labeled “Press Me” was clicked.
Example 3
This example uses a list box.
var dialog3 = {
// This dialog box is called when the dialog box is created
initialize: function(dialog) {
this.loadDefaults(dialog);
},
// This dialog box is called when the OK button is clicked.
commit: function(dialog) {
// See the Dialog object for a description of how dialog.load
// and dialog.store work.
var elements = dialog.store()["subl"];
// do something with the data.
},
// Callback for when the button "butn" is clicked.
butn: function(dialog) {
var elements = dialog.store()["subl"]
for(var i in elements) {
if ( elements[i] > 0 ) {
app.alert("You chose \"" + i
+ "\", which has a value of " + elements[i] );
}
}
},
loadDefaults: function (dialog) {
dialog.load({
subl:
{
"Bussiness": +1,
"Standard": -2,
"Reader": -3
}
})
},
// The dialog box description
description:
{
name: "Products", // Title of the dialog box
elements: // Child element array
[
{
type: "view",
align_children: "align_left",
elements: // Child element array
[
{
type: "cluster",
name: "Select",
elements: // Child Element Array
[
{
type: "static_text",
name: "Select Phantom you use",
font: "default"
},
{
type: "list_box",
item_id: "subl",
width: 200,
height: 60
},
{
type: "button",
item_id: "butn",
name: "Press Me"
}
]
},
{
type: "ok_cancel"
}
]
}
]
}
}
Then execute
app.execDialog(dialog3);
In the example above, if the line type: "list_box" is replaced by type: "popup" and the height specification is removed, the example will run with a pop-up control rather than a list box.
Example 4
This example shows a hierarchical list box. After the dialog box is opened, a hierarchical list is presented. After a selection is made and the user clicks the Select button, the document jumps to the destination chosen by the user. The Doc object is passed to the dialog box by making it a property of the dialog box.
var dialog4 = {
initialize: function(dialog) {
dialog.load({
subl:
{
"Chapter 1":
{
"Section 1":
{
"SubSection 1": -1,
"SubSection 2": -2,
},
"Section 2":
{
"SubSection 1": -3,
"SubSection 2": -4,
}
},
"Chapter 3": -5,
"Chapter 4": -6
}
})
},
subl: function(dialog) {
console.println("Selection Box Hit");
},
getHierChoice: function (e)
{
if (typeof e == "object") {
for ( var i in e ) {
if ( typeof e[i] == "object" ) {
var retn = this.getHierChoice(e[i]);
if ( retn ) {
retn.label = i + ", " + retn.label;
return retn;
}
// if e[i] > 0, we’ve found the selected item
} else if ( e[i] > 0 ) return { label:i, value: e[i] };
}
} else {
if ( e[i] > 0 ) return e[i];
}
},
butn: function (dialog)
{
var element = dialog.store()["subl"]
var retn = this.getHierChoice(element);
if ( retn ) {
// Write to the console the full name of the item selected
console.println("The selection you've chosen is \""
+ retn.label + "\", its value is " + retn.value );
dialog.end("ok");
// this.doc is the doc object of this document
this.doc.gotoNamedDest("dest"+retn.value);
}
else app.alert("Please make a selection, or cancel");
},
cncl: function (dialog) { dialog.end("cancel") },
// Dialog box description
description:
{
name: "My Novel",
elements:
[
{
type: "view",
align_children: "align_left",
elements:
[
{
type: "cluster",
name: "Book Headings",
elements:
[
{
type: "static_text",
name: "Make a selection",
},
{
type: "hier_list_box",
item_id: "subl",
char_width: 20,
height: 200
}
]
},
{
type: "view",
align_children: "align_row",
elements:
[
{
type: "button",
item_id: "cncl",
name: "Cancel"
},
{
item_id: "butn",
type: "button",
name: "Select"
}
]
}
]
}
]
}
};
This function attaches the Doc object to the dialog box, then passes the dialog box to the app.execDialog method. The dialog4 object and this function can be at the document level.
function dotheDialog(dialog,doc)
{
dialog.doc = doc;
var retn = app.execDialog( dialog )
}
Finally, the following script can be executed from a mouse-up action, for example.
dotheDialog( dialog4, this );

◆ execMenuItem()

FX_BOOL app::execMenuItem ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cMenuItem The menu item to execute.
A list of menu item names can be obtained with listMenuItems.
Example 1
This example executes the File > Open menu item. It displays a dialog box asking for the file to be opened.
app.execMenuItem("Open");
Example 2
This example illustrates how a form object does not survive the execution of app.execMenuItem("SaveAs"), as noted above.
var f = this.getField("myField");
// Assume preferences set to save linearized
app.execMenuItem("SaveAs");
// Exception thrown, field not updated
f.value = 3;
Example 3
After executing app.execMenuItem("SaveAs"), Field objects must be acquired again.
var f = this.getField("myField");
// Assume preferences set to save linearized
app.execMenuItem("SaveAs");
// Get the field again after the linear save
var f = getField("myField");
// Field updated to a value of 3
f.value = 3;

◆ launchURL()

FX_BOOL app::launchURL ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cURL A string that specifies the URL to launch.
Returns
The value undefined is returned on success. An exception is thrown on failure.
Example 1
app.launchURL("https://globe-map.foxitservice.com/");

◆ mailMsg()

FX_BOOL app::mailMsg ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
bUI Indicates whether user interaction is required. If true, the remaining parameters are used to seed the compose-new-message window that is displayed to the user. If false, the cTo parameter is required and others are optional.
Note:(Phantom 7.0) When this method is executed in a non-privileged context, the bUI parameter is not honored and defaults to true. See Privileged versus non-privileged context.
cTo A semicolon-separated list of addressees.
cCc (optional) A semicolon-separated list of CC addressees.
cBcc (optional) A semicolon-separated list of BCC addressees.
cSubject (optional) Subject line text. The length limit is 64 KB.
cMsg (optional) Mail message text. The length limit is 64 KB.
Example
Open the compose new message window.
app.mailMsg(true);
Send the message to fun1@example.com and fun2@example.com.
app.mailMsg(false, "fun1@example.com; fun2@example.com", "", "",
"This is the subject", "This is the body of the mail.");
It is possible to compose a message containing form data.
var cMyMsg = "Below are the current budget figures:\n\n";
cMyMsg += "Date Compiled: " + this.getField("date").value + "\n";
cMyMsg += "Current Estimate: " + this.getField("budget").value + "\n";
app.mailMsg({
bUI: true,
cTo: "myBoss@example.com",
cSubject: "The latest budget figures",
cMsg: cMyMsg
} );

◆ newDoc()

FX_BOOL app::newDoc ( OBJ_METHOD_PARAMS )
Returns
The object of the newly created document.
Example
Create a blank document and acquire the Doc object, then insert a watermark.
var myNewDoc = app.newDoc();
myNewDoc.addWatermarkFromText("Confidential",0,font.Helv,24,color.red);
This example uses the Doc object addWatermarkFromText method.

◆ openDoc()

FX_BOOL app::openDoc ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cPath A device-independent path to the document to be opened. If oDoc is specified, the path can be relative to it. The target document must be accessible in the default file system.
Note:When cFS is set to “CHTTP”, the cPath string should be escaped, perhaps using the core JavaScript global function encodeURI. See Example 5 (Phantom 7.0) below.
Returns
A Doc object or null:
Example
This example opens another document, inserts a prompting message into a text field, sets the focus in the field, and then closes the current document.
var otherDoc = app.openDoc("/c/temp/myDoc.pdf");
otherDoc.getField("name").value="Enter your name here: "
otherDoc.getField("name").setFocus();
this.closeDoc();

◆ popUpMenuEx()

FX_BOOL app::popUpMenuEx ( OBJ_METHOD_PARAMS )
Parameters
One or more MenuItem objects (see below).
Returns
The cReturn value of the menu item that was selected, or its cName if cReturn was not specified for that item. The method returns null if no selection was made.
MenuItem Object
This generic JavaScript object represents a menu item. It has the following properties.
Property Description
cName The menu item name, which is the string to appear on the menu item. The value of "-" is reserved to draw a separator line in the menu.
bMarked (optional) A Boolean value specifying whether the item is to be marked with a check. The default is false (not marked).
bEnabled (optional) A Boolean value specifying whether the item is to appear enabled or grayed out. The default is true (enabled).
cReturn (optional) A string to be returned when the menu item is selected. The default is the value of cName.
oSubMenu (optional) A MenuItem object representing a submenu item or an array of submenu items, each represented by a MenuItem object.
Example 1
Show all the features of the popUpMenuEx method.
var cChoice = app.popUpMenuEx
(
{cName: "Item 1", bMarked:true, bEnabled:false},
{cName: "-"},
{cName: "Item 2", oSubMenu:
[ {cName: "Item 2, Submenu 1"},
{
cName: "Item 2, Submenu 2",
oSubMenu: {cName:"Item 2, Submenu 2, Subsubmenu 1", cReturn: "0"}
}
]
},
{cName: "Item 3"},
{cName: "Item 4", bMarked:true, cReturn: "1"}
)
app.alert("You chose the \"" + cChoice + "\" menu item");

◆ popUpMenu()

FX_BOOL app::popUpMenu ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cItem (optional) If the argument is a string, it is listed in the menu as a menu item. The menu item name "-" is reserved to draw a separator line in the menu.
Array (optional) If the argument is an array, it appears as a submenu where the first element in the array is the parent menu item. This array can contain further submenus.
Returns
The name of the menu item that was selected, or null if no item was selected.
Example
Create a pop-up menu consisting of chapter of a document.
var cChoice = app.popUpMenu("Introduction", "-", "Chapter 1",
[ "Chapter 2", "Chapter 2 Start", "Chapter 2 Middle",
["Chapter 2 End", "The End"]]);
app.alert("You chose the \"" + cChoice + "\" menu item");

◆ response()

FX_BOOL app::response ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cQuestion The question to be posed to the user.
cTitle (optional) The title of the dialog box.
cDefault (optional) A default value for the answer to the question. If not specified, no default value is presented.
cLabel (optional) A short string to appear in front of and on the same line as the edit text field.
Returns
A string containing the user’s response. If the user clicks the Cancel button, the response is the null object.
Example
Asks for a response from the user and report back the response.
var cResponse = app.response({
cQuestion: "How are you today?",
cTitle: "Your Health Status",
cDefault: "Fine",
cLabel: "Response:"
});
if (cResponse == null)
app.alert("Thanks for trying anyway.");
else
app.alert("You responded, \""+cResponse+"\", to the health "
+ "question.",3);

◆ setInterval()

FX_BOOL app::setInterval ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cExpr The JavaScript script to be executed.
nMilliseconds The time period in milliseconds.
Returns
An interval object
Example
Create a simple color animation on a field called “Color” that changes every second.
function DoIt() {
var f = this.getField("Color");
var nColor = (timeout.count++ % 10 / 10);
// Various shades of red.
var aColor = new Array("RGB", nColor, 0, 0);
f.fillColor = aColor;
}
// save return value as a variable
timeout = app.setInterval("DoIt()", 1000);
// Add a property to our timeout object so that DoIt() can keep
// a count going.
timeout.count = 0;
See setTimeOut for an additional example.

◆ setTimeOut()

FX_BOOL app::setTimeOut ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cExpr The JavaScript script to be executed.
nMilliseconds The time period in milliseconds.
Returns
A timeout object
Example
Create a simple running marquee. Assume there is a text field named “marquee”. The default value of this field is “Adobe Phantom version 8.0 will soon be here!”.
// Document-level JavaScript function
function runMarquee() {
var f = this.getField("marquee");
var cStr = f.value;
// get field value
var aStr = cStr.split(""); // Convert to an array
aStr.push(aStr.shift()); // Move first char to last
cStr = aStr.join(""); // Back to string again
f.value = cStr; // Put new value in field
}
// Insert a mouse-up action into a "Go" button
run = app.setInterval("runMarquee()", 100);
// stop after a minute
stoprun=app.setTimeOut("app.clearInterval(run)",6000);
// Insert a mouse-up action into a "Stop" button
try {
app.clearInterval(run);
app.clearTimeOut(stoprun);
} catch (e){}
The Stop button code is protected with a try/catch construct. If the user clicks the Stop button without having first clicked Go, run and stoprun will be undefined and the Stop code will throw an exception. When the exception is thrown, the catch code is executed. In this example, the code does nothing if the user clicks Stop first.

◆ addMenuItem()

FX_BOOL app::addMenuItem ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName The language-independent name of the menu item. This name can be used by other methods (for example, hideMenuItem) to access the menu item.
cUser (optional) The user string (language-dependent name) to display as the menu item name. If cUser is not specified, cName is used.
cParent The name of the parent menu item. Its submenu will have the new menu item added to it. If cParent has no submenu, an exception is thrown.
Menu item names can be obtained with the listMenuItems method.
nPos (optional) The position within the submenu to locate the new menu item. The default behavior is to append to the end of the submenu. Specifying nPos as 0 adds the menu to the top of the submenu.The named item determines the position at which the new menu item is to be inserted. See bPrepend for additional details.
The nPos parameter is ignored in certain menus that are alphabetized. The alphabetized menus are
The first section of View > Navigation Panels.
The first section of View > Toolbars.
Note:When nPos is a number, nPos is not obeyed in the Tools menu. A menu item introduced into the Tools menu comes in at the top of the menu. nPos is obeyed when it is a string referencing another user-defined menu item.
cExec | An expression string to evaluate when the menu item is selected by the user.
cEnable (optional) An expression string that is evaluated to determine whether to enable the menu item. The default is that the menu item is always enabled. This expression should set event.rc to false to disable the menu item.
cMarked (optional) An expression string that determines whether the menu item has a check mark next to it. The expression should set event.rc to false to uncheck the menu item and true to check it. The default is that the menu item is not marked.
bPrepend (optional) Determines the position of the new menu item relative to the position specified by nPos. The default value is false. If bPrepend is true, the rules for insertion are as follows:
If nPos is a string, the new item is placed before the named item.
If nPos is a number, the new item is placed before the numbered item.
If the named item cannot be found or nPos is not between zero and the number of items in the list, inclusive, the new item is inserted as the first item in the menu (rather than at the end of the menu).
bPrepend is useful when the named item is the first item in a group.
Example 1
At the top of the File menu, add a menu item that opens an alert dialog box displaying the active document title. This menu is only enabled if a document is opened.
app.addMenuItem({ cName: "Hello",cParent: "File",
cExec: "app.alert('addMenuItem');",
cEnable: "event.rc = (event.target != null);",
nPos: 0});
Example 2
Place two menu items in the File menu, one before the Close item and the other after the Close item.
// Insert after the "Close" item (the default behavior)
app.addMenuItem( { cName: "myItem1", cUser: "My Item 1", cParent:
"File", cExec: "_myProc1()", nPos: "Close"});
// Insert before the "Close" item, set bPrepend to true.
app.addMenuItem( { cName: "myItem2", cUser: "My Item 2", cParent:
"File", cExec: "_myProc2()", nPos: "Close", bPrepend: true });

◆ listMenuItems()

FX_BOOL app::listMenuItems ( OBJ_METHOD_PARAMS )
Returns
Array of TreeItem objects.
TreeItem Object
A generic JavaScript object that represents a menu or toolbar item hierarchy. An array of these objects is returned by app.listMenuItems and app.listToolbarButtons (starting in Phantom 6.0). It contains the following properties.
parameter instruction
cName The name of a menu item or toolbar button.
oChildren (optional) An array of treeItem objects containing the submenus or flyout buttons.
Example
List all menu items to the console using a fancy format.
function FancyMenuList(m, nLevel)
{
var s = "";
for (var i = 0; i < nLevel; i++) s += " ";
console.println(s + "+-" + m.cName);
if ( m.oChildren != null )
for ( var i = 0; i < m.oChildren.length; i++ )
FancyMenuList(m.oChildren[i], nLevel + 1);
}
var m = app.listMenuItems();
for ( var i=0; i < m.length; i++ ) FancyMenuList(m[i], 0);


Javascript API: attachment Class Reference

Public Member Functions | List of all members
attachment Class Reference

The annotAttachment object represents the file stored as the attachment for a FileAttachment type annotation. annotAttachment is similar to the Data object and represents the file content and metadata of the attachment.

Public Member Functions

FX_BOOL | name (OBJ_PROP_PARAMS)
The name of the attached file. More...
FX_BOOL | creationDate (OBJ_PROP_PARAMS)
The date of creation of the attached file. More...
FX_BOOL | modDate (OBJ_PROP_PARAMS)
The date of modification of the attached file. More...
FX_BOOL | MIMEType (OBJ_PROP_PARAMS)
The MIME type of the attached file. More...
FX_BOOL | path (OBJ_PROP_PARAMS)
The pathname of the attached file. More...
FX_BOOL | size (OBJ_PROP_PARAMS)
The size, in bytes, of the uncompressed attachment. More...
FX_BOOL | contentStream (OBJ_PROP_PARAMS)
A ReadStream property representing the file attachment stream. This property enables access to the contents of the file attachment associated with an annotAttachment object. A NotAllowedError is thrown and the method fails if it attempts to access the content of an embedded file attachment for which any of the following conditions is true (all file name extension matching is case-insensitive): Note:If you use the Data.MIMEType property to check whether a Data object represents a .SWF file, note that the MIME type for .SWF files is application/x-shockwave-flash. More...

Member Function Documentation

◆ name()

FX_BOOL attachment::name ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader

◆ creationDate()

FX_BOOL attachment::creationDate ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Date
Access
R
Availability:
Phantom/Reader

◆ modDate()

FX_BOOL attachment::modDate ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Date
Access
R
Availability:
Phantom/Reader

◆ MIMEType()

FX_BOOL attachment::MIMEType ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader

◆ path()

FX_BOOL attachment::path ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader

◆ size()

FX_BOOL attachment::size ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R
Availability:
Phantom/Reader
Example
var annot = this.addAnnot({
page: 0,
type: "FileAttachment",
point: [400,500],
author: "A. C. Robat",
contents: "Call Smith to get help on this paragraph.",
cAttachmentPath: "/d/a.pdf" ,
});
var attachObj = annot.attachment;
console.println("Name: " + attachObj.name);
console.println("Type: " + attachObj.MIMEType);
console.println("Size: "+ attachObj.size);

◆ contentStream()

FX_BOOL attachment::contentStream ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Object
Access
R
Availability:
Phantom/Reader


Javascript API: Bookmark Class Reference

Public Member Functions | List of all members
Bookmark Class Reference

A Bookmark object represents a node in the bookmark tree that appears in the bookmarks navigational panel. Bookmarks are typically used as a table of contents allowing the user to navigate quickly to topics of interest.

Public Member Functions

FX_BOOL | children (OBJ_PROP_PARAMS)
An array of Bookmark objects that are the children of this bookmark in the bookmark tree. If there are no children of this bookmark, this property has a value of null. See also the parent and bookmarkRoot properties. More...
FX_BOOL | doc (OBJ_PROP_PARAMS)
The Doc that the bookmark resides in. More...
FX_BOOL | name (OBJ_PROP_PARAMS)
The text string for the bookmark that the user sees in the navigational panel. More...
FX_BOOL | parent (OBJ_PROP_PARAMS)
The parent bookmark of the bookmark or null if the bookmark is the root bookmark. See also the children and bookmarkRoot properties. More...
FX_BOOL | open (OBJ_PROP_PARAMS)
Determines whether the bookmark shows its children in the navigation panel (open) or whether the children subtree is collapsed (closed). More...
FX_BOOL | createChild (OBJ_METHOD_PARAMS)
Creates a new child bookmark at the specified location. See also the children property and the insertChild and remove methods. More...
FX_BOOL | insertChild (OBJ_METHOD_PARAMS)
Inserts the specified bookmark as a child of this bookmark. If the bookmark already exists in the bookmark tree, it is unlinked before inserting it back into the tree. In addition, the insertion is checked for circularities and disallowed if one exists. This prevents users from inserting a bookmark as a child or grandchild of itself. See also the children property and the createChild and remove methods. More...
FX_BOOL | remove (OBJ_METHOD_PARAMS)
Removes the bookmark and all its children from the bookmark tree. See also the children property and the createChild and insertChild methods. More...
FX_BOOL | setAction (OBJ_METHOD_PARAMS)
Sets a JavaScript action for a bookmark. See also the Doc addRequirement and setPageAction methods and the Field object setAction method. Note:This method overwrites any action already defined for this bookmark. More...

Member Function Documentation

◆ children()

FX_BOOL Bookmark::children ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array | null
Access
R
Availability:
Phantom/Reader
Example
Dump all bookmarks in the document.
function DumpBookmark(bkm, nLevel)
{
var s = "";
for (var i = 0; i < nLevel; i++) s += " ";
console.println(s + "+-" + bkm.name);
if (bkm.children != null)
for (var i = 0; i < bkm.children.length; i++)
DumpBookmark(bkm.children[i], nLevel + 1);
}
console.clear(); console.show();
console.println("Dumping all bookmarks in the document.");
DumpBookmark(this.bookmarkRoot, 0);

◆ doc()

FX_BOOL Bookmark::doc ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Object
Access
R
Availability:
Phantom/Reader
Example
var bkm = this.bookmarkRoot.children[0];
var bkmDoc = bkm.doc;
console.println(bkmDoc.path);

◆ name()

FX_BOOL Bookmark::name ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader
Example
var bkm = this.bookmarkRoot.children[0];
console.println( "Top-level bookmark name: " + bkm.name );
The example that follows the children property also uses the name property.

◆ parent()

FX_BOOL Bookmark::parent ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Object | null
Access
R
Availability:
Phantom/Reader
Example
var bkm = this.bookmarkRoot.children[0].children[0];
var bkmparent = bkm.parent;
console.println(bkmparent.name);

◆ open()

FX_BOOL Bookmark::open ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W (Reader: R only)
Availability:
Phantom/Reader
Example
var bkm = this.bookmarkRoot.children[0];
bkm.open = true;

◆ createChild()

FX_BOOL Bookmark::createChild ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
cName The name of the bookmark that the user sees in the navigation panel.
cExpr (optional) An expression to be evaluated whenever the user clicks the bookmark. It is equivalent to creating a bookmark with a JavaScript action, as described in the PDF Reference. The default is no expression.
nIndex (optional) The 0-based index into the children array of the bookmark at which to create the new child. The default is 0.
Example
Create a bookmark at the top of the bookmark panel that takes you to the next page in the document.
this.bookmarkRoot.createChild("Next Page", "this.pageNum++");

◆ insertChild()

FX_BOOL Bookmark::insertChild ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
oBookmark A bookmark object to add as the child of this bookmark.
nIndex (optional) The 0-based index into the children array of the bookmark at which to insert the new child. The default is 0.
Example
Take the first child bookmark and move it to the end of the bookmarks.
var bm = bookmarkRoot.children[0];
bookmarkRoot.insertChild(bm, bookmarkRoot.children.length);

◆ remove()

FX_BOOL Bookmark::remove ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Example
Remove all bookmarks from the document.
bookmarkRoot.remove();

◆ setAction()

FX_BOOL Bookmark::setAction ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
cScript Defines the JavaScript expression that is to be executed whenever the user clicks the bookmark.
Example
Attach an action to the topmost bookmark.
var bm = bookmarkRoot.children[0]
bm.setAction("app.beep(0);");


Javascript API: Certificate Class Reference

Public Member Functions | List of all members
Certificate Class Reference

The Certificate object provides read-only access to the properties of an X.509 public key certificate.

Public Member Functions

FX_BOOL | binary (OBJ_PROP_PARAMS)
The raw bytes of the certificate, as a hex encoded string. More...
FX_BOOL | issuerDN (OBJ_PROP_PARAMS)
The distinguished name of the issuer of the certificate, returned as an RDN object. More...
FX_BOOL | keyUsage (OBJ_PROP_PARAMS)
An array of strings indicating the value of the certificate key usage extension. Possible values are kDigitalSignature kDataEncipherment kCRLSign kNonRepudiation kKeyAgreement kEncipherOnly kKeyEncipherment kKeyCertSign kDecipherOnly. More...
FX_BOOL | MD5Hash (OBJ_PROP_PARAMS)
The MD5 digest of the certificate, represented as a hex-encoded string. This provides a unique fingerprint for this certificate. More...
FX_BOOL | privateKeyValidityEnd (OBJ_PROP_PARAMS)
The date before which it’s legal to use the private key associated with this certificate. If the PKUP extension is not present or this property isn’t present in the extension, this represents the validity end date of the certificate itself. Before a digital ID can be used for signing, Acrobat ensures that the signing time is prior to the privateKeyValidityEnd date. More...
FX_BOOL | privateKeyValidityStart (OBJ_PROP_PARAMS)
The date after which it’s legal to use the private key associated with this certificate. If the Private Key Usage Period (PKUP) certificate extension is not present, this represents the validity start date of the certificate itself. Before a digital ID can be used for signing, Acrobat ensures that the signing time is more recent than the privateKeyValidityStart date. More...
FX_BOOL | SHA1Hash (OBJ_PROP_PARAMS)
The SHA1 digest of the certificate, represented as a hex-encoded string. This provides a unique fingerprint for this certificate. More...
FX_BOOL | serialNumber (OBJ_PROP_PARAMS)
A unique identifier for this certificate, used in conjunction with issuerDN. More...
FX_BOOL | subjectCN (OBJ_PROP_PARAMS)
The common name of the signer. More...
FX_BOOL | subjectDN (OBJ_PROP_PARAMS)
The distinguished name of the signer, returned as an RDN object. More...
FX_BOOL | validityEnd (OBJ_PROP_PARAMS)
The validity end date of the certificate. Before a digital ID can be used for signing, Acrobat ensures that the signing time is prior to the validityEnd date. More...
FX_BOOL | validityStart (OBJ_PROP_PARAMS)
The validity start date of the certificate. Before a digital ID can be used for signing Acrobat, ensures that the signing time is more recent than the validityStart date. More...

Member Function Documentation

◆ binary()

FX_BOOL Certificate::binary ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader

◆ issuerDN()

FX_BOOL Certificate::issuerDN ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
RDN object
Access
R
Availability:
Phantom/Reader

◆ keyUsage()

FX_BOOL Certificate::keyUsage ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array of Strings
Access
R
Availability:
Phantom/Reader

◆ MD5Hash()

FX_BOOL Certificate::MD5Hash ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader

◆ privateKeyValidityEnd()

FX_BOOL Certificate::privateKeyValidityEnd ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Date object
Access
R
Availability:
Phantom/Reader

◆ privateKeyValidityStart()

FX_BOOL Certificate::privateKeyValidityStart ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Date object
Access
R
Availability:
Phantom/Reader

◆ SHA1Hash()

FX_BOOL Certificate::SHA1Hash ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader

◆ serialNumber()

FX_BOOL Certificate::serialNumber ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader

◆ subjectCN()

FX_BOOL Certificate::subjectCN ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader

◆ subjectDN()

FX_BOOL Certificate::subjectDN ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
RDN object
Access
R
Availability:
Phantom/Reader

◆ validityEnd()

FX_BOOL Certificate::validityEnd ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Date object
Access
R
Availability:
Phantom/Reader

◆ validityStart()

FX_BOOL Certificate::validityStart ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Date object
Access
R
Availability:
Phantom/Reader


Javascript API: console Class Reference

Public Member Functions | List of all members
console Class Reference

The console object is a static object that enables access to the Phantom JavaScript Console for executing JavaScript and displaying debug messages.

Public Member Functions

FX_BOOL | clear (OBJ_METHOD_PARAMS)
Clears the console windows buffer of any output.
FX_BOOL | hide (OBJ_METHOD_PARAMS)
Closes the console window.
FX_BOOL | println (OBJ_METHOD_PARAMS)
Prints a string value to the console window with an accompanying carriage return. More...
FX_BOOL | show (OBJ_METHOD_PARAMS)
Shows the console window. More...

Member Function Documentation

◆ println()

FX_BOOL console::println ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
cMessage A string message to print.
Example 1
This example prints the value of a field to the console window. The script could be executed during a mouse-up event.
var f = this.getField("myText");
console.clear(); console.show();
console.println("Field value = " + f.value);
Example 2
The console can be used as a debugging tool. For example, you can write values of variables to the console. The following script is at the document level:
var debugIsOn = true;
function myFunction ( n, m )
{
if (debugIsOn)
{
console.println("Entering function: myFunction");
console.println(" Parameter 1: n = " + n);
console.println(" Parameter 2: m = " + m);
}
....
....
if (debugIsOn) console.println(" Return value: rtn = " + rtn);
return rtn;
}

◆ show()

FX_BOOL console::show ( OBJ_METHOD_PARAMS )
Example
Clear and show the console window:
console.clear();
console.show();


Javascript API: Doc Class Reference

Public Member Functions | List of all members
Doc Class Reference

This object provides the interface between a PDF Doc open in the viewer and the JavaScript interpreter. It provides methods and properties for accessing the PDF Doc.

Public Member Functions

FX_BOOL | author (OBJ_PROP_PARAMS)
The author of the Doc. More...
FX_BOOL | baseURL (OBJ_PROP_PARAMS)
The base URL for the Doc is used to resolve relative web links within the Doc. See also URL. More...
FX_BOOL | bookmarkRoot (OBJ_PROP_PARAMS)
The root bookmark for the bookmark tree. This bookmark is not displayed to the user but is a programmatic construct used to access the tree and the child bookmarks. More...
FX_BOOL | calculate (OBJ_PROP_PARAMS)
If true(the default value), calculations can be performed for this Doc.If false, calculations cannot be performed for this Doc.This property supersedes theapp.calculateproperty, whose use is now discouraged. More...
FX_BOOL | creationDate (OBJ_PROP_PARAMS)
The Doc’s creation date. More...
FX_BOOL | creator (OBJ_PROP_PARAMS)
The creator of the Doc (for example, “Foxit FrameMaker” or “Foxit PageMaker”). More...
FX_BOOL | delay (OBJ_PROP_PARAMS)
This property can delay the redrawing of any appearance changes to every field in the Doc. It is generally used to buffer a series of changes to fields before requesting that the fields regenerate their appearance. If true, all changes are queued until delay is reset to false, at which time all the fields on the Page are redrawn. See also the Field object delay property. More...
FX_BOOL | dirty (OBJ_PROP_PARAMS)
Specifies whether the Doc needs to be saved as the result of a changes to the Doc.It is useful to reset the dirty flag when performing changes that do not warrant saving, such as updating a status field. More...
FX_BOOL | documentFileName (OBJ_PROP_PARAMS)
The base file name, with extension, of the Doc referenced by the Doc. The device-independent path is not returned. See also thepathandURLproperties. The file size of the Doc can be obtained from the file size property. More...
FX_BOOL | external (OBJ_PROP_PARAMS)
Specifies whether the current Doc is being viewed in the Phantom application or in an external window (such as a web browser). More...
FX_BOOL | filesize (OBJ_PROP_PARAMS)
The file size of the Doc in bytes. More...
FX_BOOL | icons (OBJ_PROP_PARAMS)
An array of named Icon objects that are present in the Doc-level named icons tree. If there are no named icons in the Doc, the property has a value of null. See also addIcon, getIcon, importIcon, removeIcon, the Field object properties buttonGetIcon, buttonImportIcon, buttonSetIcon, and the Icon object. More...
FX_BOOL | info (OBJ_PROP_PARAMS)
Specifies an object with properties from the Doc information dictionary in the PDF file. (See the PDF Reference). Standard entries are: Title Author Authors Subject Keywords Creator Producer CreationDate ModDate Trapped For Foxit Phantom, properties of this object are write able and setting a property dirties the Doc. Additional Doc information fields can be added by setting non-standard properties. In Foxit Reader, writing to any property in this object throws an exception. More...
FX_BOOL | keywords (OBJ_PROP_PARAMS)
The keywords that describe the Doc(for example, “forms”, “taxes”, “government”). More...
FX_BOOL | layout (OBJ_PROP_PARAMS)
Changes the Page layout of the current Doc. Valid values are: SinglePage OneColumn TwoColumnLeft TwoColumnRight TwoPageLeft TwoPageRight. More...
FX_BOOL | media (OBJ_PROP_PARAMS)
An object that contains multimedia properties and methods for the Doc.The properties and methods are described under the Doc.media object. More...
FX_BOOL | modDate (OBJ_PROP_PARAMS)
The date the Doc was last modified. More...
FX_BOOL | mouseX (OBJ_PROP_PARAMS)
Gets the x coordinate of the mouse coordinates in default user space in relation to the current Page. More...
FX_BOOL | mouseY (OBJ_PROP_PARAMS)
Gets the y coordinate of the mouse coordinates in default user space in relation to the current Page. More...
FX_BOOL | numFields (OBJ_PROP_PARAMS)
The total number of fields in the Doc. See also getNthFieldName. More...
FX_BOOL | numPages (OBJ_PROP_PARAMS)
The number of pages in the Doc. More...
FX_BOOL | pageNum (OBJ_PROP_PARAMS)
Gets or sets the current Page of the Doc. When setting pageNum to a specific Page, remember that the values are 0-based. More...
FX_BOOL | pageWindowRect (OBJ_PROP_PARAMS)
An array of screen coordinates (a rectangle) for the Phantom Page view window. The Page view window is the area inside the inner Doc window in which the PDF content is displayed. More...
FX_BOOL | path (OBJ_PROP_PARAMS)
The device-independent path of the Doc, for example: /c/Program Files (x86)/Foxit Software/Foxit PhantomPDF/. More...
FX_BOOL | producer (OBJ_PROP_PARAMS)
The producer of the Doc . More...
FX_BOOL | securityHandler (OBJ_PROP_PARAMS)
The name of the security handler used to encrypt the Doc. Returns null if there is no security handler (for example, the Doc is not encrypted). More...
FX_BOOL | subject (OBJ_PROP_PARAMS)
The Doc’s subject. This property is read-only in Reader. More...
FX_BOOL | title (OBJ_PROP_PARAMS)
The title of the Doc. More...
FX_BOOL | zoom (OBJ_PROP_PARAMS)
The current Page zoom level. Allowed values are between 8.33% and 6400%, specified as a percentage number. For example, a zoom value of 100 specifies 100%. More...
FX_BOOL | zoomType (OBJ_PROP_PARAMS)
The current zoom type of the Doc. The table below lists the valid zoom types. The convenience zoomtype object defines all the valid zoom types and is used to access all zoom types. More...
FX_BOOL | dynamicXFAForm (OBJ_PROP_PARAMS)
Returns true if the Doc is a dynamic XFA form and false otherwise. A dynamic XFA form is one in which some of the fields can grow or shrink in size to accommodate the values they contain. More...
FX_BOOL | URL (OBJ_PROP_PARAMS)
The Doc’s URL. If the Doc is local, it returns a URL with a file:/// scheme for Windows and UNIX and file://localhost/ for Mac OS. This may be different from the baseURL. More...
FX_BOOL | dataObjects (OBJ_PROP_PARAMS)
An array containing all the named Data objects in the Doc. Related properties and methods are openDataObject, getDataObject, createDataObject, importDataObject, removeDataObject, getDataObjectContents, and setDataObjectContents. More...
FX_BOOL | hostContainer (OBJ_PROP_PARAMS)
An instance of the HostContainer object if the PDF Doc is embedded in another container such as a web browser, otherwise undefined. More...
FX_BOOL | xfa (OBJ_PROP_PARAMS)
The property is defined only if the Doc is an XML form, that is, if the Doc was created in LiveCycle Designer. When defined, xfa is a static XFA Object, which is the root node of the underlying xfa model, and gives access to the xfa scripting object model (SOM). Refer to the Doc XML Form Object Model Reference for details on the xfa SOM. The Doc Converting Phantom JavaScript for Use in LiveCycle Designer Forms has a comparison between the Phantom and LiveCycle Designer scripting object models. More...
FX_BOOL | templates (OBJ_PROP_PARAMS)
An array of all of the Template objects in the Doc. See also createTemplate, getTemplate, and removeTemplate. More...
FX_BOOL | addAnnot (OBJ_METHOD_PARAMS)
FX_BOOL | addField (OBJ_METHOD_PARAMS)
Creates a new form field and returns it as a Field object. More...
FX_BOOL | addLink (OBJ_METHOD_PARAMS)
Adds a new link to the specified Page with the specified coordinates, if the user has permission to add links to the Doc. More...
FX_BOOL | addIcon (OBJ_METHOD_PARAMS)
Adds a new named Icon object to the Doc-level icon tree, storing it under the specified name. More...
FX_BOOL | calculateNow (OBJ_METHOD_PARAMS)
Forces computation of all calculation fields in the current Doc. When a form contains many calculations, there can be a significant delay after the user inputs data into a field, even if it is not a calculation field. One strategy is to turn off calculations at some point and turn them back on later (see example). More...
FX_BOOL | closeDoc (OBJ_METHOD_PARAMS)
Closes the Doc. It is important to use this method carefully, because it is an abrupt change in the Doc state that can affect any JavaScript executing after the close. Triggering this method from a Page event or Doc event could cause the application to behave strangely. More...
FX_BOOL | createTemplate (OBJ_METHOD_PARAMS)
Creates a visible template from the specified Page. More...
FX_BOOL | deletePages (OBJ_METHOD_PARAMS)
Deletes pages from the Doc. If neither Page of the range is specified, the first Page (Page 0) is deleted. More...
FX_BOOL | exportAsText (OBJ_METHOD_PARAMS)
Exports form fields as a tab-delimited text file to a local hard disk. The text file that is created follows the conventions specified by Microsoft Excel. In particular, exportAsText correctly handles quotes and multiline text fields. More...
FX_BOOL | exportAsFDF (OBJ_METHOD_PARAMS)
Exports form fields as an FDF file to the local hard drive. More...
FX_BOOL | exportAsXFDF (OBJ_METHOD_PARAMS)
Exports form fields as an XFDF file to the local hard drive. More...
FX_BOOL | exportAsXFDFStr (OBJ_METHOD_PARAMS)
Exports form fields as an XFDF file to the local hard drive. More...
FX_BOOL | extractPages (OBJ_METHOD_PARAMS)
Creates a new Doc consisting of pages extracted from the current Doc. If a Page range is not specified, the method extracts all pages in the Doc. More...
FX_BOOL | exportDataObject (OBJ_METHOD_PARAMS)
Extracts the specified data object to an external file. More...
FX_BOOL | getAnnot (OBJ_METHOD_PARAMS)
Returns an Annotation object contained on a specific Doc Page. More...
FX_BOOL | getAnnots (OBJ_METHOD_PARAMS)
Gets an array of Annotation objects satisfying specified criteria. More...
FX_BOOL | getField (OBJ_METHOD_PARAMS)
Maps a Field object in the PDF Doc to a JavaScript variable. More...
FX_BOOL | getLinks (OBJ_METHOD_PARAMS)
Gets an array of Link objects that are enclosed within specified coordinates on a Page. More...
FX_BOOL | getNthFieldName (OBJ_METHOD_PARAMS)
Gets the name of the nth field in the Doc. More...
FX_BOOL | getOCGs (OBJ_METHOD_PARAMS)
Gets an array of OCG objects found on a specified Page. More...
FX_BOOL | getPageBox (OBJ_METHOD_PARAMS)
Gets a rectangle in rotated user space that encompasses the named box for the Page. More...
FX_BOOL | getPageNthWord (OBJ_METHOD_PARAMS)
Gets the nth word on the Page. More...
FX_BOOL | getPageNumWords (OBJ_METHOD_PARAMS)
Gets the number of words on the Page. More...
FX_BOOL | getPageRotation (OBJ_METHOD_PARAMS)
Gets the rotation of the specified Page. More...
FX_BOOL | getPrintParams (OBJ_METHOD_PARAMS)
Gets a PrintParams object that reflects the default print settings. More...
FX_BOOL | getURL (OBJ_METHOD_PARAMS)
Gets the specified URL over the Internet using a GET. More...
FX_BOOL | getDataObject (OBJ_METHOD_PARAMS)
Obtains a specific Data object. More...
FX_BOOL | getTemplate (OBJ_METHOD_PARAMS)
Gets the named template from the Doc. More...
FX_BOOL | gotoNamedDest (OBJ_METHOD_PARAMS)
Goes to a named destination within the PDF Doc. For details on named destinations and how to create them, see the PDF Reference. More...
FX_BOOL | importAnFDF (OBJ_METHOD_PARAMS)
Imports the specified FDF file. More...
FX_BOOL | importAnXFDF (OBJ_METHOD_PARAMS)
Imports the specified XFDF file containing XML form data. More...
FX_BOOL | importDataObject (OBJ_METHOD_PARAMS)
Imports an external file into the Doc and associates the specified name with the data object. Data objects can later be extracted or manipulated. More...
FX_BOOL | importTextData (OBJ_METHOD_PARAMS)
Imports a row of data from a text file. Each row must be tab delimited. The entries in the first row of the text file are the column names of the tab delimited data. These names are also field names for text fields present in the PDF file. The data row numbers are 0-based; that is, the first row of data is row zero (this does not include the column name row). When a row of data is imported, each column datum becomes the field value of the field that corresponds to the column to which the data belongs. See also the export version of this method, exportAsText. More...
FX_BOOL | insertPages (OBJ_METHOD_PARAMS)
Inserts pages from the source Doc into the current Doc. If a Page range is not specified, the method gets all pages in the source Doc. See also deletePages and replacePages. More...
FX_BOOL | mailForm (OBJ_METHOD_PARAMS)
Exports the form data and mails the resulting FDF file as an attachment to all recipients, with or without user interaction. The method does not support signed signature fields. See also mailDoc, app.mailGetAddrs, app.mailMsg, the FDF object mail method and the Report object mail method. More...
FX_BOOL | print (OBJ_METHOD_PARAMS)
Prints all or a specific number of pages of the Doc. More...
FX_BOOL | removeField (OBJ_METHOD_PARAMS)
Removes the specified field from the Doc. If the field appears on more than one Page, all representations are removed. More...
FX_BOOL | removeDataObject (OBJ_METHOD_PARAMS)
Deletes the data object corresponding to the specified name from the Doc. Related objects, properties, and methods are dataObjects, getDataObject, openDataObject, createDataObject, removeDataObject, importDataObject, getDataObjectContents, and setDataObjectContents, and the Data object. More...
FX_BOOL | removeTemplate (OBJ_METHOD_PARAMS)
Removes the named template from the Doc. See also templates, createTemplate, getTemplate, and the Template object. More...
FX_BOOL | replacePages (OBJ_METHOD_PARAMS)
Replaces pages in the current Doc with pages from the source Doc. More...
FX_BOOL | resetForm (OBJ_METHOD_PARAMS)
Resets the field values within a Doc. Resetting a field causes it to take on its default value (which, in the case of text fields, is usually blank). More...
FX_BOOL | submitForm (OBJ_METHOD_PARAMS)
Submits the form to a specified URL. More...
FX_BOOL | mailDoc (OBJ_METHOD_PARAMS)
Saves the current PDF Doc and mails it as an attachment to all recipients, with or without user interaction. See also mailForm, app.mailGetAddrs, app.mailMsg, the FDF object mail method and the Report object mail method. More...
FX_BOOL | scroll (OBJ_METHOD_PARAMS)
Scrolls the specified point on the current Page into the middle of the current view. These coordinates must be defined in rotated user space. See the PDF Reference for details. More...
FX_BOOL | syncAnnotScan (OBJ_METHOD_PARAMS)
Guarantees that all annotations will be scanned by the time this method returns. To show or process annotations for the entire Doc, all annotations must have been detected. Normally, a background task runs that examines every Page and looks for annotations during idle time, as this scan is a time-consuming task. Much of the annotation behavior works gracefully even when the full list of annotations is not yet acquired by background scanning. In general, you should call this method if you want the entire list of annotations. See also getAnnots. More...
FX_BOOL | setPageTabOrder (OBJ_METHOD_PARAMS)
Sets the tab order of the form fields on a Page. The tab order can be set by row, by column, or by structure. More...
FX_BOOL | addWatermarkFromText (OBJ_METHOD_PARAMS)
Adds the given text as a watermark to the specified pages in the Doc and places the watermark in an optional content group (OCG). See the OCG object. More...
FX_BOOL | addWatermarkFromFile (OBJ_METHOD_PARAMS)
Adds a Page as a watermark to the specified pages in the Doc and places the watermark in an optional content group (OCG). See also the OCG object. More...
FX_BOOL | flattenPages (OBJ_METHOD_PARAMS)
Converts all annotations in a Page range to Page contents. If a Page range is not specified, all annotations in the Doc are converted. Note: Great care must be used when using this method. All annotations—including form fields, comments, and links— on the specified range of pages are flattened. They may have appearances, but they will no longer be annotations. More...
FX_BOOL | setPageTransitions (OBJ_METHOD_PARAMS)
Sets the Page transition for a specific range of pages. See also getPageTransition. More...
FX_BOOL | getPageTransition (OBJ_METHOD_PARAMS)
Sets the Page transition for a specific range of pages. More...
FX_BOOL | movePage (OBJ_METHOD_PARAMS)
Moves a Page within the Doc. More...
FX_BOOL | newPage (OBJ_METHOD_PARAMS)
Adds a new Page to the active Doc.
Note: This method can only be executed during batch and console events. More...
FX_BOOL | setPageRotations (OBJ_METHOD_PARAMS)
Rotates the specified pages in the current Doc. More...
FX_BOOL | setPageBoxes (OBJ_METHOD_PARAMS)
Sets a rectangle that encompasses the named box for the specified pages. More...
FX_BOOL | addWeblinks (OBJ_METHOD_PARAMS)
Scans the specified pages looking for instances of text with an http: scheme and converts them into links with URL actions. More...
FX_BOOL | removeWeblinks (OBJ_METHOD_PARAMS)
Scans the specified pages looking for links with actions to go to a particular URL on the web and deletes them. See also addWeblinks. More...
FX_BOOL | removeLinks (OBJ_METHOD_PARAMS)
If the user has permission to remove links from the Doc, removes all the links on the specified Page within the specified coordinates. More...
FX_BOOL | getOCGOrder (OBJ_METHOD_PARAMS)
Returns this Doc’s OCGOrder array. This array represents how layers are displayed in the UI. More...
FX_BOOL | setOCGOrder (OBJ_METHOD_PARAMS)
Sets this Doc’s OCGOrder array. This array represents how layers are displayed in the UI. The simplest order array is a flat array of OCG objects. In this case, the listed OCGs are displayed in the UI as a flat list in the same order. If a subarray is present in the order array and the first element of the array is a string, the string will be listed with the rest of the array nested underneath it. If the first element of the array is not a string, the entire array will appear nested underneath the OCG preceding the subarray. More...

Member Function Documentation

◆ author()

FX_BOOL Doc::author ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R/W
Availability:
Phantom/Reader
example 1:
console.println(this.author);
example 2:
this.author = "new author";

◆ baseURL()

FX_BOOL Doc::baseURL ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R/W
Availability:
Phantom/Reader
example 1:
console.println("Base URL was " + this.baseURL);
example 2:
this.baseURL = "http://www.foxitsoftware.com";

◆ bookmarkRoot()

FX_BOOL Doc::bookmarkRoot ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Object
Access:
R
Availability:
Phantom/Reader
example:
function DumpBookmark(bkm, nLevel)
{
var s = "";
for (var i = 0; i < nLevel; i++) s += " ";
console.println(s + "+-" + bkm.name);
if (bkm.children != null)
for (var i = 0; i < bkm.children.length; i++)
DumpBookmark(bkm.children[i], nLevel + 1);
}
console.clear(); console.show();
console.println("Dumping all bookmarks in the Doc.");
DumpBookmark(this.bookmarkRoot, 0);

◆ calculate()

FX_BOOL Doc::calculate ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Object
Access:
R/W
Availability:
Phantom/Reader
example 1:
console.println(this.calculate);
example 2:
this.calculate = false;

◆ creationDate()

FX_BOOL Doc::creationDate ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Date
Access:
R
Availability:
Phantom/Reader
example:
console.println(this.creationDate);

◆ creator()

FX_BOOL Doc::creator ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R/W
Availability:
Phantom/Reader
example 1:
console.println(this.creator);
example 2:
this.creator = "new creator";

◆ delay()

FX_BOOL Doc::delay ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Boolean
Access:
R/W
Availability:
Phantom/Reader
example 1:
console.println(this.delay);
example 2:
this.delay = true;

◆ dirty()

FX_BOOL Doc::dirty ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Boolean
Access:
R/W
Availability:
Phantom/Reader
example 1:
//Reset a form and setsdirtytofalse.After the reset, the user can close the Doc without having to dismiss a Save dialog box.
var f = this.getField("MsgField");
f.value = "You have made too many mistakes, I’m resetting the form. "
+ "Start over, this time follow the directions!";
this.resetForm();
this.dirty = false;
example 2:
//Fill a text field to instruct the user to complete the form.The script is constructed so that populating the field does not change the save state of the Doc.
var f = this.getField("MsgField");
var b = this.dirty;
f.value = "Please fill in the fields below.";
this.dirty = b;

◆ documentFileName()

FX_BOOL Doc::documentFileName ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R
Availability:
Phantom/Reader
example:
//Get the Doc file name.
console.println('"The file name of this Doc is '
+ this.documentFileName +'."');

◆ external()

FX_BOOL Doc::external ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Boolean
Access:
R
Availability:
Phantom/Reader
example:
//Detect whether this Doc is in a browser or not.
if ( this.external )
{
// Viewing from a browser
}
else
{
// Viewing in the Phantom application.
}

◆ filesize()

FX_BOOL Doc::filesize ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Integer
Access:
R
Availability:
Phantom/Reader
example:
console.println("File size is " + this.filesize);

◆ icons()

FX_BOOL Doc::icons ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Object|null
Access:
R
Availability:
Phantom/Reader
example 1:
//Report the number of named icons in the current Doc.
if (this.icons == null)
console.println("No named icons in this doc");
else
{
var objKeys = Object.keys(this.icons);
console.println("There are " + objKeys.length + " named icons in this doc");
}
example 2:
//List all named icons the current Doc.
for (var i = 0; i < this.icons.length; i++) {
console.println("icon[" + i + "]=" + this.icons[i].name);
}

◆ info()

FX_BOOL Doc::info ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Object
Access:
R/W
Availability:
Phantom/Reader
example 1:
//Get the title of the current Doc.
var docTitle = this.Info.Title;
example 2:
this.Info.Title = "JavaScript, The Definitive Guide";
this.Info.ISBN = "1-56592-234-4";
this.Info.PublishDate = new Date();
for (var i in this.Info)
console.println(i + ": "+ this.Info[i]);

◆ keywords()

FX_BOOL Doc::keywords ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R/W(Reader: R only)
Availability:
Phantom/Reader
example 1:
console.println(this.keywords);
example 2:
this.keywords = "new keywords";

◆ layout()

FX_BOOL Doc::layout ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R/W
Availability:
Phantom/Reader
example:
//Put the Doc into a continuous facing layout where the first Page of the Doc appears in the left column:
this.layout = "TwoColumnLeft";

◆ media()

FX_BOOL Doc::media ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Doc.media object
Access:
R/W
Availability:
Phantom/Reader
example:
var mediaObj = this.media;
var annot = mediaObj.getAnnot
({ nPage: 0,cAnnotTitle: "myScreen" });
console.println(annot.rect)

◆ modDate()

FX_BOOL Doc::modDate ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Date
Access:
R
Availability:
Phantom/Reader
example:
console.println(this.modDate)

◆ mouseX()

FX_BOOL Doc::mouseX ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Number
Access:
R
Availability:
Phantom/Reader
example:
//Get the coordinates of the mouse as the user moves it around the viewer.
function getMouseCoor() {
console.println( "("+this.mouseX+","+ this.mouseY+")" );
}
getMouseCoor();

◆ mouseY()

FX_BOOL Doc::mouseY ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Number
Access:
R
Availability:
Phantom/Reader

◆ numFields()

FX_BOOL Doc::numFields ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Integer
Access:
R
Availability:
Phantom/Reader
example 1:
console.println("There are " + this.numFields + " in this Doc");

◆ numPages()

FX_BOOL Doc::numPages ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Integer
Access:
R
Availability:
Phantom/Reader
example 1:
console.println("There are " + this.numPages + " in this Doc");
example 2:
//Delete the last Page from the Doc. The (0-based) Page number of the last Page in the Doc is
//this.numPages - 1.
this.deletePages({ nStart: this.numPages - 1 });

◆ pageNum()

FX_BOOL Doc::pageNum ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Integer
Access:
R/W
Availability:
Phantom/Reader
example:
//Go to the first Page of the Doc.
this.pageNum = 0;
//Advance the Doc to the next Page.
this.pageNum++;

◆ pageWindowRect()

FX_BOOL Doc::pageWindowRect ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Array of Numbers
Access:
R
Availability:
Phantom/Reader
example:
console.println(this.pageWindowRect)

◆ path()

FX_BOOL Doc::path ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R
Availability:
Phantom/Reader
example:
console.println(this.path)

◆ producer()

FX_BOOL Doc::producer ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R/W
Availability:
Phantom/Reader
example 1:
console.println(this.producer)
example 2:
this.producer = "new producer"

◆ securityHandler()

FX_BOOL Doc::securityHandler ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R
Availability:
Phantom/Reader
example:
console.println(this.securityHandler != null ?
"This Doc is encrypted with " + this.securityHandler
+ " security." : "This Doc is unencrypted.");

◆ subject()

FX_BOOL Doc::subject ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R/W
Availability:
Phantom/Reader
example 1:
console.println(this.subject)
example 2:
this.subject = "new subject"

◆ title()

FX_BOOL Doc::title ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R/W (Reader: R only)
Availability:
Phantom/Reader
example 1:
console.println(this.title)
example 2:
this.title = "new title"

◆ zoom()

FX_BOOL Doc::zoom ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Number
Access:
R/W
Availability:
Phantom/Reader
example:
//Zoom to twice the current zoom level.
this.zoom *= 2;
//Set the zoom to 200%.
this.zoom = 200;

◆ zoomType()

FX_BOOL Doc::zoomType ( OBJ_PROP_PARAMS )
Zoom type | Keyword
NoVary | zoomtype.none
FitPage | zoomtype.fitP
FitWidth | zoomtype.fitW
FitHeight | zoomtype.fitH
FitVisibleWidth | zoomtype.fitV
Preferred | zoomtype.pref
Precondition
Doc must be opened.
Type:
String
Access:
R/W
Availability:
Phantom/Reader
example:
//Set the zoom type of the Doc to fit the width.
this.zoomType = zoomtype.fitW;

◆ dynamicXFAForm()

FX_BOOL Doc::dynamicXFAForm ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Boolean
Access:
R
Availability:
Phantom/Reader
example:
if ( this.dynamicXFAForm )
console.println(" This is a dynamic XML form.");

◆ URL()

FX_BOOL Doc::URL ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
String
Access:
R
Availability:
Phantom/Reader

◆ dataObjects()

FX_BOOL Doc::dataObjects ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Array
Access:
R
Availability:
Phantom/Reader
example:
//List all embedded files in the Doc.
var d = this.dataObjects;
for (var i = 0; i < d.length; i++)
console.println("Data Object[" + i + "]=" + d[i].name);

◆ hostContainer()

FX_BOOL Doc::hostContainer ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Object
Access:
R/W
Availability:
Phantom/Reader

◆ xfa()

FX_BOOL Doc::xfa ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
XFAObject
Access:
R
Availability:
Phantom/Reader
example 1:
//Suppose this Doc is an XML form, and that there is a text field named EmployeeName.This example uses the xfa
//object to access and change the value of this field.
var eN = this.xfa.form.form1.EmployeeName;
console.println("\nEmployeeName: " + eN.rawValue);
//Now change the value of the EmployeeName.
eN.rawValue = "phantom"
console.println("\nEmployeeName: " + eN.rawValue);
example 2:
//Call a function, defined in a folder level script file, that uses the xfa property, by passing the Doc object.
function isXFA(doc) {
var wasWasNot = (typeof doc.xfa == "undefined") ? "not" : "";
console.println("This Doc was "+wasWasNot+"created by Designer.");
}
//From within the Doc, or from the console, the function is called is by isXFA(this).

◆ templates()

FX_BOOL Doc::templates ( OBJ_PROP_PARAMS )
Precondition
Doc must be opened.
Type:
Array
Access:
R
Availability:
Phantom/Reader
example:
//List all templates in the Doc.
var t = this.templates
for ( var i=0; i < t.length; i++)
{
var state = (t[i].hidden) ? "visible" : "hidden"
console.println("Template: \"" + t[i].name
+ "\", current state: " + state);
}

◆ addAnnot()

FX_BOOL Doc::addAnnot ( OBJ_METHOD_PARAMS )

Creates an Annotation object having the specified properties. Properties not specified are given their default values for the specified type of annotation.

Parameters
parameter | instruction
object | A generic object that specifies the properties of the Annotation object, such as type, rect, and Page, to be created
Returns
The new Annotation object.
Precondition
Doc must be opened.
example 1:
var annot = this.addAnnot
({
Page: 0,
type: "Text",
author: "Phantom",
point: [300,400],
strokeColor: color.yellow,
contents: "Need a little help with this paragraph.",
noteIcon: "Help"
});
example 2:
var annot = this.addAnnot
({
Page: 0,
type: "Square",
rect: [0, 0, 100, 100],
name: "OnMarketShare",
author: "Phantom",
contents: "This section needs revision."
});

◆ addField()

FX_BOOL Doc::addField ( OBJ_METHOD_PARAMS )
Precondition
Doc must be opened.
Parameters
parameter | instruction
cName | The name of the new field to create. This name can use the dot separator syntax to denote a hierarchy (for example, name.last creates a parent node, name, and a child node, last).
cFieldType | The type of form field to create. Valid types are: text button combobox listbox checkbox radiobutton signature
nPageNum | The 0-based index of the Page to which to add the field.
oCoords | An array of four numbers in rotated user space that specifies the size and placement of the form field. These four numbers are the coordinates of the bounding rectangle, in the following order: upper-left x, upper-left y, lower-right x and lower-right y. See also the Field object rect property.
Returns
The newly created Field object.
example:
var inch = 72;
for (var p = 0; p < this.numPages; p++) {
// Position a rectangle (.5 inch, .5 inch)
var aRect = this.getPageBox( {nPage: p} );
aRect[0] += .5*inch; // from upper left hand corner of Page.
aRect[2] = aRect[0]+.5*inch; // Make it .5 inch wide
aRect[1] -= .5*inch;
aRect[3] = aRect[1] - 24; // and 24 points high
var f = this.addField("NextPage", "button", p, aRect )
f.setAction("MouseUp", "this.pageNum++");
f.borderStyle = border.s;
f.highlight = "push";
f.textColor = color.blue;
f.fillColor = color.ltGray;
}

◆ addLink()

FX_BOOL Doc::addLink ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | The Page on which to add the new link.
oCoords | An array of four numbers in rotated user space specifying the size and placement of the link. The numbers are the coordinates of the bounding rectangle in the following order: upper-left x, upper-left y, lower-right x and lower-right y.
Returns
The newly created Link object.
Precondition
Doc must be opened.
example 1:
var linkWidth = 36, linkHeight = 18;
for ( var i=0; i < this.numPages; i++)
{
var cropBox = this.getPageBox("Crop", i);
var linkRect1 = [0,linkHeight,linkWidth,0];
var offsetLink = cropBox[2] - cropBox[0] - linkWidth;
var linkRect2 = [offsetLink,linkHeight,linkWidth + offsetLink,0]
var lhLink = this.addLink(i, linkRect1);
var rhLink = this.addLink(i, linkRect2);
var nextPage = (i + 1) % this.numPages;
var prevPage = (i - 1) % this.numPages;
var prevPage = (prevPage>=0) ? prevPage : -prevPage;
lhLink.setAction( "this.pageNum = " + prevPage);
lhLink.borderColor = color.red;
lhLink.borderWidth = 1;
rhLink.setAction( "this.pageNum = " + nextPage);
rhLink.borderColor = color.red;
rhLink.borderWidth = 1;
}

◆ addIcon()

FX_BOOL Doc::addIcon ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name of the new object
icon | The Icon object to add.
Precondition
Doc must be opened. Only apply to push button
example:
var f = this.getField("myButton");
this.addIcon("myButtonIcon", f.buttonGetIcon());

◆ calculateNow()

FX_BOOL Doc::calculateNow ( OBJ_METHOD_PARAMS )
Precondition
Doc must be opened.
example 1:
this.calculateNow();

◆ closeDoc()

FX_BOOL Doc::closeDoc ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
bNoSave (optional) A Boolean value indicating whether to close the Doc without saving:
  • If false (the default), the user is prompted to save the Doc if it has been modified.
  • If true, the Doc is closed without prompting the user and without saving,
    even if the Doc has been modified. Be careful in using this feature because it can cause data loss without user approval.
Precondition
Doc must be opened.
example:
var d = app.activeDocs;
for( var i in d ) d[i].closeDoc();

◆ createTemplate()

FX_BOOL Doc::createTemplate ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name to be associated with this Page.
nPage | (optional) The 0-based index of the Page to operate on. The default is 0, the first Page in the Doc.
Precondition
Doc must be opened.
example 1:
numNewTemplates = this.numPages - 2;
for ( var i = 0; i < numNewTemplates; i++)
{
var t = this.createTemplate({cName:"myTemplate"+i, nPage:2 });
t.hidden = true;
}

◆ deletePages()

FX_BOOL Doc::deletePages ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nStart | (optional) The 0-based index of the first Page in the range of pages to be deleted. The default is 0, the first Page in the Doc.
nEnd | (optional) The last Page in the range of pages to be deleted. If nEnd is not specified, only the Page specified by nStart is deleted.
Precondition
Doc must be opened.
example 1:
this.deletePages({nStart: 1, nEnd: 3});

◆ exportAsText()

FX_BOOL Doc::exportAsText ( OBJ_METHOD_PARAMS )

This method writes two lines to the text file, the first line is a tab-delimited list of the names of the fields specified by aFields, the second line is a tab-delimited list of the values of the fields.

Parameters
parameter | instruction
bNoPassword | (optional) If true (the default), do not include text fields that have the password flag set in the exported text file.
aFields (optional) The array of field names to submit or a string containing a single field
name:
  • If specified, only these fields are exported, except those excluded by bNoPassword.
  • If aFields is an empty array, no fields are exported.
  • If this parameter is omitted or is null, all fields in the form are exported, except those excluded by bNoPassword.
cPath (optional) A string specifying the device-independent path for the file.
The path may be relative to the location of the current Doc.
If the parameter is omitted, a dialog box is shown to let the user select the file.
Precondition
Doc must be opened.
example:
this.exportAsText();

◆ exportAsFDF()

FX_BOOL Doc::exportAsFDF ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
bAllFields | (optional) If true, all fields are exported, including those that have no value.
bNoPassword | (optional) If true (the default), do not include text fields that have the password flag set in the exported FDF file.
aFields (optional) The array of field names to submit or a string containing a single field
name:
  • If specified, only these fields are exported, except those excluded by bNoPassword.
  • If aFields is an empty array, no fields are exported. The FDF file might still
    contain data, depending on the bAnnotations parameter.
  • If this parameter is omitted or is null, all fields in the form are exported,
    except those excluded by bNoPassword.
    Specify non-terminal field names to export an entire subtree of fields (see the
    example below).
bFlags (optional) If true, field flags are included in the exported FDF file. The default is
false.
cPath (optional) A string specifying the device-independent path for the file. The path may
be relative to the location of the current Doc. If the parameter is omitted, a
dialog box is shown to let the user select the file.
bAnnotations (optional) If true, annotations are included in the exported FDF file.
The default is false.
Precondition
Doc must be opened.
example 1:
this.exportAsFDF(true, true, null, true);
example 2:
this.exportAsFDF(false, true, "name");

◆ exportAsXFDF()

FX_BOOL Doc::exportAsXFDF ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
bAllFields (optional) If true, all fields are exported, including those that have no value. If
false (the default), excludes those fields that currently have no value.
bNoPassword (optional) If true (the default), do not include text fields that have the password
flag set in the exported XFDF.
aFields (optional) The array of field names to submit or a string containing a single field
name:
  • If specified, only these fields are exported, except those excluded by
    bNoPassword.
  • If aFields is an empty array, no fields are exported. The XFDF file might still
    contain data, depending on the bAnnotations parameter.
  • If this parameter is omitted or is null, all fields in the form are exported, except
    those excluded by bNoPassword.
cPath (optional) A string specifying the device-independent path for the file. The path may
be relative to the location of the current Doc. If the parameter is omitted, a
dialog box is shown to let the user select the file.
bAnnotations (optional) If true, annotations are included in the exported XFDF file.
The default is false.
Precondition
Doc must be opened.
example:
this.exportAsXFDF();

◆ exportAsXFDFStr()

FX_BOOL Doc::exportAsXFDFStr ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
bAllFields (optional) If true, all fields are exported, including those that have no value. If
false (the default), excludes those fields that currently have no value.
bNoPassword (optional) If true (the default), do not include text fields that have the password
flag set in the exported XFDF.
aFields (optional) The array of field names to submit or a string containing a single field
name:
  • If specified, only these fields are exported, except those excluded by
    bNoPassword.
  • If aFields is an empty array, no fields are exported. The XFDF file might still
    contain data, depending on the bAnnotations parameter.
  • If this parameter is omitted or is null, all fields in the form are exported, except
    those excluded by bNoPassword.
bAnnotations | (optional) Must be false, which is the default. Annotations are not supported.
cHRef | (optional) When supplied, its value is inserted as the source or target file of the returned XFDF expression (i.e., the value of the href attribute of the f element child of the xfdf element).
Precondition
Doc must be opened.
example:
var c = this.exportAsXFDFStr({bAllFields:"",bNoPassword:true,aFields:null,bAnnotations:false,cHRef: "6936983800013"});
console.println(c);

◆ extractPages()

FX_BOOL Doc::extractPages ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nStart | (optional) A 0-based index that defines the start of the range of pages to extract from the source Doc. If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd | (optional) A 0-based index that defines the end of the range of pages to extract from the source Doc. If only nEnd is specified, the range of pages is 0 to nEnd.
cPath | (optional) The device-independent path to save the new Doc. The path name may be relative to the location of the current Doc.
Returns
If cPath is not specified, returns the Doc for the new Doc; otherwise, returns the null object.
Precondition
Doc must be opened.
example:
//Extract each page of the document.
for (i = this.numPages - 1; i >= 0; i--)
this.extractPages( i );

◆ exportDataObject()

FX_BOOL Doc::exportDataObject ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name of the data object to extract.
cDIPath (optional) A device-independent path to which to extract the data object. This path
may be absolute or relative to the current Doc. If not specified, the user is
prompted to specify a save location.
bAllowAuth (optional) If true, a dialog box is used to obtain user authorization.
Authorization may be required if the data object was encrypted using the
encryptForRecipients method. Authorization dialog boxes are allowed if
bAllowAuth is true. The default value is false.
nLaunch (optional) nLaunch controls whether the file is launched, or opened,
after it is saved. Launching may involve opening an external application if the file is
not a PDF file. The values of nLaunch are:
  • If the value is 0, the file will not be launched after it is saved.
  • If the value is 1, the file will be saved and then launched. Launching will prompt
    the user with a security alert warning if the file is not a PDF file. The user will be
    prompted for a save path.
  • If the value is 2, the file will be saved and then launched. Launching will prompt
    the user with a security alert warning if the file is not a PDF file. A temporary path
    is used, and the user will not be prompted for a save path. The temporary file
    that is created will be deleted by Phantom upon application shutdown.
    The default value is 0.
Precondition
Doc must be opened.
example 1:
this.exportDataObject("MyData");
example 2:
this.exportDataObject({ cName: "MyPDF.pdf", nLaunch: 2 });

◆ getAnnot()

FX_BOOL Doc::getAnnot ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | The Page that contains the Annotation object.
cName | The name of the Annotation object.
Returns
The Annotation object, or null if there is no such annotation.
Precondition
Doc must be opened.
example:
var ann = this.getAnnot(0, "fa8bac3d-0881-42fa-b119-f25bf5b92e99");
if (ann == null)
console.println("Not Found!")
else
console.println("Found it! type: " + ann.type);

◆ getAnnots()

FX_BOOL Doc::getAnnots ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) A 0-based Page number. If specified, gets only annotations on the given Page. If not specified, gets annotations that meet the search criteria from all pages.
nSortBy | (optional) A sort method applied to the array. Values are: ANSB_None — (default) Do not sort; equivalent to not specifiying this parameter. ANSB_Page — Use the Page number as the primary sort criteria. ANSB_Author — Use the author as the primary sort criteria. ANSB_ModDate — Use the modification date as the primary sort criteria. ANSB_Type — Use the annotation type as the primary sort criteria.
bReverse | (optional) If true, causes the array to be reverse sorted with respect to nSortBy.
Returns
An array of Annotation objects, or null if none are found.
Precondition
Doc must be opened.
example:
this.syncAnnotScan();
var annots = this.getAnnots({
nPage:0,
nSortBy: ANSB_Author,
bReverse: true
});
console.show();
console.println("Number of Annotations: " + annots.length);
var msg = "%s in a %s annot said: \"%s\"";
for (var i = 0; i < annots.length; i++)
console.println(util.printf(msg, annots[i].author, annots[i].type,annots[i].contents));

◆ getField()

FX_BOOL Doc::getField ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name of the field of interest.
Returns
A Field object representing a form field in the PDF Doc.
Precondition
Doc must be opened.
example 1:
var f = this.getField("myText");
var aRect = f.rect;
f.multiline = true;
var height = aRect[1]-aRect[3];
aRect[3] -= 2* height;
f.rect = aRect;
example 2:
var f = this.getField("myRadio.0");
f.setAction("MouseUp",
"app.alert('Thanks for selecting the first choice.');");
example 3:
f = this.getField("myField");
for ( var i in f ) {
try {
if ( typeof f[i] != "function" )
console.println( i + ":" + f[i] )
}
catch(e) {}
}

◆ getLinks()

FX_BOOL Doc::getLinks ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | The Page that contains the Link objects. The first Page is 0.
oCoords | An array of four numbers in rotated user space, the coordinates of a rectangle listed in the following order: upper-left x, upper-left y, lower-right x and lower-right y.
Returns
An array of Link objects.
Precondition
Doc must be opened.
example 1:
var numLinks=0;
for ( var p = 0; p < this.numPages; p++)
{
var b = this.getPageBox("Crop", p);
var l = this.getLinks(p, b);
console.println("Number of Links on Page " + p +" is " + l.length);
numLinks += l.length;
}
console.println("Number of Links in Doc is " + numLinks);

◆ getNthFieldName()

FX_BOOL Doc::getNthFieldName ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nIndex | The index of the field whose name should be obtained.
Returns
The name of the field in the Doc.
Precondition
Doc must be opened.
example 1:
for (var i = 0; i < this.numFields; i++)
console.println("Field[" + i + "] = " + this.getNthFieldName(i));

◆ getOCGs()

FX_BOOL Doc::getOCGs ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) The 0-based Page number. If not specified, all the OCGs found in the Doc are returned. If no argument is passed, returns all OCGs listed in alphabetical order, by name. If nPage is passed, this method returns the OCGs for that Page, in the order they were created.
Returns
An array of OCG objects or null if no OCGs are present.
Precondition
Doc must be opened.
example 1:
var ocgArray = this.getOCGs({nPage:0});
for (var i=0; i < ocgArray.length; i++)
console.println("Ocg " + i + " is " + ocgArray[i].state);

◆ getPageBox()

FX_BOOL Doc::getPageBox ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cBox | (optional) The type of box. Values are: Art Bleed BBox Crop (default) Trim For definitions of these boxes see the PDF Reference.
nPage | (optional) The 0-based index of the page. The default is 0, the first page in the document.
Returns
A rectangle in rotated user space that encompasses the named box for the Page.
Precondition
Doc must be opened.
example 1:
var aRect = this.getPageBox("Media");
var width = aRect[2] - aRect[0];
var height = aRect[1] - aRect[3];
console.println("Current Page has a width of " + width + " and a height of " + height);

◆ getPageNthWord()

FX_BOOL Doc::getPageNthWord ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) The 0-based index of the Page. The default is 0, the first Page in the Doc.
nWord | (optional) The 0-based index of the word. The default is 0, the first word on the Page.
Returns
The nth word on the Page.
Precondition
Doc must be opened.
example 1:
var ckWord = this.getPageNthWord(0, 0);
console.println("Page 1 nth word is " + ckWord);

◆ getPageNumWords()

FX_BOOL Doc::getPageNumWords ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) The 0-based index of the Page. The default is 0, the first Page in the Doc.
Returns
The number of words on the Page.
Precondition
Doc must be opened.
example 1:
var numWord = this.getPageNumWords(0);
console.println("The number of words on the Page 1 is " + numWord);

◆ getPageRotation()

FX_BOOL Doc::getPageRotation ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) The 0-based index of the Page. The default is 0, the first Page in the Doc.
Returns
The rotation value of 0, 90, 180, or 270.
Precondition
Doc must be opened.
example 1:
var ratate = this.getPageRotation(0);
console.println("The rotation value the Page 1 is " + ratate);

◆ getPrintParams()

FX_BOOL Doc::getPrintParams ( OBJ_METHOD_PARAMS )
Returns
A PrintParams object.
Precondition
Doc must be opened.
example 1:
var pp = this.getPrintParams();
console.println( pp.binaryOK + " " + pp.bitmapDPI + " " + pp.booklet);

◆ getURL()

FX_BOOL Doc::getURL ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cURL | A fully qualified URL or a relative URL. There can be a query string at the end of the URL.
Precondition
Doc must be opened.
example 1:
this.getURL("https://www.foxitsoftware.cn/");

◆ getDataObject()

FX_BOOL Doc::getDataObject ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name of the data object to obtain.
Returns
The Data object corresponding to the specified name.
Precondition
Doc must be opened.
example 1:
var MyData = this.getDataObject("MyData");
console.show(); console.clear();
for (var i in MyData) console.println("MyData." + i + "=" + MyData[i]);

◆ getTemplate()

FX_BOOL Doc::getTemplate ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name of the template to retrieve.
Returns
The Template object or null if the named template does not exist in the Doc.
Precondition
Doc must be opened.
example 1:
var t = this.getTemplate("myTemplate");
if ( t != null ) console.println( "myTemplate exists and is "
+ eval( '( t.hidden) ? "hidden" : "visible"' ) + ".");
else console.println( "myTemplate is not present!");

◆ gotoNamedDest()

FX_BOOL Doc::gotoNamedDest ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name of the destination within a Doc.
Precondition
Doc must be opened.
example 1:
// Open a new Doc
var myNovelDoc = app.openDoc("..//test.pdf");
// Go to a destination in this new doc
myNovelDoc.gotoNamedDest("chapter5");
// Close the old Doc
this.closeDoc();

◆ importAnFDF()

FX_BOOL Doc::importAnFDF ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cPath | (optional) The device-independent path to the FDF file. It should look like the value of the F entry in an FDF file exported with the submitForm method or with the Form > Form Data > Export. The path may be relative to the location of the current Doc. If this parameter is omitted, a dialog box is shown to let the user select the file.
Precondition
Doc must be opened.
example 1:
this.importAnFDF("E:\\Untitled.fdf");

◆ importAnXFDF()

FX_BOOL Doc::importAnXFDF ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cPath | (optional) The device-independent path to the XFDF file. The path may be relative to the location of the current Doc. If the parameter is omitted, a dialog box is shown to let the user select the file.
Precondition
Doc must be opened.
example 1:
this.importAnXFDF("E:\\Untitled.xfdf");

◆ importDataObject()

FX_BOOL Doc::importDataObject ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name to associate with the data object.
Returns
true on success. An exception is thrown on failure.
Precondition
Doc must be opened.
example 1:
this.importDataObject("MyData");
var dataobj = this.getDataObject("MyData");
console.println(dataobj.name);

◆ importTextData()

FX_BOOL Doc::importTextData ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cPath | (optional) A relative device-independent path to the text file. If not specified, the user is prompted to locate the text data file.
nRow | (optional) The 0-based index of the row of the data to import, not counting the header row. If not specified, the user is prompted to select the row to import.
Returns
An integer return code.
Precondition
Doc must be opened.
Availability:
Phantom
example:
//In this example, there are text fields named “First”, “Middle”, and “Last”, and a data file whose first row consists of the three
//strings, “First”, “Middle”, and “Last”, separated by tabs, along with four additional rows of tab-separated name data.
//First Middle Last
//A. C. Red
//T. A. black
//A. T. white
//B. A. yellow
// Import the first row of data from "myData.txt".
this.importTextData("/c/data/myData.txt", 0)

◆ insertPages()

FX_BOOL Doc::insertPages ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) The 0-based index of the Page after which to insert the source Doc pages. Use -1 to insert pages before the first Page of the Doc.
cPath | The device-independent path to the PDF file that will provide the inserted pages. The path may be relative to the location of the current Doc.
nStart | (optional) A 0-based index that defines the start of an inclusive range of pages in the source Doc to insert. If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd | (optional) A 0-based index that defines the end of an inclusive range of pages in the source Doc to insert. If only nEnd is specified, the range of pages is 0 to nEnd.
Precondition
Doc must be opened.
Availability:
Phantom
example:
//Insert a cover Page to the current Doc.
this.insertPages ({
nPage: -1,
cPath: "/c/temp/myPage.pdf",
nStart: 0
});

◆ mailForm()

FX_BOOL Doc::mailForm ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
bUI | If true, the rest of the parameters are used in a compose-new-message window that is displayed to the user. If false, the cTo parameter is required and all other are optional.
cTo | (required if bUI is true) A semicolon-delimited list of recipients for the message.
cCc | (optional) A semicolon-delimited list of CC recipients for the message.
cBcc | (optional) A semicolon-delimited list of BCC recipients for the message.
cSubject | (optional) The subject of the message.
cMsg | (optional) The content of the message.
Precondition
Doc must be opened.
Availability:
Phantom/reader
example 1:
//Open the compose message window.
this.mailForm(true);
//Send the mail with the attached FDF file to fun1@example.com and fun2@example.com.
this.mailForm(false, "test@example.com; test@example.com", "", "",
"This is the subject", "This is the body of the mail.");

◆ print()

FX_BOOL Doc::print ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
bUI | (optional) If true (the default), will cause a UI to be presented to the user to obtain printing information and confirm the action.
nStart | (optional) A 0-based index that defines the start of an inclusive range of pages. If nStart and nEnd are not specified, all pages in the Doc are printed. If only nStart is specified, the range of pages is the single Page specified by nStart. If nStart and nEnd parameters are used, bUI must be false.
nEnd | (optional) A 0-based index that defines the end of an inclusive Page range. If nStart and nEnd are not specified, all pages in the Doc are printed. If only nEnd is specified, the range of a pages is 0 to nEnd. If nStart and nEnd parameters are used, bUI must be false.
bSilent | (optional) If true, suppresses the cancel dialog box while the Doc is printing. The default is false.
bPrintAsImage | (optional) If true, print pages as an image. The default is false.
bReverse | (optional) If true, print from nEnd to nStart. The default is false.
bAnnotations | (optional) If true (the default), annotations are printed.
printParams | (optional) The PrintParams object containing the settings to use for printing. If this parameter is passed, any other parameters are ignored.
Precondition
Doc must be opened.
Availability:
Phantom/Reader
example 1:
//Print the current Page.
this.print(false, this.pageNum, this.pageNum);
// Print a file silently
this.print({bUI: false, bSilent: true});
example 2:
//Print current Doc to a known printer.
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "Foxit PhantomPDF Printer";
this.print(pp);

◆ removeField()

FX_BOOL Doc::removeField ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The field name to remove.
Precondition
Doc must be opened.
Availability:
Phantom
example 1:
this.removeField(("myField");

◆ removeDataObject()

FX_BOOL Doc::removeDataObject ( OBJ_METHOD_PARAMS )
Parameters | instruction
cName | The name of the data object to remove.

The name of a data object is a property of the Data object. A name is given to the object when it is embedded, either automatically by the Foxit UI or programmatically by the JavaScript methods createDataObject or importDataObject.

Precondition
Doc must be opened.
Availability:
Phantom/reader
example 1:
this.removeDataObject("MyData");

◆ removeTemplate()

FX_BOOL Doc::removeTemplate ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cName | The name of the template to remove. The template name is a property of the Template object. A name is given to a template when it is created, either by the Foxit UI or by the JavaScript method getTemplate.
Precondition
Doc must be opened.
Availability:
Phantom

◆ replacePages()

FX_BOOL Doc::replacePages ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) The 0-based index of the Page at which to start replacement. The default is 0.
cPath | The device-independent path to the PDF file that will provide the replacement pages. The path may be relative to the location of the current Doc.
nStart | (optional) A 0-based index that defines the start of an inclusive range of pages in the source Doc to be used for replacement. If nStart and nEnd are not specified, gets all pages in the source Doc. If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd | (optional) A 0-based index that defines the end of an inclusive range of pages in the source Doc to be used for replacement. If nStart and nEnd are not specified, gets all pages in the source Doc. If only nEnd is specified, the range of pages is 0 to nEnd.
Precondition
Doc must be opened.
Availability:
Phantom
example 1:
this.replacePages(0,"D:\\test.pdf",0,0)

◆ resetForm()

FX_BOOL Doc::resetForm ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
aFields | (optional) An array specifying the fields to reset. If not present or null, all fields in the form are reset. You can include non-terminal fields in the array.
Precondition
Doc must be opened.
Availability:
Phantom/Reader
example 1:
//Select fields to be reset and reset them.
var fields = new Array();
fields[0] = "Form1.Name";
fields[1] = "Form2.CID";
this.resetForm(fields);
//The same fields can be reset using only one line of code:
this.resetForm(["Form1.Name","Form2.CID"]);
example 2:
//This example shows how to reset a whole subtree. For example, if you pass “name” as part of the fields array, all name
//fields, such as name.first and name.last, are reset.
this.resetForm(["name"]);

◆ submitForm()

FX_BOOL Doc::submitForm ( OBJ_METHOD_PARAMS )

The https protocol is supported for secure connections.

Parameters
parameter | instruction
cURL The URL to submit to. This string must end in #FDF if the result from the
submission is FDF or XFDF (that is, the value of cSubmitAs is “FDF” or
“XFDF”) and the Doc is being viewed inside a browser window.
bFDF (optional) If true (the default) form data is submitted as FDF. If false, it is
submitted as URL-encoded HTML.
bEmpty | (optional) If true, submit all fields, including those that have no value. If\nfalse (the default), exclude fields that currently have no value.
aFields (optional) An array of field names to submit or a string containing a single
field name:
  • If supplied, only the fields indicated are submitted, except those
    excluded by bEmpty.
  • If omitted or null, all fields are submitted, except those excluded by
    bEmpty.
  • If an empty array, no fields are submitted. A submitted FDF file might
    still contain data if bAnnotations is true.
    You can specify non-terminal field names to export an entire subtree of\nfields.
cCharset (optional) The encoding for the values submitted. String values
are utf-8, utf-16, Shift-JIS, BigFive, GBK, and UHC.
For XML-based formats,utf-8 is used. For other formats, Foxit tries to find the best host
encoding for the values being submitted.
XFDF submission ignores this value and always uses utf-8.
cSubmitAs (optional) This parameter indicates the format for submission.
Values are
FDF — (default): Submit as FDF
XFDF — Submit as XFDF
HTML — Submit as HTML
XML — submit as XML.form data is submitted in XML
format unless the parameter oXML contains a valid
XMLData object, in which case that is what gets submitted instead.
PDF — Submit the complete PDF Doc; all other parameters
except cURL are ignored.

This parameter supersedes the individual format parameters. However, they
are considered in the following priority order, from high to low:
cSubmitAs, bPDF, bXML, bFDF.
Precondition
Doc must be opened.
Availability:
Phantom/Reader
example 1:
//Submit the form to the server.
this.submitForm("http://www.example.com");
example 2:
//Submit selected form fields to a server-side script as FDF.
var aSubmitFields = new Array( "name", "id", "score" );
this.submitForm({
cURL: "http://www.example.com",
aFields: aSubmitFields,
cSubmitAs: "FDF" // the default, not needed here
});
example 3:
//Submit form as XFDF to a server-side script.
this.submitForm({
cURL: "http://www.example.com",
cSubmitAs: "XFDF"
});

◆ mailDoc()

FX_BOOL Doc::mailDoc ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
bUI | (optional) If true (the default), the rest of the parameters are used in a compose-new-message window that is displayed to the user. If false, the cTo parameter is required and all others are optional.
cTo | (optional) The semicolon-delimited list of recipients for the message..
cCc | (optional) The semicolon-delimited list of CC recipients for the message.
cBcc | (optional) The semicolon-delimited list of BCC recipients for the message.
cSubject | (optional) The subject of the message.
cMsg | (optional) The content of the message.
Precondition
Doc must be opened.
Availability:
Phantom/Reader
example 1:
//Open the compose message window.
this.mailDoc(true);
//Send email with the attached PDF file to apstory@example.com and dpsmith@example.com.
this.mailDoc({
bUI: false,
cTo: "apstory@example.com",
cCC: "dpsmith@example.com",
cSubject: "The Latest News",
cMsg: "attached is my latest news story in PDF."
});

◆ scroll()

FX_BOOL Doc::scroll ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nX | The x coordinate for the point to scroll.
nY | The y coordinate for the point to scroll.
Precondition
Doc must be opened.
Availability:
Phantom/Reader
example 1:
this.scroll(100,100);

◆ syncAnnotScan()

FX_BOOL Doc::syncAnnotScan ( OBJ_METHOD_PARAMS )
Precondition
Doc must be opened.
Availability:
Phantom/Reader
example 1:
//Wait for all annotations to be scanned, then get the array of annotations in the Doc and sort by author.
//The second line of code is not executed until syncAnnotScan returns, which does not occur until the annotation scan
//of the Doc is completed.
this.syncAnnotScan();
annots = this.getAnnots({nSortBy:ANSB_Author});

◆ setPageTabOrder()

FX_BOOL Doc::setPageTabOrder ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | The 0-based index of the Page number on which the tabbing order is to be set.
cOrder | The order to be used. Values are: rows columns structure
Precondition
Doc must be opened.
Availability:
Phantom/Reader
example 1:
//Set the Page tab order for all pages to rows.
for (var i = 0; i < this.numPages; i++)
this.setPageTabOrder(i, "rows");

◆ addWatermarkFromText()

FX_BOOL Doc::addWatermarkFromText ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cText | The text to use as the watermark. Multiline text is allowed. A newline can be specified with the characters “\r”.
nTextAlign | (optional) The text alignment to use for cText within the watermark. See app.constants.align for possible values. This parameter has no effect if cText is only one line.
cFont | (optional) The font to be used for this watermark. Valid fonts are defined as properties of the font object, as listed in the textFont property of the Field object. An arbitrary font can be used by passing a string that represents the PostScript name of the font. The default is font.Helv.
nFontSize | (optional) The point size of the font to use for the watermark. The default is 24.
aColor | (optional) The color to use for the watermark. See Color arrays. The default is color.black.
nStart | (optional) The 0-based index of the first Page in the range of pages to which the watermark should be added. If nStart and nEnd are not specified, the range of pages is for all pages in the Doc. If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd | (optional) The last Page in the range of pages to which the watermark should be added. If nStart and nEnd are not specified, the range of pages is for all pages in the Doc. If only nEnd is specified, the range of pages is 0 to nEnd.
bOnTop | (optional) A Boolean value specifying the z-ordering of the watermark. A value of true will result in the watermark being added above all other Page content. A value of false will result in the watermark being added below all other Page content. This parameter is ignored if bFixedPrint is true. The default is true.
bOnScreen | (optional) A Boolean value to indicate whether the watermark should be displayed when viewing the Doc on screen.
bOnPrint | (optional) A Boolean value to indicate whether the watermark should be displayed when printing the Doc.
nHorizAlign | (optional) A number indicating how the watermark should be aligned horizontally. See app.constants.align for possible values. The default is app.constants.align.center.
nVertAlign | (optional) A number indicating how the watermark should be aligned vertically. See app.constants.align for possible values. The default is app.constants.align.center.
nHorizValue | (optional) A number used to shift the horizontal position of the watermark on the Page. If bPercentage is true, this number represents a percentage of the horizontal Page size. If bPercentage is false, this number represents the number of points to be offset. The default is 0.
nVertValue | (optional) A number used to shift the vertical position of the watermark on the\npage. If bPercentage is true, this number represents a percentage of the vertical Page size. If bPercentage is false, this number represents the number of points to be offset. The default is 0.
bPercentage | (optional) A Boolean value used to indicate whether nHorizValue and nVertValue represent a percentage of the Page size or an explicit number of points. The default is false.
nScale | (optional) The scale to be used for the watermark, where 1.0 is 100%. A value of -1 specifies that the watermark should fit to the Page while maintaining its proportions. The default is 1.0.
bFixedPrint | (optional) A Boolean value that indicates that the watermark should be added as a FixedPrint Watermark annotation. This prints the watermark at a fixed size and position regardless of the size of the Page being printed to. If true, bOnTop is ignored. The default is false.
nRotation | (optional) The number of degrees to rotate the watermark counterclockwise. The default is 0.
nOpacity | (optional) The opacity to be used for the watermark, where 0 is transparent and 1.0 is opaque. The default is 1.0
Precondition
Doc must be opened.
Availability:
Phantom
example 1:
Adds “Confidential” as a watermark to the center of all pages of the current Doc.
this.addWatermarkFromText("Confidential", 0, font.Helv, 23, color.red);
example 2:
//Adds a multiline watermark to each Page of the current Doc 1 inch down and 1 inch over from the upper-right
//corner.
this.addWatermarkFromText({
cText: "Confidential Doc\rA. C. Robat",
nTextAlign: app.constants.align.right,
nHorizAlign: app.constants.align.right,
nVertAlign: app.constants.align.top});

◆ addWatermarkFromFile()

FX_BOOL Doc::addWatermarkFromFile ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cDIPath | The device-independent path of the source file to use for the watermark. File Type : pdf/bmp.dib/jpg/jpeg/jpe/gif/png/tif/tiff

| nSourcePage |(optional) The 0-based index of the Page in the source file to be used as
thewatermark. The default is 0 | nStart |(optional) The 0-based index of the first Page in the range of pages to which
the watermark should be added. If nStart and nEnd are not specified, the range of
pages is for all pages in the Doc. If only nStart is specified, the range of
pages is the single Page specified by nStart. If only nEnd is specified, the range of
pages is 0 to nEnd. | nEnd |(optional) The last Page in the range of pages to which the watermark should be
added. See nStart for details | bOnTop |(optional) A Boolean value specifying the z-ordering of the watermark. If true (the
default), the watermark is added above all other Page content. If false, the
watermark is added below all other Page content. This parameter is ignored if
bFixedPrint is true. | bOnScreen |(optional) A Boolean value to indicate whether the watermark should be displayed
when viewing the Doc on screen. The default is true. | bOnPrint |(optional) A Boolean value to indicate whether the watermark should be displayed
when printing the Doc. The default is true | nHorizAlign |(optional) A number indicating how the watermark should be aligned horizontally.\nSee app.constants.align for possible values. The default is
app.constants.align.center.
| nVertAlign |(optional) A number indicating how the watermark should be aligned vertically. See
app.constants.align for possible values. The default is
app.constants.align.center.
|nHorizValue |(optional) A number used to shift the horizontal position of the watermark on the
Page. If bPercentage is true, this number represents a percentage of the
horizontal Page size. If bPercentage is false, this number represents the number
of points to be offset. The default is 0. |nVertValue |(optional) A number used to shift the vertical position of the watermark on the
Page. If bPercentage is true, this number represents a percentage of the vertical
Page size. If bPercentage is false, this number represents the number of points
to be offset. The default is 0. |bPercentage |(optional) A Boolean value that indicates whether nHorizValue and nVertValue
represent a percentage of the Page size or an explicit number of points. The default
is false. | nScale |(optional) The scale to be used for the watermark, where 1.0 is 100%. A value of -1
specifies that the watermark should fit to the Page while maintaining its
proportions. The default is 1.0.
| bFixedPrint |(optional) A Boolean value that indicates that this watermark should be added as a
FixedPrint Watermark annotation. This allows watermarks to be printed at a fixed
size/position regardless of the size of the Page being printed to. If true, bOnTop is
ignored. The default is false. |nRotation |(optional) The number of degrees to rotate the watermark counterclockwise. The
default is 0. | nOpacity |(optional) The opacity to be used for the watermark, where 0 is transparent and 1.0
is opaque. The default is 1.0

Precondition
Doc must be opened.
Availability:
Phantom
example 1:
//Adds the first Page of watermark.pdf as a watermark to the center of all pages of the current Doc.
this.addWatermarkFromFile("/C/temp/watermark.pdf");
example 2:
//Adds the second Page of watermark.pdf as a watermark to the first 10 pages of the current Doc. The watermark
//is rotated counterclockwise 45 degrees and positioned 1 inch down and 2 inches over from the upper-left corner of the
//Page.
this.addWatermarkFromFile({
cDIPath: "/C/temp/watermark.pdf",
nSourcePage: 4, nEnd: 9,
nHorizAlign: 0,
nVertAlign: 0,
nHorizValue: 144,
nRotation: 45
});

◆ flattenPages()

FX_BOOL Doc::flattenPages ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nStart | (optional) A 0-based index that defines the start of an inclusive range of pages in the current Doc. If only nStart is specified, the Page range is the single Page specified by nStart.
nEnd | (optional) (optional) A 0-based index that defines the end of an inclusive range of pages in the current Doc.
Precondition
Doc must be opened.
Availability:
Phantom
example 1:
//Flatten all pages in the Doc.
this.flattenPages();

◆ setPageTransitions()

FX_BOOL Doc::setPageTransitions ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
nStart (optional) A 0-based index that defines the start of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on all pages in the Doc.
If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd (optional) A 0-based index that defines the end of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on all pages in the Doc.
If only nEnd is specified, the range of pages is 0 to nEnd.
aTrans (optional) The page transition array consists of three values:
[nDuration, cTransition, nTransDuration].
● nDuration is the maximum amount of time the page is displayed before the viewer automatically turns to the next page. Set to -1 to turn off automatic page turning.
● cTransition is the name of the transition to apply to the page. See fullScreen.transitions for a list of valid transitions.
● nTransDuration is the duration (in seconds) of the transition effect.If aTrans is not present, any page transitions for the pages are removed.
Precondition
Doc must be opened.
Availability:
Phantom
example:
// Put the Doc into full screen mode and apply some transitions:
this.setPageTransitions({ aTrans: [-1, "Random", 1] } );
app.fs.isFullScreen=true;

◆ getPageTransition()

FX_BOOL Doc::getPageTransition ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) A 0-based index that defines the start of an inclusive range of pages in the Doc to be operated on.
Precondition
Doc must be opened.
Availability:
Phantom Returns:
An array of three values: [ nDuration, cTransition, nTransDuration ].
● nDuration is the maximum amount of time the Page is displayed before the viewer automatically turns to the next
Page. A duration of -1 indicates that there is no automatic Page turning.
● cTransition is the name of the transition to apply to the Page. See the property app.fs.transitions for a list
of valid transitions.
● cTransDuration is the duration (in seconds) of the transition effect.

◆ movePage()

FX_BOOL Doc::movePage ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | (optional) The 0-based index of the Page to move. The default is 0.
nAfter (optional) The 0-based index of the Page after which to move the specified Page.
Use -1 to move the Page before the first Page of the Doc. The default is the last Page in the Doc.
Precondition
Doc must be opened.
Availability:
Phantom
example:
//Reverse the pages in the Doc.
for (i = this.numPages - 1; i >= 0; i--) this.movePage(i);

◆ newPage()

FX_BOOL Doc::newPage ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage (optional) The Page after which to add the new Page in a 1-based Page numbering system.
The default is the last Page of the Doc. Use 0 to add a Page before the first Page. An invalid Page range is truncated to the valid range of pages.
nWidth | (optional) The width of the Page in points. The default value is 612.
nHeight | (optional) The height of the Page in points. The default value is 792.
Precondition
Doc must be opened.
Availability:
Phantom
example:
//Add a new Page to match the Page size of the doc.
var Rect = this.getPageBox("Crop");
this.newPage(0, Rect[2], Rect[1]);

◆ setPageRotations()

FX_BOOL Doc::setPageRotations ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nStart (optional) A 0-based index that defines the start of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on allpages in the Doc. If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd (optional) A 0-based index that defines the end of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on all pages in the Doc. If only nEnd is specified, the range of pages is 0 to nEnd.
nRotate | (optional) The amount of rotation that should be applied to the target pages. Can be 0, 90, 180, or 270. The default is 0.
Precondition
Doc must be opened.
Availability:
Phantom
example:
//Rotate pages 0 through 10 of the current Doc.
this.setPageRotations(0, 10, 90);

◆ setPageBoxes()

FX_BOOL Doc::setPageBoxes ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
cBox (optional) The box type value, one of:
Art
Bleed
Crop
Media
Trim
Note that the BBox box type is read-only and only supported in getPageBox. For definitions of these boxes, see the PDF Reference.
nStart (optional) A 0-based index that defines the start of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on all pages in the Doc.
If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd (optional) A 0-based index that defines the end of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on all pages in the Doc.
rBox | (optional) An array of four numbers in rotated user space to which to set the specified box. If not provided, the specified box is removed.
Precondition
Doc must be opened.
Availability:
Phantom
example:
this.setPageBoxes("Crop",2,2,[0,300,300,0]);
var aRect3 = this.getPageBox("Crop",2);
console.println(aRect3);

◆ addWeblinks()

FX_BOOL Doc::addWeblinks ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nStart | (optional) A 0-based index that defines the start of an inclusive range of pages. If nStart and nEnd are not specified, the range of pages is for all pages in the Doc. If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd (optional) A 0-based index that defines the end of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on all pages in the Doc. If only nEnd is specified, the range of pages is 0 to nEnd.
Precondition
Doc must be opened.
Availability:
Phantom Returns:
The number of web links added to the Doc.
example:
var numWeblinks = this.addWeblinks();
console.println("There were " + numWeblinks +
" instances of text that looked like a web address,"
+ " and converted as such.");

◆ removeWeblinks()

FX_BOOL Doc::removeWeblinks ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nStart | (optional) A 0-based index that defines the start of an inclusive range of pages. If nStart and nEnd are not specified, the range of pages is for all pages in the Doc. If only nStart is specified, the range of pages is the single Page specified by nStart.
nEnd (optional) A 0-based index that defines the end of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on all pages in the Doc. If only nEnd is specified, the range of pages is 0 to nEnd.
Precondition
Doc must be opened.
Availability:
Phantom Returns:
The number of web links removed from the Doc.
example:
//Remove all web links from the Doc and report results to the console window.
var numWeblinks = this.removeWeblinks();
console.println("There were " + numWeblinks + " web links removed from the Doc.");

◆ removeLinks()

FX_BOOL Doc::removeLinks ( OBJ_METHOD_PARAMS )
Parameters
parameter | instruction
nPage | The 0-based index of the Page from which to remove links.
oCoords (optional) A 0-based index that defines the end of an inclusive range of pages in the Doc to be operated on.
If nStart and nEnd are not specified, operates on all pages in the Doc. If only nEnd is specified, the range of pages is 0 to nEnd.
Precondition
Doc must be opened.
Availability:
Phantom Returns:
The number of web links removed from the Doc.
example:
// Remove all links from the document
for ( var a = 0; a < this.numPages; a++ )
{
var b = this.getPageBox("Crop", a);
this.removeLinks(a,b);
}

◆ getOCGOrder()

FX_BOOL Doc::getOCGOrder ( OBJ_METHOD_PARAMS )
Precondition
Doc must be opened.
Availability:
Phantom Returns:
An array containing OCG objects, strings, and similar subarrays, or null if no OCGs are present.
See setOCGOrder for a description of the order array.
example:
var ocgOrder = this.getOCGOrder();
console.println("Currrent OCG order --" + ocgOrder);

◆ setOCGOrder()

FX_BOOL Doc::setOCGOrder ( OBJ_METHOD_PARAMS )
Precondition
Doc must be opened.
Availability:
Phantom
example:
var ocgOrder = this.getOCGOrder();
var newOrder = new Array();
for (var j=0; j < ocgOrder.length; j++)
newOrder[j] = ocgOrder[ocgOrder.length-j-1];
this.setOCGOrder(newOrder);


Javascript API: Field Class Reference

Public Member Functions | List of all members
Field Class Reference

This object represents an form field (that is, a field created using the form tool or the Doc addField method). In the same manner that a form author can modify an existing field’s properties, such as the border color or font, the JavaScript user can use the Field object to perform the same modifications.

Public Member Functions

FX_BOOL | alignment (OBJ_PROP_PARAMS)
Controls how the text is laid out within the text field. Values are left center right. More...
FX_BOOL | borderStyle (OBJ_PROP_PARAMS)
The border style for a field. Valid border styles are solid dashed beveled inset underline The border style determines how the border for the rectangle is drawn. The border object is a static convenience constant that defines all the border styles of a field, as shown in the following table: More...
FX_BOOL | buttonFitBounds (OBJ_PROP_PARAMS)
If true, the extent to which the icon may be scaled is set to the bounds of the button field. The additional icon placement properties are still used to scale and position the icon within the button face. More...
FX_BOOL | buttonPosition (OBJ_PROP_PARAMS)
Controls how the text and the icon of the button are positioned with respect to each other within the button face. The convenience position object defines all of the valid alternatives. More...
FX_BOOL | buttonScaleHow (OBJ_PROP_PARAMS)
Controls how the icon is scaled (if necessary) to fit inside the button face. The convenience scaleHow object defines all of the valid alternatives: More...
FX_BOOL | buttonScaleWhen (OBJ_PROP_PARAMS)
Controls when an icon is scaled to fit inside the button face. The convenience scaleWhen object defines all of the valid alternatives: More...
FX_BOOL | calcOrderIndex (OBJ_PROP_PARAMS)
Changes the calculation order of fields in the document. When a computable text or combo box field is added to a document, the field's name is appended to the calculation order array. The calculation order array determines in what order the fields are calculated. The calcOrderIndex property works similarly to the Calculate tab used by the Form tool. More...
FX_BOOL | charLimit (OBJ_PROP_PARAMS)
Limits the number of characters that a user can type into a text field. See event.fieldFull to detect when the maximum number of characters is reached. More...
FX_BOOL | comb (OBJ_PROP_PARAMS)
If set to true, the field background is drawn as series of boxes (one for each character in the value of the field) and each character of the content is drawn within those boxes. The number of boxes drawn is determined from the charLimit property. It applies only to text fields. The setter will also raise if any of the following field properties are also set multiline, password, and fileSelect. A side-effect of setting this property is that the doNotScroll property is also set. More...
FX_BOOL | commitOnSelChange (OBJ_PROP_PARAMS)
Controls whether a field value is committed after a selection change: More...
FX_BOOL | currentValueIndices (OBJ_PROP_PARAMS)
Reads and writes single or multiple values of a list box or combo box. More...
FX_BOOL | defaultStyle (OBJ_PROP_PARAMS)
This property defines the default style attributes for the form field. If the user clicks an empty field and begins entering text without changing properties using the property toolbar, these are the properties that will be used. This property is a single Span object without a text property. Some of the properties in the default style span mirror the properties of the Field object. Changing these properties also modifies the defaultStyle property for the field and vice versa. The following table details the properties of the Field object that are also in the default style and any differences between their values. More...
FX_BOOL | defaultValue (OBJ_PROP_PARAMS)
The default value of a field ——that is, the value that the field is set to when the form is reset. For combo boxes and list boxes, either an export or a user value can be used to set the default. A conflict can occur, for example, when the field has an export value and a user value with the same value but these apply to different items in the list. In such cases, the export value is matched against first. More...
FX_BOOL | doNotScroll (OBJ_PROP_PARAMS)
If true, the text field does not scroll and the user, therefore, is limited by the rectangular region designed for the field. Setting this property to true or false corresponds to checking or unchecking the Scroll Long Text field in the Options tab of the field. More...
FX_BOOL | doNotSpellCheck (OBJ_PROP_PARAMS)
If true, spell checking is not performed on this editable text field. Setting this property to true or false corresponds to unchecking or checking the Check Spelling attribute in the Options tab of the Field Properties dialog box. More...
FX_BOOL | delay (OBJ_PROP_PARAMS)
Delays the redrawing of a field's appearance. It is generally used to buffer a series of changes to the properties of the field before requesting that the field regenerate its appearance. Setting the property to true forces the field to wait until delay is set to false. The update of its appearance then takes place, redrawing the field with its latest settings. There is a corresponding Doc delay flag if changes are being made to many fields at once. More...
FX_BOOL | display (OBJ_PROP_PARAMS)
Controls whether the field is hidden or visible on screen and in print. The values for the display property are listed in the table below. This property supersedes the older hidden and print properties. More...
FX_BOOL | doc (OBJ_PROP_PARAMS)
Returns the Doc of the document to which the field belongs. More...
FX_BOOL | editable (OBJ_PROP_PARAMS)
Controls whether a combo box is editable. If true, the user can type in a selection. If false, the user must choose one of the provided selections. More...
FX_BOOL | exportValues (OBJ_PROP_PARAMS)
An array of strings representing the export values for the field. The array has as many elements as there are annotations in the field. The elements are mapped to the annotations in the order of creation (unaffected by tab-order). For radio button fields, this property is required to make the field work properly as a group. The button that is checked at any time gives its value to the field as a whole. For check box fields, unless an export value is specified, "Yes" (or the corresponding localized string) is the default when the field is checked. "Off" is the default when the field is unchecked (the same as for a radio button field when none of its buttons are checked). More...
FX_BOOL | fileSelect (OBJ_PROP_PARAMS)
If true, sets the file-select flag in the Options tab of the text field (Field is Used for File Selection). This indicates that the value of the field represents a path of a file whose contents may be submitted with the form. The path may be entered directly into the field by the user, or the user can browse for the file. (See the browseForFileToSubmit method.) Note:The file select flag is mutually exclusive with the multiline, charLimit, password, and defaultValue properties. Also, on the Mac OS platform, when setting the file select flag, the field gets treated as read-only. Therefore, the user must browse for the file to enter into the field. (See browseForFileToSubmit.) This property can only be set during a batch or console event. See Privileged versus non-privileged context for details. The event object contains a discussion of JavaScript events. More...
FX_BOOL | fillColor (OBJ_PROP_PARAMS)
Specifies the background color for a field. The background color is used to fill the rectangle of the field. Values are defined by using transparent, gray, RGB or CMYK color. See Color arrays for information on defining color arrays and how values are used with this property. In older versions of this specification, this property was named bgColor. The use of bgColor is now discouraged, although it is still valid for backward compatibility. More...
FX_BOOL | hidden (OBJ_PROP_PARAMS)
Note:This property has been superseded by the display property and its use is discouraged. If the value is false, the field is visible to the user; if true, the field is invisible. The default value is false. More...
FX_BOOL | highlight (OBJ_PROP_PARAMS)
Defines how a button reacts when a user clicks it. The four highlight modes supported are: none —— No visual indication that the button has been clicked. invert —— The region encompassing the button's rectangle inverts momentarily. push —— The down face for the button (if any) is displayed momentarily. outline —— The border of the rectangleinverts momentarily. The convenience highlight object defines each state, as follows: More...
FX_BOOL | lineWidth (OBJ_PROP_PARAMS)
Specifies the thickness of the border when stroking the perimeter of a field's rectangle. If the stroke color is transparent, this parameter has no effect except in the case of a beveled border. Values are: 0 —— none 1 —— thin 2 —— medium 3 —— thick In older versions of this specification, this property was borderWidth. The use of borderWidth is now discouraged, although it is still valid for backward compatibility. The default value for lineWidth is 1 (thin). Any integer value can be used; however, values beyond 5 may distort the field's appearance. More...
FX_BOOL | multiline (OBJ_PROP_PARAMS)
Controls how text is wrapped within the field. If false (the default), the text field can be a single line only. If true, multiple lines are allowed and they wrap to field boundaries. More...
FX_BOOL | multipleSelection (OBJ_PROP_PARAMS)
If true, indicates that a list box allows a multiple selection of items. See also type, value, and currentValueIndices. More...
FX_BOOL | name (OBJ_PROP_PARAMS)
This property returns the fully qualified field name of the field as a string object. if the Field object represents one individual widget, the returned name includes an appended '.' followed by the widget index. More...
FX_BOOL | numItems (OBJ_PROP_PARAMS)
The number of items in a combo box or list box. More...
FX_BOOL | page (OBJ_PROP_PARAMS)
The page number or an array of page numbers of a field. If the field has only one appearance in the document, the page property returns an integer representing the 0-based page number of the page on which the field appears. If the field has multiple appearances, it returns an array of integers, each member of which is a 0-based page number of an appearance of the field. The order in which the page numbers appear in the array is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order). If an appearance of the field is on a hidden template page, page returns a value of -1 for that appearance. More...
FX_BOOL | password (OBJ_PROP_PARAMS)
Specifies whether the field should display asterisks when data is entered in the field. (Upon submission, the actual data entered is sent.) If this property is true, data in the field is not saved when the document is saved to disk. More...
FX_BOOL | print (OBJ_PROP_PARAMS)
Note:This property has been superseded by the display property and its use is discouraged. If true, the field appears when the user prints the document. If false, the field does not appear when printing. This property can be used to hide control buttons and other fields that are not useful on the printed page. More...
FX_BOOL | radiosInUnison (OBJ_PROP_PARAMS)
If false, even if a group of radio buttons have the same name and export value, they behave in a mutually exclusive fashion, like HTML radio buttons. The default for new radio buttons is false. If true, if a group of radio buttons have the same name and export value, they turn on and off in unison. More...
FX_BOOL | readonly (OBJ_PROP_PARAMS)
The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. More...
FX_BOOL | rect (OBJ_PROP_PARAMS)
An array of four numbers in rotated user space that specify the size and placement of the form field. These four numbers are the coordinates of the bounding rectangle and are listed in the following order: upper-left x, upper-left y, lower-right x and lower-right y. Note:The Annotation object also has a rect property. However, the coordinates are not in rotated user space and they are in a different order than in the Field object rect property. More...
FX_BOOL | required (OBJ_PROP_PARAMS)
Specifies whether a field requires a value. If true, the fiel's value must be non-null when the user clicks a submit button that causes the value of the field to be posted. If the field value is null, the user receives a warning message and the submit does not occur. More...
FX_BOOL | richText (OBJ_PROP_PARAMS)
If true, the field allows rich text formatting. The default is false. More...
FX_BOOL | richValue (OBJ_PROP_PARAMS)
This property specifies the text contents and formatting of a rich text field. For field types other than rich text, this property is undefined. The rich text contents are represented as an array of Span objects containing the text contents and formatting of the field. More...
FX_BOOL | rotation (OBJ_PROP_PARAMS)
The rotation of a widget in counterclockwise increments. Valid values are 0, 90, 180, and 270. More...
FX_BOOL | strokeColor (OBJ_PROP_PARAMS)
Specifies the stroke color for a field that is used to stroke the rectangle of the field with a line as large as the line width. Values are defined by using transparent, gray, RGB or CMYK color. See Color arrays for information on defining color arrays and how values are used with this property. In older versions of this specification, this property was borderColor. The use of borderColor is now discouraged, although it is still valid for backward compatibility. More...
FX_BOOL | style (OBJ_PROP_PARAMS)
Allows the user to set the glyph style of a check box or radio button. The glyph style is the graphic used to indicate that the item has been selected. The style values are associated with keywords as follows. More...
FX_BOOL | submitName (OBJ_PROP_PARAMS)
If nonempty, used during form submission instead of name. Only applicable if submitting in HTML format (that is, URL-encoded). More...
FX_BOOL | textColor (OBJ_PROP_PARAMS)
The foreground color of a field. It represents the text color for text, button, or list box fields and the check color for check box or radio button fields. Values are defined the same as the fillColor. See Color arrays for information on defining color arrays and how values are set and used with this property. In older versions of this specification, this property was fgColor. The use of fgColor is now discouraged, although it is still valid for backward compatibility. Note:An exception is thrown if a transparent color space is used to set textColor. More...
FX_BOOL | textFont (OBJ_PROP_PARAMS)
The font that is used when laying out text in a text field, combo box, list box or button. Valid fonts are defined as properties of the font object. More...
FX_BOOL | textSize (OBJ_PROP_PARAMS)
Specifies the text size (in points) to be used in all controls. In check box and radio button fields, the text size determines the size of the check. Valid text sizes range from 0 to 32767, inclusive. A value of zero means the largest point size that allows all text data to fit in the field's rectangle. More...
FX_BOOL | type (OBJ_PROP_PARAMS)
Returns the type of the field as a string. Valid types are: button checkbox combobox listbox radiobutton signature text. More...
FX_BOOL | userName (OBJ_PROP_PARAMS)
The user name (short description string) of the field. It is intended to be used as tooltip text whenever the cursor enters a field. It can also be used as a user-friendly name, instead of the field name, when generating error messages. More...
FX_BOOL | value (OBJ_PROP_PARAMS)
The value of the field data that the user has entered. Depending on the type of the field, may be a String, Date, or Number. Typically, the value is used to create calculated fields. More...
FX_BOOL | valueAsString (OBJ_PROP_PARAMS)
Returns the value of a field as a JavaScript string. It differs from value, which attempts to convert the contents of a field contents to an accepted format. For example, for a field with a value of "020", value returns the integer 20, while valueAsString returns the string "020". More...
FX_BOOL | browseForFileToSubmit (OBJ_METHOD_PARAMS)
If invoked on a text field for which the fileSelect flag is set (checked), opens a standard file-selection dialog box. The path entered through the dialog box is automatically assigned as the value of the text field. If invoked on a text field in which the fileSelect flag is clear (unchecked), an exception is thrown. More...
FX_BOOL | buttonGetCaption (OBJ_METHOD_PARAMS)
Gets the caption associated with a button. Use buttonSetCaption to set the caption. More...
FX_BOOL | buttonGetIcon (OBJ_METHOD_PARAMS)
Gets the Icon object of a specified type associated with a button. See also the buttonSetIcon method for assigning an icon to a button. More...
FX_BOOL | buttonSetCaption (OBJ_METHOD_PARAMS)
Sets the caption associated with a button. Use buttonGetCaption to get the current caption. See buttonAlignX, buttonAlignY, buttonFitBounds, buttonPosition, buttonScaleHow, and buttonScaleWhen for details on how the icon and caption are placed on the button face. More...
FX_BOOL | buttonSetIcon (OBJ_METHOD_PARAMS)
Sets the icon associated with a button. See buttonAlignX, buttonAlignY, buttonFitBounds, buttonPosition, buttonScaleHow, and buttonScaleWhen for details on how the icon and caption are placed on the button face. Use either buttonGetIcon or doc.getIcon to get an Icon object that can be used for the oIcon parameter of this method. Note:This method must be executed from script embedded within the document. Executing script containing buttonSetIcon in the console of the phantom, for example, will throw a NotAllowedError exception. More...
FX_BOOL | checkThisBox (OBJ_METHOD_PARAMS)
Checks or unchecks the specified widget. Only check boxes can be unchecked. A radio button cannot be unchecked using this method, but if its default state is unchecked (see defaultIsChecked) it can be reset to the unchecked state using the resetForm. method of the Doc. Note:For a set of radio buttons that do not have duplicate export values, you can set the value to the export value of the individual widget that should be checked (or pass an empty string if none should be). More...
FX_BOOL | clearItems (OBJ_METHOD_PARAMS)
Clears all the values in a list box or combo box. Related methods and properties include numItems, getItemAt, deleteItemAt, currentValueIndices, insertItemAt and setItems. More...
FX_BOOL | defaultIsChecked (OBJ_METHOD_PARAMS)
Sets the specified widget to be checked or unchecked by default. Note:For a set of radio buttons that do not have duplicate export values, you can set the defaultValue to the export value of the individual widget that should be checked by default (or pass an empty string if none should be checked). More...
FX_BOOL | deleteItemAt (OBJ_METHOD_PARAMS)
Deletes an item in a combo box or a list box. For a list box, if the current selection is deleted, the field no longer has a current selection. If this method is invoked again on the same field and no parameter is specified, unexpected behavior can result because there is no current selection to delete. Therefore, it is important to make a new selection (such as by using the currentValueIndices method) for the method to behave as documented. More...
FX_BOOL | getArray (OBJ_METHOD_PARAMS)
Gets the array of terminal child fields (that is, fields that can have a value) for this Field object, the parent field. More...
FX_BOOL | getItemAt (OBJ_METHOD_PARAMS)
Gets the internal value of an item in a combo box or a list box. The number of items in a list can be obtained from numItems. See also insertItemAt, deleteItemAt, clearItems, currentValueIndices and setItems. More...
FX_BOOL | getLock (OBJ_METHOD_PARAMS)
Gets a Lock object, a generic object that contains the lock properties of a signature field. See also setLock. More...
FX_BOOL | insertItemAt (OBJ_METHOD_PARAMS)
Inserts a new item into a combo box or a list box. Related methods and properties include numItems, getItemAt, deleteItemAt, clearItems, currentValueIndices and setItems. More...
FX_BOOL | isBoxChecked (OBJ_METHOD_PARAMS)
Determines whether the specified widget is checked. Note:For a set of radio buttons that do not have duplicate export values, you can get the value, which is equal to the export value of the individual widget that is currently checked (or returns an empty string, if none is). More...
FX_BOOL | isDefaultChecked (OBJ_METHOD_PARAMS)
Determines whether the specified widget is checked by default (for example, when the field gets reset). Note:For a set of radio buttons that do not have duplicate export values, you can get the defaultValue, which is equal to the export value of the individual widget that is checked by default (or returns an empty string, if none is). More...
FX_BOOL | setAction (OBJ_METHOD_PARAMS)
Sets the JavaScript action of the field for a given trigger. Related methods are the Bookmark object setAction method and the Doc methods setAction, addScript, and setPageAction. Note:This method will overwrite any action already defined for the chosen trigger. More...
FX_BOOL | setFocus (OBJ_METHOD_PARAMS)
Sets the keyboard focus to this field. This can involve changing the page that the user is currently on or causing the view to scroll to a new position in the document. This method brings the document in which the field resides to the front, if it is not already there. See also bringToFront. More...
FX_BOOL | setItems (OBJ_METHOD_PARAMS)
Sets the list of items for a combo box or a list box. Related methods and properties include numItems, getItemAt, deleteItemAt, currentValueIndices and clearItems. More...
FX_BOOL | setLock (OBJ_METHOD_PARAMS)
Controls which fields are to be locked when a signature is applied to this signature field. No modifications can be made to locked fields. If the signature is cleared, all fields that were locked become unlocked. The property settings can be obtained using getLock. Note:The method can be executed during a batch, application initialization, or console event. See Privileged versus non-privileged context for details. This method cannot be applied to a field that is in a document that is already signed. More...
FX_BOOL | signatureGetModifications (OBJ_METHOD_PARAMS)
Returns an object containing information on modifications that have been made to the document after the signature field was signed. The information includes only the difference between the current and signed state of the document. Transient objects, such as objects added after the signature but then subsequently deleted, are not reported. More...
FX_BOOL | signatureGetSeedValue (OBJ_METHOD_PARAMS)
Returns a SeedValue object that contains the seed value properties of a signature field. Seed values are used to control properties of the signature, including the signature appearance, reasons for signing, and the person. See signatureSetSeedValue. More...
FX_BOOL | signatureInfo (OBJ_METHOD_PARAMS)
Returns a SignatureInfo object that contains the properties of the signature. The object is a snapshot of the signature at the time that this method is called. A security handler may specify additional properties that are specific to the security handler. Note:There are no restrictions on when this method can be called. However, the specified security handler, oSig, may not always be available. See the security.getHandler method for details. Some properties of a signature handler, for example, certificates (a property of the SignatureInfo object), may return a null value until the signature is validated. Therefore, signatureInfo should be called again after signatureValidate. More...
FX_BOOL | signatureSetSeedValue (OBJ_METHOD_PARAMS)
Sets properties that are used when signing signature fields. The properties are stored in the signature field and are not altered when the field is signed, the signature is cleared, or when resetForm is called. Use signatureGetSeedValue to obtain the property settings. When setting seed values, keep in mind the following: Note:The method can be executed during a batch, application initialization or console event. See Privileged versus non-privileged context for details. Certifying signatures are signatures with a SignatureInfo object mdp property value of allowNone, default, or defaultAndComments. Not allowed in phantom Reader. Refer to the Security Feature User Reference to obtain a deeper understanding of the use of signature seed values. More...
FX_BOOL | signatureSign (OBJ_METHOD_PARAMS)
Signs the field with the specified security handler. See also security.getHandler and securityHandler.login. Note:This method can only be executed during a batch, console, or application initialization event. See Privileged versus non-privileged context for details. The event object contains a discussion of JavaScript events. Signature fields cannot be signed if they are already signed. Use resetForm to clear signature fields. More...
FX_BOOL | signatureValidate (OBJ_METHOD_PARAMS)
Validates and returns the validity status of the signature in a signature field. This routine can be computationally expensive and take a significant amount of time depending on the signature handler used to sign the signature. Note:There are no restrictions on when this method can be called. However, the parameter oSig is not always available. See security.getHandler for details. More...

Member Function Documentation

◆ alignment()

FX_BOOL Field::alignment ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Fields
text
Example
var f = this.getField("Text Field0");
f.alignment = "center";

◆ borderStyle()

FX_BOOL Field::borderStyle ( OBJ_PROP_PARAMS )
Type | Keyword | Description
solid | border.s | Strokes the entire perimeter of the rectangle with a solid line.
beveled | border.b | Equivalent to the solid style with an additional beveled (pushed-out appearance) border applied inside the solid border.
dashed | border.d | Strokes the perimeter with a dashed line. inset border.i Equivalent to the solid style with an additional inset (pushed-in appearance) border applied inside the solid border.
underline | border.u | Strokes the bottom portion of the rectangle’s perimeter.
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Fields
All
Example
The following example shows how to set the border style of a field to solid:
var f = this.getField("Text Field0");
f.borderStyle = border.d; //border.s evaluates to "solid"

◆ buttonFitBounds()

FX_BOOL Field::buttonFitBounds ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
button
Example
var a = this.getField("Push Button0");
a.buttonFitBounds = true;
console.println(a.buttonFitBounds);
a.buttonFitBounds = false;
console.println(a.buttonFitBounds);

◆ buttonPosition()

FX_BOOL Field::buttonPosition ( OBJ_PROP_PARAMS )
Icon/text | placement Keyword
Text Only | position.textOnly
Icon Only | position.iconOnly
Icon top, Text bottom | position.iconTextV
Text top, Icon bottom | position.textIconV
Icon left, Text right | position.iconTextH
Text left, Icon right | position.textIconH
Text in Icon (overlaid) | position.overlay
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Fields
button
Example
var f = this.getField("Push Button0");
console.println(f.buttonPosition);
f.buttonPosition = position.iconOnly;
console.println(f.buttonPosition);

◆ buttonScaleHow()

FX_BOOL Field::buttonScaleHow ( OBJ_PROP_PARAMS )
How is icon scaled | Keyword
Proportionally | scaleHow.proportional
Non-proportionally | scaleHow.anamorphic
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Fields
button
Example
var f1 = this.getField("Push Button0");
console.println(f1.buttonScaleHow);
f1.buttonScaleHow = scaleHow.anamorphic;
console.println(f1.buttonScaleHow);

◆ buttonScaleWhen()

FX_BOOL Field::buttonScaleWhen ( OBJ_PROP_PARAMS )
When is icon scaled | Keyword
Always | scaleWhen.always
Never | scaleWhen.never
If icon is too big | scaleWhen.tooBig
If icon is too small | scaleWhen.tooSmall
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Fields
button
Example
var f1 = this.getField("Push Button0");
console.println(f1.buttonScaleWhen);
f1.buttonScaleWhen = scaleWhen.never;
console.println(f1.buttonScaleWhen);

◆ calcOrderIndex()

FX_BOOL Field::calcOrderIndex ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Fields
combobox, text
Example
var a = this.getField("newItem");
var b = this.getField("oldItem");
a.calcOrderIndex = b.calcOrderIndex + 1;
In this example, the "newItem" field was added after the "oldItem" field. The script changes the calcOrderIndex property of the "newItem" field so that it is calculated before the "oldItem" field.

◆ charLimit()

FX_BOOL Field::charLimit ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Fields
text
Example
Set a limit on the number of characters that can be typed into a field.
var f = this.getField("Text Field0");
f.charLimit = 10;

◆ comb()

FX_BOOL Field::comb ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
text
Example
function Field_comb()
{
var c1=this.addField("text4-0","text",0,[50,785-11*25, 400, 765-11*25]);
var c2=this.addField("text4-1","text",0,[50,785-12*25, 400, 765-12*25]);
c1.strokeColor = color.black;
c2.strokeColor = color.black;
c1.comb=true;
c1.charLimit = 12;
c2.comb=false;
c1.value="comb is true";
c2.value="comb is false";
}
Field_comb();

◆ commitOnSelChange()

FX_BOOL Field::commitOnSelChange ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
combobox, listbox
Example
var a = this.getField("Combo Box0");
console.println(a.commitOnSelChange);
a.commitOnSelChange = true;
console.println(a.commitOnSelChange);

◆ currentValueIndices()

FX_BOOL Field::currentValueIndices ( OBJ_PROP_PARAMS )
Read
Returns the options-array indices of the strings that are the value of a list box or combo box field. These indices are 0-based. If the value of the field is a single string, it returns an integer. Otherwise, it returns an array of integers sorted in ascending order. If the current value of the field is not a member of the set of offered choices (as could happen in the case of an editable combo box) it returns -1.
Write
Sets the value of a list box or combo box. It accepts a single integer or array of integers as an argument. To set a single string as the value, pass an integer that is the 0-based index of that string in the options array. Note that in the case of an editable combo box, if the desired value is not a member of the set of offered choices, you must set the value instead. Except for this case, currentValueIndices is the preferred way to set the value of a list box or combo box. To set a multiple selection for a list box that allows it, pass an array as argument to this property, containing the indices (sorted in ascending order) of those strings in the options array. If passed an array like this: Field.value=["item1", "item3"], it also selects the items. The ability for a list box to support multiple selections can be set through multipleSelection. Related methods and properties include numItems, getItemAt, insertItemAt, deleteItemAt and setItems.
Precondition
Document must be opened.
Type
Integer | Array
Access
R/W
Availability:
Phantom/Reader
Fields
combobox, listbox
Example (Read)
var f = this.getField("List Box0");
var a = f.currentValueIndices;
if (typeof a == "number") // A single selection
console.println("Selection: " + f.getItemAt(a, false));
else { // Multiple selections
console.println("Selection:");
for (var i = 0; i < a.length; i ++)
console.println(" " + f.getItemAt(a[i], false));
}
Example (Write)
var f = this.getField("List Box0");
f.currentValueIndices = 3;

◆ defaultStyle()

FX_BOOL Field::defaultStyle ( OBJ_PROP_PARAMS )
Field properties | defaultStyle(Span properties) | Description
alignment | alignment | The alignment property has the same values for both the default style and the Field object.
textFont | fontFamily fontStyle fontWeight | The value of this field property is a complete font name that represents the font family, weight, and style. In the default style property, each property is represented separately. If an exact match for the font properties specified in the default style cannot be found, a similar font will be used or synthesized.
textColor | textColor | The textColor property has the same values for both the default style and the Field object.
textSize | textSize | The textSize property has the same values for both the default style and the Field object.
Note:When a field is empty, defaultStyle is the style used for newly entered text. If a field already contains text when defaultStyle is changed, the text will not pick up any changes to defaultStyle. Newly entered text uses the attributes of the text it is inserted into (or specified with the toolbar).
When pasting rich text into a field, unspecified attributes in the pasted rich text are filled with those from defaultStyle.
Superscript and Subscript are ignored in defaultStyle.
Precondition
Document must be opened.
Type
Span object
Access
R/W
Availability:
Phantom/Reader
Fields
rich text
Example
Change the default style for a text field.
var style = this.getField("Text1").defaultStyle;
style.textColor = color.red;
style.textSize = 18;
// if Courier Std is not found, use a monospace font
style.fontFamily = ["Courier Std", "monospace" ];
this.getField("Text1").defaultStyle = style;

◆ defaultValue()

FX_BOOL Field::defaultValue ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Fields
all except button, signature
Example
var f = this.getField("Name");
f.defaultValue = "Enter your name here.";

◆ doNotScroll()

FX_BOOL Field::doNotScroll ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
text
Example
var a = this.getField("Text Field0");
console.println(a.doNotScroll);
a.doNotScroll =true;
console.println(a.doNotScroll);

◆ doNotSpellCheck()

FX_BOOL Field::doNotSpellCheck ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
combobox (editable), text
Example
var b = this.getField("Text Field0");
console.println(b.doNotSpellCheck);
b.doNotSpellCheck = true;
console.println(b.doNotSpellCheck);

◆ delay()

FX_BOOL Field::delay ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
Change the appearance of a check box. Set delay to true, makes changes, and sets delay to false.
// Get the myCheckBox field
var f = this.getField("myCheckBox");
// Set the delay and change the fields properties
// to beveled edge and medium thickness line.
f.delay = true;
f.borderStyle = border.b;
... // A number of other changes
f.strokeWidth = 2;
f.delay = false; // Force the changes now

◆ display()

FX_BOOL Field::display ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
// Set the display property
var f = getField("myField");
f.display = display.noPrint;
// Test whether field is hidden on screen and in print
if (f.display == display.hidden) console.println("hidden");

◆ doc()

FX_BOOL Field::doc ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
object
Access
R
Availability:
Phantom/Reader
Fields
all
Example
function Field_doc()
{
var f=this.addField("text5-0","text",0,[50,785-13*25, 400, 765-13*25]);
f.strokeColor = color.black;
var d=f.doc;
f.value="the document's author is:"+d.author;
}
Field_doc();

◆ editable()

FX_BOOL Field::editable ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
combobox
Example
var f = this.getField("Combo Box0");
console.println(f.editable);
f.editable = true;
console.println(f.editable);

◆ exportValues()

FX_BOOL Field::exportValues ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Fields
checkbox, radiobutton
Example
Create a radio button field and sets its export values.
var d = 40;
var f = this.addField("myRadio","radiobutton",0, [200, 510, 210, 500]);
this.addField("myRadio","radiobutton",0, [200+d, 510-d, 210+d, 500-d]);
this.addField("myRadio","radiobutton",0, [200, 510-2*d, 210, 500-2*d]);
this.addField("myRadio","radiobutton",0, [200-d, 510-d, 210-d, 500-d]);
f.strokeColor = color.black;
// Now give each radio field an export value
f.exportValues = ["North", "East", "South", "West"];

◆ fileSelect()

FX_BOOL Field::fileSelect ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
text

◆ fillColor()

FX_BOOL Field::fillColor ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
Change the background color of a text field. If the current color is red, it changes to blue, otherwise it changes to yellow.
var f = this.getField("Text Field0");
if (color.equal(f.fillColor, color.red))
f.fillColor = color.blue;
else
f.fillColor = color.yellow;

◆ hidden()

FX_BOOL Field::hidden ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
function Field_hidden()
{
var f1 = this.addField("text9-"+0,"text",0,[50,785-5*25, 400, 765-5*25]);
f1.strokeColor = color.black;
f1.hidden=true;
f1.value ="hidden is true";
var f2 = this.addField("text9-"+1,"text",0,[50,785-6*25, 400, 765-6*25]);
f2.strokeColor = color.black;
f2.hidden=false;
f2.value ="hidden is false";
}
Field_hidden();

◆ highlight()

FX_BOOL Field::highlight ( OBJ_PROP_PARAMS )
Type | Keyword
none | highlight.n
invert | highlight.i
push | highlight.p
outline | highlight.o
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Fields
button
Example
Set the highlight property of a button to "invert".
var f = this.getField("Push Button0");
f.highlight = highlight.i;

◆ lineWidth()

FX_BOOL Field::lineWidth ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
Change the border width of the Text Box to medium thickness
var f = this.getField("Text Field0")
f.strokeColor = color.black;
f.lineWidth = 2;

◆ multiline()

FX_BOOL Field::multiline ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
text
Example
function Field_multiline()
{
var f1 = this.addField("text10-"+0,"text",1,[50,785-7*25, 400, 765-7*25]);
f1.strokeColor = color.black;
f1.multiline=true;
f1.value ="multiline"+"\n"+"is true";
var f2 = this.addField("text10-"+1,"text",1,[50,785-8*25, 400, 765-8*25]);
f2.strokeColor = color.black;
f2.multiline=false;
f2.value ="multiline"+"\n"+"is false";
}
Field_multiline();

◆ multipleSelection()

FX_BOOL Field::multipleSelection ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
listbox
Example
function Field_multipleSelection()
{
var f1 = this.addField("listbox1-"+0,"listbox",0,[50,785-19*25, 400, 765-20*25]);
f1.strokeColor = color.black;
f1.setItems(["mult-one","mult-two","mult-three"]);
f1.multipleSelection = true;
var f2 = this.addField("listbox1-"+1,"listbox",0,[50,785-21*25, 400, 765-22*25]);
f2.strokeColor = color.black;
f2.setItems(["one","two","three"]);
f2.multipleSelection = false;
}
Field_multipleSelection();

◆ name()

FX_BOOL Field::name ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader
Fields
all
Example
Get a Field object and write the name of the field to the console.
var f = this.getField("Text Field0");
// Displays "myField" in the console window
console.println(f.name);

◆ numItems()

FX_BOOL Field::numItems ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer
Access
R
Availability:
Phantom/Reader
Fields
combobox, listbox
Example
Get the number of items in a list box.
var f = this.getField("List Box0");
console.println("There are " + f.numItems + " in this list box");
Face names and values of a combo box or list box can be accessed through the getItemAt method. See that method for an additional example of numItems.

◆ page()

FX_BOOL Field::page ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer | Array
Access
R
Availability:
Phantom/Reader
Fields
all
Example
function Field_page()
{
var f=this.addField("text14-0","text",2,[50,785-1*25, 400, 765-1*25]);
f.strokeColor = color.black;
f.value="Field page is:"+f.page;
}
Field_page();

◆ password()

FX_BOOL Field::password ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
text
Example
function Field_password()
{
var f1 = this.addField("text15-"+0,"text",0,[50,785-2*25, 400, 765-2*25]);
f1.strokeColor = color.black;
f1.password=true;
f1.value="password is true";
var f2 = this.addField("text15-"+1,"text",0,[50,785-3*25, 400, 765-3*25]);
f2.strokeColor = color.black;
f2.password=false;
f2.value="password is false";
}
Field_password();

◆ print()

FX_BOOL Field::print ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
function Field_print()
{
var f1 = this.addField("text16-"+0,"text",0,[50,785-4*25, 400, 765-4*25]);
f1.strokeColor = color.black;
f1.print=true;
f1.value="print is true";
var f2 = this.addField("text16-"+1,"text",0,[50,785-5*25, 400, 765-5*25]);
f2.strokeColor = color.black;
f2.print=false;
f2.value="print is false";
}
Field_print();

◆ radiosInUnison()

FX_BOOL Field::radiosInUnison ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
radiobutton
Example
var a = this.getField("Radio Button");
a.radiosInUnison = true;

◆ readonly()

FX_BOOL Field::readonly ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
Get a field and make it read-only.
var f = this.getField("Text Field0");
f.value = "You can't change this message!";
f.readonly = true;

◆ rect()

FX_BOOL Field::rect ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example 1
Lay out a 2-inch-wide text field just to the right of the field "Text Field0".
var f = this.getField("Text Field0"); // Get the Field object
var myRect = f.rect; // and get its rectangle
myRect[0] = f.rect[2]; // The ulx for new = lrx for old
myRect[2] += 2 * 72; // Move two inches for lry
f = this.addField("myNextText", "text", this.pageNum, myRect);
f.strokeColor = color.black;
Example 2
Move an existing button field 10 points to the right.
var b = this.getField("myButton");
var aRect = b.rect; // Make a copy of b.rect
aRect[0] += 10; // Increment first x coordinate by 10
aRect[2] += 10; // Increment second x coordinate by 10
b.rect = aRect; // Update the value of b.rect

◆ required()

FX_BOOL Field::required ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
all except button
Example
Make "Text Field0" into a required field.
var f = this.getField("Text Field0");
f.required = true;

◆ richText()

FX_BOOL Field::richText ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Fields
text
Example 1
Get a Field object and set it for rich text formatting.
var f = this.getField("Text Field0");
f.richText = true;
See Example 2 following richValue for a more complete example.
Example 2
Count the number of rich text fields in the document.
var count = 0;
for ( var i = 0; i < this.numFields; i++)
{
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if ( f.type == "text" && f.richText ) count++
}
console.println("There are a total of "+ count + " rich text fields.");

◆ richValue()

FX_BOOL Field::richValue ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array of Span objects
Access
R/W
Availability:
Phantom/Reader
Fields
rich text
Example 1
Turn all bold text into red underlined text.
var f = this.getField("Text Field0");
var spans = f.richValue;
for ( var i = 0; i < spans.length; i++ )
{
spans[i].textColor = color.red;
spans[i].underline = true;
}
f.richValue = spans;
Example 2
Create a text field, marks it for rich text formatting, and inserts rich text.
var myDoc = app.newDoc(); // Create a blank doc
var Bbox = myDoc.getPageBox("Crop"); // Get crop box
var inch = 72;
// Add a text field at the top of the document
var f = myDoc.addField("Text1", "text", 0,
[72, Bbox[1]-inch, Bbox[2]-inch, Bbox[1]-2*inch ] );
// Add some attributes to this text field
f.strokeColor = color.black;
f.richText = true; // Rich text
f.multiline = true; // Multiline
// Now build up an array of Span objects
var spans = new Array();
spans[0] = new Object();
spans[0].text = "Attention:\r";
spans[0].textColor = color.blue;
spans[0].textSize = 18;
spans[1] = new Object();
spans[1].text = "phantom \r";
spans[1].textColor = color.red;
spans[1].textSize = 20;
spans[1].alignment = "center";
spans[2] = new Object();
spans[2].text = "will soon be here!";
spans[2].textColor = color.green;
spans[2].fontStyle = "italic";
spans[2].underline = true;
spans[2].alignment = "right";
// Now give the rich field a rich value
f.richValue = spans;

◆ rotation()

FX_BOOL Field::rotation ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
Create a rotated text field on each page and fill it with text.
for ( var i=0; i < this.numPages; i++) {
var f = this.addField("myRotatedText"+i,"text",i,[6, 6+72, 18, 6]);
f.rotation = 90; f.value = "Confidential";
f.textColor = color.red; f.readonly = true;
}

◆ strokeColor()

FX_BOOL Field::strokeColor ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
Change the stroke color of each text field in the document to red.
for ( var i=0; i < this.numFields; i++)
{
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if ( f.type == "text" ) f.strokeColor = color.red;
}

◆ style()

FX_BOOL Field::style ( OBJ_PROP_PARAMS )
Style | Keyword
check | style.ch
cross | style.cr
diamond | style.di
circle | style.ci
star | style.st
square | style.sq
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Fields
checkbox, radiobutton
Example
This example sets the glyph style to circle.
var f = this.getField("Check Box0");
f.style = style.ci;

◆ submitName()

FX_BOOL Field::submitName ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Fields
all
var f = this.getField("Text Field0");
f.submitName = "1213";

◆ textColor()

FX_BOOL Field::textColor ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
This example sets the foreground color to red.
var f = this.getField("Text Field0");
f.textColor = color.red;

◆ textFont()

FX_BOOL Field::textFont ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Fields
button, combobox, listbox, text
font Object
Text font | Keyword
Times-Roman | font.Times
Times-Bold | font.TimesB
Times-Italic | font.TimesI
Times-BoldItalic | font.TimesBI
Helvetica | font.Helv
Helvetica-Bold | font.HelvB
Helvetica-Oblique | font.HelvI
Helvetica-BoldOblique | font.HelvBI
Courier | font.Cour
Courier-Bold | font.CourB
Courier-Oblique | font.CourI
Courier-BoldOblique | font.CourBI
Symbol | font.Symbol
ZapfDingbats | font.ZapfD
Example
Set the font to Helvetica.
var f = this.getField("Text Field0");
f.textFont = font.Times;

◆ textSize()

FX_BOOL Field::textSize ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
var f = this.getField("Text Field0");
f.textSize = 28;

◆ type()

FX_BOOL Field::type ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader
Fields
all
Example
Count the number of text fields in the document.
var count = 0;
for ( var i=0; i<this.numFields; i++) {
var fname = this.getNthFieldName(i);
if ( this.getField(fname).type == "text" ) count++; }
console.println("There are " + count + " text fields.");

◆ userName()

FX_BOOL Field::userName ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Fields
all
Example
Add a tooltip to a button field.
var f = this.getField("Push Button0");
f.userName = "Press this button to submit your data.";

◆ value()

FX_BOOL Field::value ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
various
Access
R/W
Availability
Phantom/Reader
Fields
all except button
Example
var f0 = this.getField("Text Field0");
var f1 = this.getField("Text Field1");
var f2 = this.getField("Text Field2");
f0.value= (f1.value + f2.value) * 1.0825;

◆ valueAsString()

FX_BOOL Field::valueAsString ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R
Availability:
Phantom/Reader
Fields
all except button

◆ browseForFileToSubmit()

FX_BOOL Field::browseForFileToSubmit ( OBJ_METHOD_PARAMS )
Example
The following code references a text field with the file select flag checked. It is a mouse-up action of a button field.
var f = this.getField("resumeField");
f.browseForFileToSubmit();

◆ buttonGetCaption()

FX_BOOL Field::buttonGetCaption ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
nFace (optional) If specified, gets a caption of the given type:
0 ——(default) normal caption
1 —— down caption
2 —— rollover caption
Returns
The caption string associated with the button.
Example
This example places pointing arrows to the left and right of the caption on a button field with icon and text.
// A mouse enter event
event.target.buttonSetCaption("=> "+ event.target.buttonGetCaption() +" <=");
// A mouse exit event
var str = event.target.buttonGetCaption();
str = str.replace(/=> | <=/g, "");
event.target.buttonSetCaption(str);

◆ buttonGetIcon()

FX_BOOL Field::buttonGetIcon ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
nFace (optional) If specified, gets an icon of the given type:
0 ——(default) normal icon
1 —— down icon
2 ——rollover icon
Returns
The Icon object.
Example
// Swap two button icons.
var f = this.getField("Button1");
var g = this.getField("Button2");
var temp = f.buttonGetIcon();
f.buttonSetIcon(g.buttonGetIcon());
g.buttonSetIcon(temp);

◆ buttonSetCaption()

FX_BOOL Field::buttonSetCaption ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
cCaption The caption associated with the button.
nFace (optional) If specified, sets a caption of the given type:
0 ——(default) normal caption
1 ——down caption
2 —— rollover caption
Example
var f = this.getField("myButton");
f.buttonSetCaption("Hello");

◆ buttonSetIcon()

FX_BOOL Field::buttonSetIcon ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
oIcon The Icon object associated with the button.
nFace (optional) If specified, sets an icon of the given type:
0 —— (default) normal icon
1 —— down icon
2 —— rollover icon
Example
function Field_buttonSetIcon()
{
var f1 = this.getField("button icon source");
var icon1 = f1.buttonGetIcon();
var f2 = this.getField("button icon target");
f2.buttonSetIcon(icon1);
}
Field_buttonSetIcon();

◆ checkThisBox()

FX_BOOL Field::checkThisBox ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
nWidget The 0-based index of an individual check box or radio button widget for this field. The index is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order).
Every entry in the Fields panel has a suffix giving this index; for example, MyField #0.
bCheckIt (optional) Specifies whether the widget should be checked. The default is true.
Example
Check a check box.
var f = this.getField("ChkBox");
f.checkThisBox(0,true);

◆ clearItems()

FX_BOOL Field::clearItems ( OBJ_METHOD_PARAMS )
Example
Clear the field "myList" of all items.
this.getField("myList").clearItems();

◆ defaultIsChecked()

FX_BOOL Field::defaultIsChecked ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
nWidget The 0-based index of an individual radio button or check box widget for this field. The index is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order).
Every entry in the Fields panel has a suffix giving this index (for example, MyField #0).
bIsDefaultChecked (optional) If true (the default), the widget should be checked by default (for example, when the field gets reset). If false, it should be unchecked by default.
Returns
true on success.
Example
Change the default of "ChkBox" to checked, then reset the field to reflect the default value.
var f = this.getField("ChkBox");
f.defaultIsChecked(0,true);
this.resetForm(["ChkBox"]);

◆ deleteItemAt()

FX_BOOL Field::deleteItemAt ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
nIdx (optional) The 0-based index of the item in the list to delete. If not specified, the currently selected item is deleted.
Example
Delete the current item in the list, then select the top item in the list.
var a = this.getField("MyListBox");
a.deleteItemAt(); // Delete current item, and...
a.currentValueIndices = 0; // select top item in list

◆ getArray()

FX_BOOL Field::getArray ( OBJ_METHOD_PARAMS )
Returns
An array of Field objects
Example
Make a calculation of the values of the child fields of the parent field.
// f has 3 children: f.v1, f.v2, f.v3
var f = this.getField("f");
var a = f.getArray();
var v = 0.0;
for (j =0; j < a.length; j++) v += a[j].value;
// v contains the sum of all the children of field "f"

◆ getItemAt()

FX_BOOL Field::getItemAt ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
nIdx The 0-based index of the item in the list or -1 for the last item in the list.
bExportValue (optional) Specifies whether to return an export value:
If true (the default), if the item has an export value, it is returned. If there is no export value, the item name is returned.
If false, the method returns the item name.
Returns
The export value or name of the specified item.
Example
In the two examples that follow, assume there are three items on "myList": "First" with an export value of 1; "Second", with an export value of 2; and "Third", with no export value.
// Returns value of first item in list, which is 1
var f = this.getField("myList");
var v = f.getItemAt(0);
The following example shows the use of the second optional parameter. By setting it to false, the item name (face value) can be obtained, even if there is an export value.
for (var i=0; i < f.numItems; i++)
console.println(f.getItemAt(i,true) + ": " + f.getItemAt(i,false));
The output to the console reads:
1: First
2: Second
Third: Third

◆ getLock()

FX_BOOL Field::getLock ( OBJ_METHOD_PARAMS )
Returns
The Lock object for the field.

◆ insertItemAt()

FX_BOOL Field::insertItemAt ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
cName The item name that will appear in the form.
cExport (optional) The export value of the field when this item is selected. If not provided, the cName is used as the export value.
nIdx (optional) The index in the list at which to insert the item. If 0 (the default), the new item is inserted at the top of the list. If -1, the new item is inserted at the end of the list.
Example
var l = this.getField("myList");
l.insertItemAt("sam", "s", 0); // inserts sam to top of list l

◆ isBoxChecked()

FX_BOOL Field::isBoxChecked ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
nWidget The 0-based index of an individual radio button or check box widget for this field. The index is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order).
Every entry in the Fields panel has a suffix giving this index, for example, MyField #0.
Returns
true if the specified widget is currently checked, false otherwise.
Example
Determine the state of the check box and report back with an alert box.
var f = this.getField("ChkBox");
var cbStatus = (f.isBoxChecked(0)) ? " " : " not ";
app.alert("The box is" + cbStatus + "checked");

◆ isDefaultChecked()

FX_BOOL Field::isDefaultChecked ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
nWidget The 0-based index of an individual radio button or check box widget for this field. The index is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order).
Every entry in the Fields panel has a suffix giving this index, for example, MyField #0.
Returns
true if the specified widget is checked by default, false otherwise.
Example
Determine if the specified check box is checked by default.
var f = this.getField("ChkBox");
var cbStatus = (f.isDefaultChecked(0)) ? "Checked" : "Unchecked";
app.alert("The Default: " + cbStatus);

◆ setAction()

FX_BOOL Field::setAction ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
cTrigger A string that sets the trigger for the action. Values are:
MouseUp
MouseDown
MouseEnter
MouseExit
OnFocus
OnBlur
Keystroke
Validate
Calculate
Format
For a list box, use the Keystroke trigger for the Selection Change event.
cScript The JavaScript code to be executed when the trigger is activated.
Example
Set up a button field with addField, add some properties, and a mouse-up action using setAction.
var f = this.addField("actionField", "button", 0 , [20, 100, 100, 20]);
f.setAction("MouseUp", "app.beep(0);");
f.delay = true;
f.fillColor = color.ltGray;
f.buttonSetCaption("Beep");
f.borderStyle = border.b;
f.lineWidth = 3;
f.strokeColor = color.red;
f.highlight = highlight.p;
f.delay = false;

◆ setFocus()

FX_BOOL Field::setFocus ( OBJ_METHOD_PARAMS )
Example
Search for a certain open document, then focus on the field of interest. This script uses app.activeDocs, which requires the disclosed property of the documents to be true, or the script to be run during console, batch or menu events.
var d = app.activeDocs;
for (var i = 0; i < d.length; i++) {
if (d[i].info.Title == "Response Document") {
d[i].getField("name").value="Enter your name here: "
// also brings the doc to front.
d[i].getField("name").setFocus();
break;
}
}

◆ setItems()

FX_BOOL Field::setItems ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
oArray An array in which each element is either an object convertible to a string or another array:
For an element that can be converted to a string, the user and export values for the list item are equal to the string.
For an element that is an array, the array must have two subelements convertible to strings, where the first is the user value and the second is the export value.
Examples
Get various fields (combo or list) and set items in the list using various techniques.
var l = this.getField("ListBox");
l.setItems(["One", "Two", "Three"]);
var c = this.getField("StateBox");
c.setItems([["California", "CA"],["Massachusetts", "MA"],
["Arizona", "AZ"]]);
var c = this.getField("NumberBox");
c.setItems(["1", 2, 3, ["PI", Math.PI]]);

◆ setLock()

FX_BOOL Field::setLock ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter | instruction
oLock | A Lock object containing the lock properties.
Returns
true if successful, otherwise false or throws an exception.
Lock Object
A generic JavaScript object containing lock properties. This object is passed to setLock and returned by getLock for a signature field. It contains the following properties.
Property Type Access Description
action String R/W The language-independent name of the action. Values are:
All — All fields in the document are to be locked.
Include — Only the fields specified in fields are to be locked.
Exclude — All fields except those specified in fields are to be locked.
fields Array of Strings R/W An array of strings containing the field names. Required if the value of action is Include or Exclude.

◆ signatureGetModifications()

FX_BOOL Field::signatureGetModifications ( OBJ_METHOD_PARAMS )
Returns
An object containing modification information. The object has the following properties:
Property | Type | Description
formFieldsCreated | Array of Field objects | Array of form fields created after signing.
formFieldsDeleted | Array of Generic objects | Array of form fields deleted after signing. Each generic object in the array is a string of the form name : type.
formFieldsFilledIn | Array of Field objects | Array of form fields filled in after signing.
formFieldsModified | Array of Field objects | Array of form fields modified after signing. In this context, form field fill-in does not constitute modification.
annotsCreated | Array of Annotation objects | Array of annotations created after signing. If the annotation is transient (for example, a dynamically created pop-up), the corresponding element of the array is a string of the form author : name : type.
annotsDeleted | Array of Generic objects | Array of annotations deleted after signing. Each generic object in the array is of the form author : name : type.
annotsModified | Array of Annotation objects | Array of annotations modified after signing. If the annotation is transient (for example, a dynamically created pop-up), the corresponding element of the array is a string of the form author : name : type.
numPagesCreated | Integer | Number of pages added after signing.
numPagesDeleted | Integer | Number of pages deleted after signing.
numPagesModified Integer Number of pages whose content has been modified after signing (add/delete/modify of annotations/form fields are not considered as page modification for this purpose).
Example
Write modification information back to the console.
var sigField = this.getField( "mySignature" );
var sigMods = sigField.signatureGetModifications();
var formFieldsCreated = sigMods.formFieldsCreated;
for( var i = 0; i < formFieldsCreated.length; i++ )
console.println( formFieldsCreated[i].name );
var formFieldsDeleted = sigMods.formFieldsDeleted;
for( var i = 0; i < formFieldsDeleted.length; i++ )
console.println( formFieldsDeleted[i].name );
var formFieldsFilledIn = sigMods.formFieldsFilledIn;
for( var i = 0; i < formFieldsFilledIn.length; i++ )
console.println( formFieldsFilledIn[i].name );
var formFieldsModified = sigMods.formFieldsModified;
for( var i = 0; i < formFieldsModified.length; i++ )
console.println( formFieldsModified[i].name );
console.println( sigMods.numPagesDeleted );

◆ signatureGetSeedValue()

FX_BOOL Field::signatureGetSeedValue ( OBJ_METHOD_PARAMS )
Returns
A SeedValue object.
Example
Access the seed value for a signature field.
var f = this.getField( "sig0" );
var seedValue = f.signatureGetSeedValue();
// displays the seed value filter and flags
console.println( "Filter name:" + seedValue.filter);
console.println( "Flags:" + seedValue.flags);
// displays the certificate seed value constraints
var certSpec = seedValue.certspec;
console.println( "Issuer:" + certSpec.issuer);

◆ signatureInfo()

FX_BOOL Field::signatureInfo ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Returns
A SignatureInfo object that contains the properties of the signature. This type of object is also used when signing signature fields, signing FDF objects, or with the FDF object signatureValidate method.
Example
Access SignatureInfo object properties.
// Get all info
var f = getField( "Signature1" );
f.signatureValidate();
var s = f.signatureInfo();
console.println( "Signature Attributes:" );
for(i in s) console.println( i + " = " + s[i] );
// Get particular info
var f = this.getField("Signature1"); // uses the ppklite sig handler
var Info = f.signatureInfo();
// Some standard signatureInfo properties
console.println("name = " + Info.name);
console.println("reason = " + Info.reason);
console.println("date = " + Info.date);

◆ signatureSetSeedValue()

FX_BOOL Field::signatureSetSeedValue ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter | instruction
oSigSeedValue | A SeedValue object containing the signature seed value properties.
SeedValue Object
A generic JavaScript object, passed to signatureSetSeedValue and returned by signatureGetSeedValue, which represents a signature seed value. It has the following properties:
Property | Type | Access | Description
certspec | object | R/W | A seed value CertificateSpecifier object. see CertificateSpecifier Object for a listing of the properties of this object.
digestMethod | Array of strings | R/W | An array of acceptable digest methods to use while signing. the value is always SHA1 in phantom.
filter String R/W The language-independent name of the security handler to be used when signing.
If filter is specified and the flags property indicates this entry is a required constraint, then the signature handler specified by this entry must be used when signing; otherwise, signing must not take place. If flags indicates that this is an optional constraint, then this handler should be used if it is available. If it is not available, a different handler can be used instead.
flags Number R/W A set of bit flags controlling which of the following properties of this object are required. The value is the logical OR of the following values, which are set if the corresponding property is required:
1: filter
2: subFilter
4: version
8: reasons
16: legalAttestations
32: shouldAddRevInfo
64: digestMethod
128: lockDocument
256: appearanceFilter
Usage: 1 specifies filter, 3 specifies filter and sub-filter, and 11 specifies filter, sub-filter, and reasons. If this field is not present, all properties are optional.
legalAttestations Array of Strings R/W A list of legal attestations that the user can use when creating an Modification Detection and Prevention (MDP) (certified) signature.
The value of the corresponding flag in the flags property indicates whether this is a required or optional constraint.
mdp String R/W The MDP setting to use when signing the field. Values are
allowNone
default
defaultAndComments
While allowAll is a legal value, it cancels out the effect of MDP and no certification signature can be used for this field, resulting in the signature being an approval signature, not an certification signature.
Values are unique identifiers and are described in the table titled Modification Detection and Prevention (MDP) Values.
reasons Array of Strings R/W A list of reasons that the user is allowed to use when signing.
If this array has a single element and that element is a single period '.' and if the reasons are marked as required by the flags property, then phantom will suppress the UI for specifying a reason during signing. This overrides the users preference.
If this array is empty and reasons are marked as required, an exception will be thrown.
subFilter Array of Strings R/W An array of acceptable formats to use for the signature. Refer to the Signature Info object's subFilter property for a list of known formats.
The first name in the array that matches an encoding supported by the signature handler should be the encoding that is actually used for signing. If subFilter is specified and the flags property indicates that this entry is a required constraint, then the first matching encodings must be used when signing; otherwise, signing must not take place. If the flags property indicates that this is an optional constraint, then the first matching encoding should be used if it is available. If it is not available, a different encoding can be used.
timeStampspec Object R/W A Seed Value timeStamp Specifier object. It uses the url and flags properties to specify a timestamp server. See Seed value timeStamp specifier object.
version Number R The minimum required version number of the signature handler to be used to sign the signature field. Valid values are 1 and 2. A value of 1 specifies that the parser must be able to recognize all seed value dictionary entries specified in PDF 1.5. A value of 2 specifies that it must be able to recognize all seed value dictionary entries specified in PDF 1.7 and earlier.
The flags property indicates whether this is a required constraint.
Note:The PDF Reference version 1.6 and earlier, erroneously indicates that the V entry (the key that corresponds to the version parameter) is of type integer. This entry is of type real.
CertificateSpecifier Object
This generic JavaScript object contains the certificate specifier properties of a signature seed value. Used in the certSpec property of the SeedValue object. This object contains the following properties:
Property Type Access Description
flags Number R/W A set of bit flags controlling which of the following properties of this object are required. The value is the logical OR of the following values, which are set if the corresponding property is required:
1: subject
2: issuer
4: oid
8: subjectDN
16: Reserved
32: keyUsage
64: url
If this field is not present, all properties are optional.
issuer Array of Certificate objects R/W An array of Certificate objects that are acceptable for signing.
Note:If specified, the signing certificate must be issued by a certificate that is an exact match with one of the certificates in this array.
The value of the corresponding flag in the flags property indicates whether this is a required or optional constraint.
keyUsage Object R Array of integers, where each integer specifies the acceptable key-usage extension that must be present in the signing certificate.
Each integer is constructed as follows:
There are two bits used for each key-usage type (defined in RFC 3280) starting from the least significant bit:
digitalSignature(bits 2,1),
nonRepudiation(4,3)
keyEncipherment(6,5)
dataEncipherment(8,7)
keyAgreement(10,9)
keyCertSign(12,11)
cRLSign(14,13)
encipherOnly(16,15)
decipherOnly(18,17)
The value of the two bits have the following semantics:
00: the corresponding keyUsage must not be set
01: the corresponding keyUsage must be set
10 and 11: the state of the corresponding keyUsage doesn't matter.
For example, if it is required that the key-usage type digitalSignature be set and the state of all other key-usage types do not matter, then the corresponding integer would be 0x7FFFFFFD. That is, to represent digitalSignature, set 01 for bits 2 and 1 respectively, and set 11 for all other key-usage types.
The value of the corresponding flag in the flags property indicates whether this is a required constraint.
subject Array of Certificate objects R/W An array of Certificate objects that are acceptable for signing.
Note:If specified, the signing certificate must be an exact match with one of the certificates in this array.
The value of the corresponding flag in the flags property indicates whether this is a required or optional constraint.
subjectDN Array of objects R/W Array of objects, where each object specifies a Subject Distinguished Name (DN) that is acceptable for signing. A signing certificate satisfies a DN requirement if it at least contains all the attributes specified in the DN (it can therefore contain additional DN attributes). If this entry is specified, the signing certificate must satisfy at least one of the DNs in the array.
DN attribute restrictions are specified in this object by adding them as properties. The properties'key names can either be the corresponding attributes'friendly names or OIDs (as defined in RFC 3280). The properties'value must be of type string.
The value of the corresponding flag in the flags property indicates whether this is a required or optional constraint.
Example 1: {cn:"Alice", ou:"Engineering", o:"Acme Inc"}. The friendly names for the DN attributes (cn, o, ou, and so on) are the ones defined in RDN (see RDN).
Example 2: {cn:"Joe Smith", ou:
"Engineering", 2.5.4.43:"JS"}, where OID 2.5.4.43 is used to carry out matching for the ¡°Initials¡± attribute. The following is sample code to define the above DN:
var subjectDN = {cn:"Joe Smith", ou:"Engineering"};
subjectDN["2.4.5.43"] = "JS";
Attributes whose value is of type DirectoryString or IA5String can be specified as shown in the example above, whereas for all other value types, for example, dateOfBirth whose value is of type GeneralizedTime, the values need to be specified as a hex-encoded binary string.
For more information about the various attributes and their types, refer to RFC 3280.
url String R/W A URL that can be used to enroll for a new credential if a matching credential is not found.
A degenerate use of this property is when the URL points to a web service that is a DigitalID store (such as a signature web service that can be used for server-based signing). In that case, the URL indicates that as long as the signer has a DigitalID from that web service, it is acceptable for signing.
The value of the corresponding flag in the flags property indicates whether this is a required or optional constraint.
urlType String R/W String indicating the type of URL specified by the url property. These are the valid values for phantom:
"HTML": The URL points to an HTML website and phantom will use the web browser to display its contents. The the value of the url bit of the flags property is ignored.
"ASSP": The URL references a signature web service that can be used for server-based signing. If the url bit of the flags property indicates that this is a required constraint, this implies that the credential used when signing must come from this server.
If this attribute isn't present, it's assumed that the URL points to a HTML site.
Seed value timeStamp specifier object
The properties of the seed value timeStamp specifier object are as follows:
Property | Type | Access | Description
url | String | R/W | URL of the timeStamp server providing an RFC 3161 compliant timeStamp.
flags Number R/W A bit flag controlling whether the time stamp is required (1) or not required (0). The default is 0.
Example 1
var f = this.getField("Signature");
var testCert = security.importFromFile("Certificate", "/f/testcert.cer");
f.signatureSetSeedValue({
reasons: ["This is a reason", "This is a better reason"]});

◆ signatureSign()

FX_BOOL Field::signatureSign ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
oSig Specifies the SecurityHandler object to be used for signing. Throws an exception if the specified handler does not support signing operations. Some security handlers require that the user be logged in before signing can occur. If oSig is not specified, this method selects a handler based on user preferences or by prompting the user if bUI is true.
oInfo (optional) A SignatureInfo object specifying the writable properties of the signature. See also signatureInfo.
cDIPath (optional) The device-independent path to the file to save to following the application of the signature. If not specified, the file is saved back to its original location.
bUI (optional) A Boolean value specifying whether the security handler should show the user interface when signing. If true, oInfo and cDIPath are used as default values in the signing dialog boxes. If false (the default), the signing occurs without a user interface.
cLegalAttest (optional) A string that can be provided when creating an certification signature.
Certification signatures are signatures where the mdp property of the SignatureInfo object has a value other than allowAll. When creating an certification signature, the document is scanned for legal warnings and these warnings are embedded in the document. A caller can determine what legal warnings are found by first calling the Doc getLegalWarnings method. If warnings are to be embedded, an author may provide an attestation as to why these warnings are being applied to a document.
Returns
true if the signature was applied successfully, false otherwise.
Example 1
Sign the "Signature" field with the PPKLite signature handler:
var myEngine = security.getHandler( "Adobe.PPKLite" );
myEngine.login( "dps017", "/c/profile/dps.pfx" );
var f = this.getField("Signature");
// Sign the field
f.signatureSign( myEngine,
{ password: "dps017", // provide password
location: "San Jose, CA", // ... see note below
reason: "I am approving this document",
contactInfo: "dpsmith@example.com",
appearance: "Fancy"});
Note:In the above example, a password was provided. This may or may not have been necessary depending whether the Password Timeout had expired. The Password Timeout can be set programmatically by securityHandler.setPasswordTimeout.

◆ signatureValidate()

FX_BOOL Field::signatureValidate ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter | instruction
oSig | (optional) The security handler to be used to validate the signature. Its value is either a SecurityHandler object or a SignatureParameters object. If this handler is not specified, the method uses the security handler returned by the signature's handlerName property.
bUI | (optional) If true, allows the UI to be shown when validating, if necessary. The UI may be used to select a validation handler if none is specified. The default is false.
Returns
The validity status of the signature. Validity values are:
-1 —— Not a signature field
0 —— Signature is blank
1 —— Unknown status
2 —— Signature is invalid
3 —— Signature of document is valid, identity of signer could not be verified
4 —— Signature of document is valid and identity of signer is valid.
See the signVisible and statusText properties of the SignatureInfo object.
Precondition
Document must be opened.
Example
Validate a signature, then report to the console.
var f = this.getField("Signature1") // Get signature field
var status = f.signatureValidate();
var sigInfo = f.signatureInfo();
if ( status < 3 )
var msg = "Signature not valid! " + sigInfo.statusText;
else
var msg = "Signature valid! " + sigInfo.statusText;
app.alert(msg);


Javascript API: Index Class Reference

Public Member Functions | List of all members
Index Class Reference

An object that represents a Catalog-generated index. It is non-creatable and returned by various methods of the search object and catalog object. You use this object to perform various indexing operations using Catalog. You can find the status of the index with a search.

Public Member Functions

FX_BOOL | available (OBJ_PROP_PARAMS)
Specifies whether the index is available for selection and searching. An index may be unavailable if a network connection is down or a CD-ROM is not inserted, or if the index administrator has brought the index down for maintenance purposes. More...
FX_BOOL | name (OBJ_PROP_PARAMS)
The name of the index as specified by the index administrator at indexing time. See search.indexes, which returns an array of the Index objects currently accessed by the search engine. More...
FX_BOOL | path (OBJ_PROP_PARAMS)
The device-dependent path where the index resides. See the PDF Reference for exact syntax of the path. More...
FX_BOOL | selected (OBJ_PROP_PARAMS)
Specifies whether the index participates in the search. If true, the index is searched as part of the query. If false it is not searched. Setting or unsetting this property is equivalent to checking the selection status in the index list dialog box. More...

Member Function Documentation

◆ available()

FX_BOOL Index::available ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ name()

FX_BOOL Index::name ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Example
This example enumerates all of the indexes and writes their names to the console.
for (var i = 0; i < search.indexes.length; i++) {
console.println("Index[" + i + "] = " + search.indexes[i].name);
}

◆ path()

FX_BOOL Index::path ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader

◆ selected()

FX_BOOL Index::selected ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader


Javascript API: Link Class Reference

Public Member Functions | List of all members
Link Class Reference

This object is used to set and get the properties and to set the JavaScript action of a link.

Public Member Functions

FX_BOOL | borderColor (OBJ_PROP_PARAMS)
The border color of a Link object. See Color arrays for information on defining color arrays and how colors are used with this property. More...
FX_BOOL | borderWidth (OBJ_PROP_PARAMS)
The border width of the Link object. More...
FX_BOOL | highlightMode (OBJ_PROP_PARAMS)
The visual effect to be used when the mouse button is pressed or held down inside an active area of a link. The valid values are: None Invert Outline Push The default is Invert. More...
FX_BOOL | rect (OBJ_PROP_PARAMS)
The rectangle in which the link is located on the page. Contains an array of four numbers, the coordinates in rotated user space of the bounding rectangle, listed in the following order: upper-left x, upper-left y, lower-right x and lower-right y. More...
FX_BOOL | setAction (OBJ_METHOD_PARAMS)
Sets the specified JavaScript action for the MouseUp trigger for the Link object. Note:This method will overwrite any action already defined for this link. More...

Member Function Documentation

◆ borderColor()

FX_BOOL Link::borderColor ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader

◆ borderWidth()

FX_BOOL Link::borderWidth ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Integer
Access
R/W
Availability:
Phantom/Reader

◆ highlightMode()

FX_BOOL Link::highlightMode ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader

◆ rect()

FX_BOOL Link::rect ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader

◆ setAction()

FX_BOOL Link::setAction ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
cScript The JavaScript action to use.


Javascript API: OCG Class Reference

Public Member Functions | List of all members
OCG Class Reference

An OCG object represents an optional content group in a PDF file. Content in the file can belong to one or more optional content groups. Content belonging to one or more OCGs is referred to as optional content and its visibility is determined by the states (ON or OFF) of the OCGs to which it belongs. In the simplest case, optional content belongs to a single OCG, with the content being visible when the OCG is on and hidden when the OCG is off. More advanced visibility behavior can be achieved by using multiple OCGs and different visibility mappings. Use the Doc getOCGs method to get an array of OCG objects for a PDF document. The Doc methods addWatermarkFromFile and addWatermarkFromText add watermarks in an OCG. See the PDF Reference for additional details on optional content groups.

Public Member Functions

FX_BOOL | name (OBJ_PROP_PARAMS)
The text string seen in the UI for this OCG. It can be used to identify OCGs, although it is not necessarily unique. More...
FX_BOOL | state (OBJ_PROP_PARAMS)
Represents the current on/off state of this OCG. Changing the state of an OCG does not dirty the document, the OCGs revert to their initial state when the document is loaded again. More...
FX_BOOL | initState (OBJ_PROP_PARAMS)
This property is used to determine whether this OCG is on or off by default. See the states Object for possible values. More...
FX_BOOL | locked (OBJ_PROP_PARAMS)
This property is used to determine whether this OCG is locked. If an OCG is locked, its on/off state cannot be toggled through the UI. More...
FX_BOOL | setAction (OBJ_METHOD_PARAMS)
Registers a JavaScript expression to be evaluated after every state change for this OCG. Setting an action for an OCG does not dirty the document, therefore, the assignment of action must be made when the document is first opened, as document level script, or dynamically through user interaction. Note:This method will overwrite any action already defined for this OCG. More...

Member Function Documentation

◆ name()

FX_BOOL OCG::name ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Example
A function that toggle all Watermark OCGs.
function ToggleWatermark(doc)
{
var ocgArray = doc.getOCGs();
for (var i=0; i < ocgArray.length; i++) {
if (ocgArray[i].name == "Watermark") {
ocgArray[i].state = !ocgArray[i].state;
}
}
}

◆ state()

FX_BOOL OCG::state ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Example
Turn on all the OCGs in the given document.
function TurnOnOCGsForDoc(doc)
{
var ocgArray = doc.getOCGs();
for (var i=0; i < ocgArray.length; i++)
ocgArray[i].state = true;
}

◆ initState()

FX_BOOL OCG::initState ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Example
Set an initial state of an OCG to off.
var ocgs = this.getOCGs();
ocgs[0].initState.constants.states.off;

◆ locked()

FX_BOOL OCG::locked ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ setAction()

FX_BOOL OCG::setAction ( OBJ_METHOD_PARAMS )
Precondition
Document must be opened.
Parameters
parameter instruction
cExpr The expression to be evaluated after the OCG state changes.
Example
The function below is used to assign a beep sound to an OCG passed to it. The script that follows the function definition assigns a beeping action to the first OCG, as listed in the array returned by the getOCGs method.
Beep when the given ocg is changed *
function BeepOnChange(ocg)
{
ocg.setAction("app.beep()");
}
var ocgs = this.getOCGs();
BeepOnChange(ocgs[0]);


Javascript API: search Class Reference

Public Member Functions | List of all members
search Class Reference

The search object is a static object that accesses the functionality provided by the Phantom Search plug-in. This plug-in must be installed to interface with the search object (see available). See also the Index object, which is returned by some of the methods of the search object. The results for query calls are displayed in the Find dialog box of Phantom.

Public Member Functions

FX_BOOL | matchWholeWord (OBJ_PROP_PARAMS)
Specifies whether search finds only occurrences of complete words that are specified in the query. For example, when this option is set to true, if you search for the word “stick”, the words “tick” and “sticky” will not be highlighted. The default is false. More...
FX_BOOL | attachments (OBJ_PROP_PARAMS)
Determines whether any PDF file attachments should be searched along with the base document. The default is false. This property is ignored on the Mac OS platform when searching a document from within the Safari web browser. As a result, attachments are not searched inside Safari. More...
FX_BOOL | bookmarks (OBJ_PROP_PARAMS)
Specifies whether bookmarks are searched for the query. The default is false. More...
FX_BOOL | docText (OBJ_PROP_PARAMS)
Specifies whether the document text is searched for the query. The default is true. More...
FX_BOOL | ignoreAccents (OBJ_PROP_PARAMS)
Specifies whether accents and diacriticals are ignored while searching the query term. The default is false. More...
FX_BOOL | markup (OBJ_PROP_PARAMS)
Specifies whether markup (annotations) are searched for the query. The default is false. More...
FX_BOOL | matchCase (OBJ_PROP_PARAMS)
Specifies whether the search query is case sensitive. The default is false. More...
FX_BOOL | maxDocs (OBJ_PROP_PARAMS)
The maximum number of documents that will be returned as part of the search query. The default is 100 documents. More...
FX_BOOL | proximity (OBJ_PROP_PARAMS)
Specifies whether the search query will reflect the proximity of words in the results ranking when performing the search that contains AND Boolean clauses. The default is false. See the sections in the Phantom Help pertaining to Search capabilities for a more thorough discussion of proximity. More...
FX_BOOL | stem (OBJ_PROP_PARAMS)
Specifies whether the search query will take the stemming of words (for example, run, runs, running) into account when performing the search. The default is false. See the sections in the Phantom Help pertaining to Search capabilities for a more thorough discussion of stemming. More...
FX_BOOL | wordMatching (OBJ_PROP_PARAMS)
String. More...
FX_BOOL | ignoreAsianCharacterWidth (OBJ_PROP_PARAMS)
Specifies whether the Kana characters in the document exactly match the search query. The default is false. More...
FX_BOOL | query (OBJ_METHOD_PARAMS)
Searches the specified document or index for the specified text. Properties associated with the search object (such as matchCase, matchWholeWord, stem) may affect the result. More...
FX_BOOL | addIndex (OBJ_METHOD_PARAMS)
Adds the specified index to the list of searchable indexes. More...
FX_BOOL | removeIndex (OBJ_METHOD_PARAMS)
Removes the specified Index object from the index list. More...

Member Function Documentation

◆ matchWholeWord()

FX_BOOL search::matchWholeWord ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ attachments()

FX_BOOL search::attachments ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ bookmarks()

FX_BOOL search::bookmarks ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ docText()

FX_BOOL search::docText ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ ignoreAccents()

FX_BOOL search::ignoreAccents ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ markup()

FX_BOOL search::markup ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ matchCase()

FX_BOOL search::matchCase ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ maxDocs()

FX_BOOL search::maxDocs ( OBJ_PROP_PARAMS )
Type
Integer
Access
R/W
Availability:
Phantom/Reader

◆ proximity()

FX_BOOL search::proximity ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ stem()

FX_BOOL search::stem ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ wordMatching()

FX_BOOL search::wordMatching ( OBJ_PROP_PARAMS )
 @brief How individual words in the query will be matched to words in the document. Values are:

MatchPhrase MatchAllWords MatchAnyWord BooleanQuery (default) This property is relevant only when a query has more than one word. The BooleanQuery option is ignored when searching the active document.

Type
Access
R/W
Availability:
Phantom/Reader

◆ ignoreAsianCharacterWidth()

FX_BOOL search::ignoreAsianCharacterWidth ( OBJ_PROP_PARAMS )
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ query()

FX_BOOL search::query ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cQuery The text for which to search.
cWhere (optional) Specifies where the text should be searched. Values are:
ActiveDoc
Folder
Index
ActiveIndexes
The default is ActiveIndexes.
cDIPath (optional) A device-independent path to a folder or Catalog index on the user's computer.
When cWhere is Folder or Index, this parameter is required.
Examples
Search for the word “Phantom”.
cWhere Query
ActiveIndexes search.query("Phantom"); // "ActiveIndexes" is the default.
search.query("Phantom", "ActiveIndexes");
ActiveDoc search.query("Phantom", "ActiveDoc");
Folder search.query("Phantom","Folder","/c/myDocuments");
search.query("Foxit", "Folder","\\10.103.2.20\\Testfile");
Index search.query("FoxitPhantomPDF", "Index","E:\\FoxitPhantomPDF\\query-test.xml");

◆ addIndex()

FX_BOOL search::addIndex ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
cDIPath A device-independent path to an index file on the user’s hard drive.
cDIPath (optional) Whether the index should be selected for searching.
Returns
An Index object.
Example
search.addIndex("E:\\work\\search\\test1.xml", true)
search.proximity = true;
search.wordMatching = "MatchAllWords";
search.query("22 aa", "ActiveIndexes");

◆ removeIndex()

FX_BOOL search::removeIndex ( OBJ_METHOD_PARAMS )
Parameters
parameter instruction
index The Index object to remove from the index list.


Javascript API: Span Class Reference

Public Member Functions | List of all members
Span Class Reference

A generic object that represents a length of text and its associated properties in a rich text form field or annotation. A rich text value consists of an array of span objects representing the text and formatting.

Public Member Functions

FX_BOOL | alignment (OBJ_PROP_PARAMS)
The horizontal alignment of the text. Alignment for a line of text is determined by the first span on the line. The values of alignment are left center right The default value is left. More...
FX_BOOL | fontFamily (OBJ_PROP_PARAMS)
The font family used to draw the text. It is an array of family names to be searched for in order. The first entry in the array is the font name of the font to use. The second entry is an optional generic family name to use if an exact match of the first font is not found. The generic family names are symbol, serif, sans-serif, cursive, monospace, fantasy The default generic family name is sans-serif. More...
FX_BOOL | fontStretch (OBJ_PROP_PARAMS)
Specifies the normal, condensed or extended face from a font family to be used to draw the text. The values of fontStretch are ultra-condensed, extra-condensed, condensed, semi-condensed, normal, semi-expanded, expanded, extra-expanded, ultra-expanded The default value is normal. More...
FX_BOOL | fontWeight (OBJ_PROP_PARAMS)
The weight of the font used to draw the text. For the purposes of comparison, normal is anything under 700 and bold is greater than or equal to 700. The values of fontWeight are 100,200,300,400,500,600,700,800,900 The default value is 400. More...
FX_BOOL | fontStyle (OBJ_PROP_PARAMS)
Specifies the text is drawn with an italic or oblique font. italic normal The default is normal. More...
FX_BOOL | strikethrough (OBJ_PROP_PARAMS)
If strikethrough is true, the text is drawn with a strikethrough. The default is false. More...
FX_BOOL | subscript (OBJ_PROP_PARAMS)
Specifies the text is subscript. If true, subscript text is drawn with a reduced point size and a lowered baseline. The default is false. More...
FX_BOOL | superscript (OBJ_PROP_PARAMS)
Specifies the text is superscript. If true, superscript text is drawn with a reduced point size and a raised baseline. The default is false. More...
FX_BOOL | text (OBJ_PROP_PARAMS)
The text within the span. More...
FX_BOOL | textColor (OBJ_PROP_PARAMS)
A color array representing the RGB color to be used to draw the text (see the color object). The default color is black. More...
FX_BOOL | textSize (OBJ_PROP_PARAMS)
The point size of the text. The value of textSize can be any number between 0 and 32767, inclusive. A text size of zero means to use the largest point size that will allow all text data to fit in the field’s rectangle. The default text size is 12.0. More...
FX_BOOL | underline (OBJ_PROP_PARAMS)
If underline is true, the text is underlined. The default is false. More...

Member Function Documentation

◆ alignment()

FX_BOOL Span::alignment ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Example
The example following superscript uses alignment.

◆ fontFamily()

FX_BOOL Span::fontFamily ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Array
Access
R/W
Availability:
Phantom/Reader
Example
Set the defaultStyle font family for a rich text field.
f = this.getField("Text1");
style = f.defaultStyle;
// If Courier Std is not found on the user’s system, use a monospace font
style.fontFamily = ["Courier Std", "monospace" ];
f.defaultStyle = style;

◆ fontStretch()

FX_BOOL Span::fontStretch ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader

◆ fontWeight()

FX_BOOL Span::fontWeight ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader

◆ fontStyle()

FX_BOOL Span::fontStyle ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader

◆ strikethrough()

FX_BOOL Span::strikethrough ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ subscript()

FX_BOOL Span::subscript ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader

◆ superscript()

FX_BOOL Span::superscript ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Example
Write rich text to a rich text field using various properties. See the Field object richValue property for more details and examples.
var f = this.getField("myRichField");
// Create an array to hold the Span objects
var spans = new Array();
// Each Span object is an object, so we must create one
spans[0] = new Object();
spans[0].alignment = "center";
spans[0].text = "The answer is x";
spans[1] = new Object();
spans[1].text = "2/3";
spans[1].superscript = true;
spans[2] = new Object();
spans[2].superscript = false;
spans[2].text = ". ";
spans[3] = new Object();
spans[3].underline = true;
spans[3].text = "Did you get it right?";
spans[3].fontStyle = "italic";
spans[3].textColor = color.red;
// Now assign our array of Span objects to the field using // field.richValue
f.richValue = spans;

◆ text()

FX_BOOL Span::text ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
String
Access
R/W
Availability:
Phantom/Reader
Example
The example following superscript uses text.

◆ textColor()

FX_BOOL Span::textColor ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Color Array
Access
R/W
Availability:
Phantom/Reader
Example
The example following superscript uses textColor.

◆ textSize()

FX_BOOL Span::textSize ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Number
Access
R/W
Availability:
Phantom/Reader
Example
The example following the Field object richValue property uses textSize.

◆ underline()

FX_BOOL Span::underline ( OBJ_PROP_PARAMS )
Precondition
Document must be opened.
Type
Boolean
Access
R/W
Availability:
Phantom/Reader
Example
The example following superscript uses underline.


Javascript API: Class Index

Class Index
a | b | c | d | f | i | l | o | s
a
c
f
o
Annotation Certificate Field OCG
app console
i
s
attachment
d
b
Index search
Doc
l
Span
Bookmark
Link
a | b | c | d | f | i | l | o | s


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • activeDocs() : app
  • addAnnot() : Doc
  • addField() : Doc
  • addIcon() : Doc
  • addIndex() : search
  • addLink() : Doc
  • addMenuItem() : app
  • addWatermarkFromFile() : Doc
  • addWatermarkFromText() : Doc
  • addWeblinks() : Doc
  • alert() : app
  • alignment() : Annotation , Field , Span
  • AP() : Annotation
  • arrowBegin() : Annotation
  • arrowEnd() : Annotation
  • attachIcon() : Annotation
  • attachments() : search
  • author() : Annotation , Doc
  • available() : Index


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- b -

  • baseURL() : Doc
  • beep() : app
  • binary() : Certificate
  • bookmarkRoot() : Doc
  • bookmarks() : search
  • borderColor() : Link
  • borderEffectIntensity() : Annotation
  • borderEffectStyle() : Annotation
  • borderStyle() : Field
  • borderWidth() : Link
  • browseForDoc() : app
  • browseForFileToSubmit() : Field
  • buttonFitBounds() : Field
  • buttonGetCaption() : Field
  • buttonGetIcon() : Field
  • buttonPosition() : Field
  • buttonScaleHow() : Field
  • buttonScaleWhen() : Field
  • buttonSetCaption() : Field
  • buttonSetIcon() : Field


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • calcOrderIndex() : Field
  • calculate() : app , Doc
  • calculateNow() : Doc
  • callout() : Annotation
  • caretSymbol() : Annotation
  • charLimit() : Field
  • checkThisBox() : Field
  • children() : Bookmark
  • clear() : console
  • clearInterval() : app
  • clearItems() : Field
  • clearTimeOut() : app
  • closeDoc() : Doc
  • comb() : Field
  • commitOnSelChange() : Field
  • contents() : Annotation
  • contentStream() : attachment
  • createChild() : Bookmark
  • createTemplate() : Doc
  • creationDate() : Annotation , attachment , Doc
  • creator() : Doc
  • currentValueIndices() : Field


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- d -

  • dash() : Annotation
  • dataObjects() : Doc
  • defaultIsChecked() : Field
  • defaultStyle() : Field
  • defaultValue() : Field
  • delay() : Annotation , Doc , Field
  • deleteItemAt() : Field
  • deletePages() : Doc
  • destroy() : Annotation
  • dirty() : Doc
  • display() : Field
  • doc() : Annotation , Bookmark , Field
  • doCaption() : Annotation
  • docText() : search
  • documentFileName() : Doc
  • doNotScroll() : Field
  • doNotSpellCheck() : Field
  • dynamicXFAForm() : Doc


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- e -

  • editable() : Field
  • execDialog() : app
  • execMenuItem() : app
  • exportAsFDF() : Doc
  • exportAsText() : Doc
  • exportAsXFDF() : Doc
  • exportAsXFDFStr() : Doc
  • exportDataObject() : Doc
  • exportValues() : Field
  • external() : Doc
  • extractPages() : Doc


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- f -

  • fileSelect() : Field
  • filesize() : Doc
  • fillColor() : Annotation , Field
  • flattenPages() : Doc
  • fontFamily() : Span
  • fontStretch() : Span
  • fontStyle() : Span
  • fontWeight() : Span
  • fs() : app
  • fullscreen() : app


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- g -

  • gestures() : Annotation
  • getAnnot() : Doc
  • getAnnots() : Doc
  • getArray() : Field
  • getDataObject() : Doc
  • getField() : Doc
  • getItemAt() : Field
  • getLinks() : Doc
  • getLock() : Field
  • getNthFieldName() : Doc
  • getOCGOrder() : Doc
  • getOCGs() : Doc
  • getPageBox() : Doc
  • getPageNthWord() : Doc
  • getPageNumWords() : Doc
  • getPageRotation() : Doc
  • getPageTransition() : Doc
  • getPrintParams() : Doc
  • getTemplate() : Doc
  • getURL() : Doc
  • gotoNamedDest() : Doc


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- h -

  • hidden() : Annotation , Field
  • hide() : console
  • highlight() : Field
  • highlightMode() : Link
  • hostContainer() : Doc


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- i -

  • icons() : Doc
  • ignoreAccents() : search
  • ignoreAsianCharacterWidth() : search
  • importAnFDF() : Doc
  • importAnXFDF() : Doc
  • importDataObject() : Doc
  • importTextData() : Doc
  • info() : Doc
  • initState() : OCG
  • inReplyTo() : Annotation
  • insertChild() : Bookmark
  • insertItemAt() : Field
  • insertPages() : Doc
  • intent() : Annotation
  • isBoxChecked() : Field
  • isDefaultChecked() : Field
  • issuerDN() : Certificate


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- k -

  • keyUsage() : Certificate
  • keywords() : Doc


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- l -

  • language() : app
  • launchURL() : app
  • layout() : Doc
  • leaderExtend() : Annotation
  • leaderLength() : Annotation
  • lineEnding() : Annotation
  • lineWidth() : Field
  • listMenuItems() : app
  • lock() : Annotation
  • locked() : OCG


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- m -

  • mailDoc() : Doc
  • mailForm() : Doc
  • mailMsg() : app
  • markup() : search
  • matchCase() : search
  • matchWholeWord() : search
  • maxDocs() : search
  • MD5Hash() : Certificate
  • media() : app , Doc
  • MIMEType() : attachment
  • modDate() : Annotation , attachment , Doc
  • mouseX() : Doc
  • mouseY() : Doc
  • movePage() : Doc
  • multiline() : Field
  • multipleSelection() : Field


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- n -

  • name() : Annotation , attachment , Bookmark , Field , Index , OCG
  • newDoc() : app
  • newPage() : Doc
  • noteIcon() : Annotation
  • noView() : Annotation
  • numFields() : Doc
  • numItems() : Field
  • numPages() : Doc


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- o -

  • opacity() : Annotation
  • open() : Bookmark
  • openDoc() : app


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- p -

  • page() : Annotation , Field
  • pageNum() : Doc
  • pageWindowRect() : Doc
  • parent() : Bookmark
  • password() : Field
  • path() : attachment , Doc , Index
  • platform() : app
  • point() : Annotation
  • points() : Annotation
  • popUpMenu() : app
  • popUpMenuEx() : app
  • popupOpen() : Annotation
  • popupRect() : Annotation
  • print() : Annotation , Doc , Field
  • printerNames() : app
  • println() : console
  • privateKeyValidityEnd() : Certificate
  • privateKeyValidityStart() : Certificate
  • producer() : Doc
  • proximity() : search


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- q -

  • quads() : Annotation
  • query() : search


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- r -

  • radiosInUnison() : Field
  • readOnly() : Annotation
  • readonly() : Field
  • rect() : Annotation , Field , Link
  • refType() : Annotation
  • remove() : Bookmark
  • removeDataObject() : Doc
  • removeField() : Doc
  • removeIndex() : search
  • removeLinks() : Doc
  • removeTemplate() : Doc
  • removeWeblinks() : Doc
  • replacePages() : Doc
  • required() : Field
  • resetForm() : Doc
  • response() : app
  • richText() : Field
  • richValue() : Field
  • rotation() : Field
  • runtimeHighlight() : app
  • runtimeHighlightColor() : app


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- s -

  • scroll() : Doc
  • securityHandler() : Doc
  • selected() : Index
  • serialNumber() : Certificate
  • setAction() : Bookmark , Field , Link , OCG
  • setFocus() : Field
  • setInterval() : app
  • setItems() : Field
  • setLock() : Field
  • setOCGOrder() : Doc
  • setPageBoxes() : Doc
  • setPageRotations() : Doc
  • setPageTabOrder() : Doc
  • setPageTransitions() : Doc
  • setTimeOut() : app
  • SHA1Hash() : Certificate
  • show() : console
  • signatureGetModifications() : Field
  • signatureGetSeedValue() : Field
  • signatureInfo() : Field
  • signatureSetSeedValue() : Field
  • signatureSign() : Field
  • signatureValidate() : Field
  • size() : attachment
  • soundIcon() : Annotation
  • state() : OCG
  • stem() : search
  • strikethrough() : Span
  • strokeColor() : Annotation , Field
  • style() : Annotation , Field
  • subject() : Annotation , Doc
  • subjectCN() : Certificate
  • subjectDN() : Certificate
  • submitForm() : Doc
  • submitName() : Field
  • subscript() : Span
  • superscript() : Span
  • syncAnnotScan() : Doc


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- t -

  • templates() : Doc
  • text() : Span
  • textColor() : Field , Span
  • textFont() : Annotation , Field
  • textSize() : Annotation , Field , Span
  • title() : Doc
  • toggleNoView() : Annotation
  • type() : Annotation , Field


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- u -

  • underline() : Span
  • URL() : Doc
  • userName() : Field


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- v -

  • validityEnd() : Certificate
  • validityStart() : Certificate
  • value() : Field
  • valueAsString() : Field
  • vertices() : Annotation
  • viewerType() : app
  • viewerVariation() : app
  • viewerVersion() : app


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- w -

  • width() : Annotation
  • wordMatching() : search


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- x -

  • xfa() : Doc


Javascript API: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- z -

  • zoom() : Doc
  • zoomType() : Doc


Javascript API: Class Members - Functions

- a -

  • activeDocs() : app
  • addAnnot() : Doc
  • addField() : Doc
  • addIcon() : Doc
  • addIndex() : search
  • addLink() : Doc
  • addMenuItem() : app
  • addWatermarkFromFile() : Doc
  • addWatermarkFromText() : Doc
  • addWeblinks() : Doc
  • alert() : app
  • alignment() : Annotation , Field , Span
  • AP() : Annotation
  • arrowBegin() : Annotation
  • arrowEnd() : Annotation
  • attachIcon() : Annotation
  • attachments() : search
  • author() : Annotation , Doc
  • available() : Index


Javascript API: Class Members - Functions

- b -

  • baseURL() : Doc
  • beep() : app
  • binary() : Certificate
  • bookmarkRoot() : Doc
  • bookmarks() : search
  • borderColor() : Link
  • borderEffectIntensity() : Annotation
  • borderEffectStyle() : Annotation
  • borderStyle() : Field
  • borderWidth() : Link
  • browseForDoc() : app
  • browseForFileToSubmit() : Field
  • buttonFitBounds() : Field
  • buttonGetCaption() : Field
  • buttonGetIcon() : Field
  • buttonPosition() : Field
  • buttonScaleHow() : Field
  • buttonScaleWhen() : Field
  • buttonSetCaption() : Field
  • buttonSetIcon() : Field


Javascript API: Class Members - Functions

- c -

  • calcOrderIndex() : Field
  • calculate() : app , Doc
  • calculateNow() : Doc
  • callout() : Annotation
  • caretSymbol() : Annotation
  • charLimit() : Field
  • checkThisBox() : Field
  • children() : Bookmark
  • clear() : console
  • clearInterval() : app
  • clearItems() : Field
  • clearTimeOut() : app
  • closeDoc() : Doc
  • comb() : Field
  • commitOnSelChange() : Field
  • contents() : Annotation
  • contentStream() : attachment
  • createChild() : Bookmark
  • createTemplate() : Doc
  • creationDate() : Annotation , attachment , Doc
  • creator() : Doc
  • currentValueIndices() : Field


Javascript API: Class Members - Functions

- d -

  • dash() : Annotation
  • dataObjects() : Doc
  • defaultIsChecked() : Field
  • defaultStyle() : Field
  • defaultValue() : Field
  • delay() : Annotation , Doc , Field
  • deleteItemAt() : Field
  • deletePages() : Doc
  • destroy() : Annotation
  • dirty() : Doc
  • display() : Field
  • doc() : Annotation , Bookmark , Field
  • doCaption() : Annotation
  • docText() : search
  • documentFileName() : Doc
  • doNotScroll() : Field
  • doNotSpellCheck() : Field
  • dynamicXFAForm() : Doc


Javascript API: Class Members - Functions

- e -

  • editable() : Field
  • execDialog() : app
  • execMenuItem() : app
  • exportAsFDF() : Doc
  • exportAsText() : Doc
  • exportAsXFDF() : Doc
  • exportAsXFDFStr() : Doc
  • exportDataObject() : Doc
  • exportValues() : Field
  • external() : Doc
  • extractPages() : Doc


Javascript API: Class Members - Functions

- f -

  • fileSelect() : Field
  • filesize() : Doc
  • fillColor() : Annotation , Field
  • flattenPages() : Doc
  • fontFamily() : Span
  • fontStretch() : Span
  • fontStyle() : Span
  • fontWeight() : Span
  • fs() : app
  • fullscreen() : app


Javascript API: Class Members - Functions

- g -

  • gestures() : Annotation
  • getAnnot() : Doc
  • getAnnots() : Doc
  • getArray() : Field
  • getDataObject() : Doc
  • getField() : Doc
  • getItemAt() : Field
  • getLinks() : Doc
  • getLock() : Field
  • getNthFieldName() : Doc
  • getOCGOrder() : Doc
  • getOCGs() : Doc
  • getPageBox() : Doc
  • getPageNthWord() : Doc
  • getPageNumWords() : Doc
  • getPageRotation() : Doc
  • getPageTransition() : Doc
  • getPrintParams() : Doc
  • getTemplate() : Doc
  • getURL() : Doc
  • gotoNamedDest() : Doc


Javascript API: Class Members - Functions

- h -

  • hidden() : Annotation , Field
  • hide() : console
  • highlight() : Field
  • highlightMode() : Link
  • hostContainer() : Doc


Javascript API: Class Members - Functions

- i -

  • icons() : Doc
  • ignoreAccents() : search
  • ignoreAsianCharacterWidth() : search
  • importAnFDF() : Doc
  • importAnXFDF() : Doc
  • importDataObject() : Doc
  • importTextData() : Doc
  • info() : Doc
  • initState() : OCG
  • inReplyTo() : Annotation
  • insertChild() : Bookmark
  • insertItemAt() : Field
  • insertPages() : Doc
  • intent() : Annotation
  • isBoxChecked() : Field
  • isDefaultChecked() : Field
  • issuerDN() : Certificate


Javascript API: Class Members - Functions

- k -

  • keyUsage() : Certificate
  • keywords() : Doc


Javascript API: Class Members - Functions

- l -

  • language() : app
  • launchURL() : app
  • layout() : Doc
  • leaderExtend() : Annotation
  • leaderLength() : Annotation
  • lineEnding() : Annotation
  • lineWidth() : Field
  • listMenuItems() : app
  • lock() : Annotation
  • locked() : OCG


Javascript API: Class Members - Functions

- m -

  • mailDoc() : Doc
  • mailForm() : Doc
  • mailMsg() : app
  • markup() : search
  • matchCase() : search
  • matchWholeWord() : search
  • maxDocs() : search
  • MD5Hash() : Certificate
  • media() : app , Doc
  • MIMEType() : attachment
  • modDate() : Annotation , attachment , Doc
  • mouseX() : Doc
  • mouseY() : Doc
  • movePage() : Doc
  • multiline() : Field
  • multipleSelection() : Field


Javascript API: Class Members - Functions

- n -

  • name() : Annotation , attachment , Bookmark , Field , Index , OCG
  • newDoc() : app
  • newPage() : Doc
  • noteIcon() : Annotation
  • noView() : Annotation
  • numFields() : Doc
  • numItems() : Field
  • numPages() : Doc


Javascript API: Class Members - Functions

- o -

  • opacity() : Annotation
  • open() : Bookmark
  • openDoc() : app


Javascript API: Class Members - Functions

- p -

  • page() : Annotation , Field
  • pageNum() : Doc
  • pageWindowRect() : Doc
  • parent() : Bookmark
  • password() : Field
  • path() : attachment , Doc , Index
  • platform() : app
  • point() : Annotation
  • points() : Annotation
  • popUpMenu() : app
  • popUpMenuEx() : app
  • popupOpen() : Annotation
  • popupRect() : Annotation
  • print() : Annotation , Doc , Field
  • printerNames() : app
  • println() : console
  • privateKeyValidityEnd() : Certificate
  • privateKeyValidityStart() : Certificate
  • producer() : Doc
  • proximity() : search


Javascript API: Class Members - Functions

- q -

  • quads() : Annotation
  • query() : search


Javascript API: Class Members - Functions

- r -

  • radiosInUnison() : Field
  • readOnly() : Annotation
  • readonly() : Field
  • rect() : Annotation , Field , Link
  • refType() : Annotation
  • remove() : Bookmark
  • removeDataObject() : Doc
  • removeField() : Doc
  • removeIndex() : search
  • removeLinks() : Doc
  • removeTemplate() : Doc
  • removeWeblinks() : Doc
  • replacePages() : Doc
  • required() : Field
  • resetForm() : Doc
  • response() : app
  • richText() : Field
  • richValue() : Field
  • rotation() : Field
  • runtimeHighlight() : app
  • runtimeHighlightColor() : app


Javascript API: Class Members - Functions

- s -

  • scroll() : Doc
  • securityHandler() : Doc
  • selected() : Index
  • serialNumber() : Certificate
  • setAction() : Bookmark , Field , Link , OCG
  • setFocus() : Field
  • setInterval() : app
  • setItems() : Field
  • setLock() : Field
  • setOCGOrder() : Doc
  • setPageBoxes() : Doc
  • setPageRotations() : Doc
  • setPageTabOrder() : Doc
  • setPageTransitions() : Doc
  • setTimeOut() : app
  • SHA1Hash() : Certificate
  • show() : console
  • signatureGetModifications() : Field
  • signatureGetSeedValue() : Field
  • signatureInfo() : Field
  • signatureSetSeedValue() : Field
  • signatureSign() : Field
  • signatureValidate() : Field
  • size() : attachment
  • soundIcon() : Annotation
  • state() : OCG
  • stem() : search
  • strikethrough() : Span
  • strokeColor() : Annotation , Field
  • style() : Annotation , Field
  • subject() : Annotation , Doc
  • subjectCN() : Certificate
  • subjectDN() : Certificate
  • submitForm() : Doc
  • submitName() : Field
  • subscript() : Span
  • superscript() : Span
  • syncAnnotScan() : Doc


Javascript API: Class Members - Functions

- t -

  • templates() : Doc
  • text() : Span
  • textColor() : Field , Span
  • textFont() : Annotation , Field
  • textSize() : Annotation , Field , Span
  • title() : Doc
  • toggleNoView() : Annotation
  • type() : Annotation , Field


Javascript API: Class Members - Functions

- u -

  • underline() : Span
  • URL() : Doc
  • userName() : Field


Javascript API: Class Members - Functions

- v -

  • validityEnd() : Certificate
  • validityStart() : Certificate
  • value() : Field
  • valueAsString() : Field
  • vertices() : Annotation
  • viewerType() : app
  • viewerVariation() : app
  • viewerVersion() : app


Javascript API: Class Members - Functions

- w -

  • width() : Annotation
  • wordMatching() : search


Javascript API: Class Members - Functions

- x -

  • xfa() : Doc


Javascript API: Class Members - Functions

- z -

  • zoom() : Doc
  • zoomType() : Doc


Javascript API: File List

File List
Here is a list of all documented files with brief descriptions:
annotation.h | JavaScript API for attachment
app.h | JavaScript API for app
bookmark.h | JavaScript API for Bookmark
certificate.h | JavaScript API for Certificate
console.h | JavaScript API for console
document.h | JavaScript API for Doc object
field.h | JavaScript API for Field
link.h | JavaScript API for Link
ocg.h | JavaScript API for OCG
search.h | JavaScript API for Index
span.h | JavaScript API for Span


Javascript API: annotation.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
annotation.h File Reference

JavaScript API for attachment. More...

Go to the source code of this file.

Classes

class | attachment
The annotAttachment object represents the file stored as the attachment for a FileAttachment type annotation. annotAttachment is similar to the Data object and represents the file content and metadata of the attachment. More...
class | Annotation
This object represents an Phantom annotation. Annotations can be created using the Phantom annotation tool or by using the Doc object method addAnnot. Before an annotation can be accessed, it must be bound to a JavaScript variable through a Doc object method such as getAnnot: var a = this.getAnnot(0, "f70f59c4-2dc8-4512-b15c-abdc90376c36"); The script can then manipulate the annotation named"f70f59c4-2dc8-4512-b15c-abdc90376c36" on page 1 (0-based page numbering system) by means of the variable a. For example, the following code first stores the type of annotation in the variable thetype, then changes the author to “John Q. Public”. var thetype = a.type; // read property a.author = "John Q. Public"; // write property Another way of accessing the Annotation object is through the Doc object getAnnots method. More...

Detailed Description

JavaScript API for Annotation.


Javascript API: app.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
app.h File Reference

JavaScript API for app. More...

Go to the source code of this file.

Classes

class app
This object is used to set and get the properties and to set the JavaScript action of a link. More...


Javascript API: bookmark.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
bookmark.h File Reference

JavaScript API for Bookmark. More...

Go to the source code of this file.

Classes

class Bookmark
A Bookmark object represents a node in the bookmark tree that appears in the bookmarks navigational panel. Bookmarks are typically used as a table of contents allowing the user to navigate quickly to topics of interest. More...


Javascript API: certificate.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
certificate.h File Reference

JavaScript API for Certificate. More...

Go to the source code of this file.

Classes

class Certificate
The Certificate object provides read-only access to the properties of an X.509 public key certificate. More...


Javascript API: console.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
console.h File Reference

JavaScript API for console. More...

Go to the source code of this file.

Classes

class console
The console object is a static object that enables access to the Phantom JavaScript Console for executing JavaScript and displaying debug messages. More...


Javascript API: document.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
document.h File Reference

JavaScript API for Doc object. More...

Go to the source code of this file.

Classes

class Doc
This object provides the interface between a PDF Doc open in the viewer and the JavaScript interpreter. It provides methods and properties for accessing the PDF Doc. More...


Javascript API: field.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
field.h File Reference

JavaScript API for Field. More...

Go to the source code of this file.

Classes

class Field
This object represents an form field (that is, a field created using the form tool or the Doc addField method). In the same manner that a form author can modify an existing field’s properties, such as the border color or font, the JavaScript user can use the Field object to perform the same modifications. More...


Javascript API: link.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
link.h File Reference

JavaScript API for Link. More...

Go to the source code of this file.

Classes

class Link
This object is used to set and get the properties and to set the JavaScript action of a link. More...


Javascript API: ocg.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
ocg.h File Reference

JavaScript API for OCG. More...

Go to the source code of this file.

Classes

class OCG
An OCG object represents an optional content group in a PDF file. Content in the file can belong to one or more optional content groups. Content belonging to one or more OCGs is referred to as optional content and its visibility is determined by the states (ON or OFF) of the OCGs to which it belongs. In the simplest case, optional content belongs to a single OCG, with the content being visible when the OCG is on and hidden when the OCG is off. More advanced visibility behavior can be achieved by using multiple OCGs and different visibility mappings. Use the Doc getOCGs method to get an array of OCG objects for a PDF document. The Doc methods addWatermarkFromFile and addWatermarkFromText add watermarks in an OCG. See the PDF Reference for additional details on optional content groups. More...


Javascript API: search.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
search.h File Reference

JavaScript API for Index. More...

Go to the source code of this file.

Classes

class | Index
An object that represents a Catalog-generated index. It is non-creatable and returned by various methods of the search object and catalog object. You use this object to perform various indexing operations using Catalog. You can find the status of the index with a search. More...
class | search
The search object is a static object that accesses the functionality provided by the Phantom Search plug-in. This plug-in must be installed to interface with the search object (see available). See also the Index object, which is returned by some of the methods of the search object. The results for query calls are displayed in the Find dialog box of Phantom. More...

Detailed Description

JavaScript API for search.


Javascript API: span.h File Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
Classes
span.h File Reference

JavaScript API for Span. More...

Go to the source code of this file.

Classes

class Span
A generic object that represents a length of text and its associated properties in a rich text form field or annotation. A rich text value consists of an array of span objects representing the text and formatting. More...


Javascript API: inc Directory Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
inc Directory Reference

Files

file | annotation.h [code]
JavaScript API for attachment.
file | app.h [code]
JavaScript API for app.
file | bookmark.h [code]
JavaScript API for Bookmark.
file | certificate.h [code]
JavaScript API for Certificate.
file | console.h [code]
JavaScript API for console.
file | document.h [code]
JavaScript API for Doc object.
file | field.h [code]
JavaScript API for Field.
file | link.h [code]
JavaScript API for Link.
file | ocg.h [code]
JavaScript API for OCG.
file | search.h [code]
JavaScript API for Index.
file | span.h [code]
JavaScript API for Span.


Javascript API: workspace Directory Reference

  • G:
  • workspace
workspace Directory Reference


Javascript API: javascript Directory Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
javascript Directory Reference

Directories

Generated by doxygen 1.8.15


Javascript API: G: Directory Reference

  • G:
G: Directory Reference


Javascript API: interaction Directory Reference

  • G:
  • workspace
  • javascript
  • interaction
interaction Directory Reference


Javascript API: src Directory Reference

  • G:
  • workspace
  • javascript
  • interaction
  • src
src Directory Reference


Javascript API: javascript Directory Reference

  • G:
  • workspace
  • javascript
javascript Directory Reference


Javascript API: Main Page

Javascript API Documentation


Javascript API: certificate.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
certificate.h
Go to the documentation of this file.
1 #ifndef CERTIFICATE_H_
2 #define CERTIFICATE_H_
3
5 namespace javascript
6 {
7 /*enum CERT_IDENTITY_TYPE
8 {
9 CERT_ISSUER = 0,
10 CERT_USER
11 };*/
12
13 class RDN : public CFXJS_EmbedObj
14 {
15 public:
16 RDN(CFXJS_Object* pJSObject);
17 virtual ~RDN(void);
18
19 FX_BOOL c(OBJ_PROP_PARAMS);
20 FX_BOOL cn(OBJ_PROP_PARAMS);
21 FX_BOOL e(OBJ_PROP_PARAMS);
22 FX_BOOL l(OBJ_PROP_PARAMS);
23
24 FX_BOOL o(OBJ_PROP_PARAMS);
25 FX_BOOL ou(OBJ_PROP_PARAMS);
26 FX_BOOL st(OBJ_PROP_PARAMS);
27
28 public:
29
30 void SetCertMgr(IFXJS_CertificateProvider *pCertMgr) { m_pCertMgr = pCertMgr; }
31 void SetCertIndentify(const JS_CERT_IDENTITY_TYPE& certIdentityType) { m_certIdentityType = certIdentityType; }
32
33
34 private:
35
36 IFXJS_CertificateProvider * m_pCertMgr;
37 JS_CERT_IDENTITY_TYPE m_certIdentityType;
38
39 };
40
41
42 class CFXJS_RDN : public CFXJS_Object
43 {
44 public:
45 CFXJS_RDN(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
46 virtual ~CFXJS_RDN(void) {};
47
48 DECLARE_JS_DYNAMIC_CLASS(CFXJS_RDN);
49
50 JS_STATIC_PROP(c, RDN);
51 JS_STATIC_PROP(cn, RDN);
52 JS_STATIC_PROP(e, RDN);
53 JS_STATIC_PROP(l, RDN);
54
55 JS_STATIC_PROP(o, RDN);
56 JS_STATIC_PROP(ou, RDN);
57 JS_STATIC_PROP(st, RDN);
58 };
59
61
69 class Certificate : public CFXJS_EmbedObj
70 {
71 public:
72 Certificate(CFXJS_Object* pJSObject);
73 virtual ~Certificate(void);
84 FX_BOOL binary(OBJ_PROP_PARAMS);
95 FX_BOOL issuerDN(OBJ_PROP_PARAMS);
109 FX_BOOL keyUsage(OBJ_PROP_PARAMS);
120 FX_BOOL MD5Hash(OBJ_PROP_PARAMS);
131 FX_BOOL privateKeyValidityEnd(OBJ_PROP_PARAMS);
142 FX_BOOL privateKeyValidityStart(OBJ_PROP_PARAMS);
153 FX_BOOL SHA1Hash(OBJ_PROP_PARAMS);
164 FX_BOOL serialNumber(OBJ_PROP_PARAMS);
175 FX_BOOL subjectCN(OBJ_PROP_PARAMS);
186 FX_BOOL subjectDN(OBJ_PROP_PARAMS);
187
188 FX_BOOL usage(OBJ_PROP_PARAMS);
199 FX_BOOL validityEnd(OBJ_PROP_PARAMS);
210 FX_BOOL validityStart(OBJ_PROP_PARAMS);
211
212 public:
213 FX_BOOL SetCertPath(CFX_WideString cwCertPath);
214 FX_BOOL SetCertData(FX_BYTE *pbData, FX_DWORD cbData);
215
216 CFX_ByteString GetCertData();
217 IFXJS_CertificateProvider *GetCertMgr();
218 private:
219 void CreateRdnObjectAndSet(FXJSE_HVALUE hValue, JS_CERT_IDENTITY_TYPE type);
220 IFXJS_CertificateProvider* m_pCertMgr;
221 };
222
223
224 class CFXJS_Certificate : public CFXJS_Object
225 {
226 public:
227 CFXJS_Certificate(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
228 virtual ~CFXJS_Certificate(void) {};
229
230 DECLARE_JS_DYNAMIC_CLASS(CFXJS_Certificate);
231
232 JS_STATIC_PROP(binary, Certificate);
233 JS_STATIC_PROP(issuerDN, Certificate);
234 JS_STATIC_PROP(keyUsage, Certificate);
235 JS_STATIC_PROP(MD5Hash, Certificate);
236
237 JS_STATIC_PROP(privateKeyValidityEnd, Certificate);
238 JS_STATIC_PROP(privateKeyValidityStart, Certificate);
239
240 JS_STATIC_PROP(SHA1Hash, Certificate);
241 JS_STATIC_PROP(serialNumber, Certificate);
242 JS_STATIC_PROP(subjectCN, Certificate);
243 JS_STATIC_PROP(subjectDN, Certificate);
244 JS_STATIC_PROP(usage, Certificate);
245
246 JS_STATIC_PROP(validityEnd, Certificate);
247 JS_STATIC_PROP(validityStart, Certificate);
248 };
249
250 #endif //CERTIFICATE_H_
251 }
Certificate
The Certificate object provides read-only access to the properties of an X.509 public key certificate...
Definition: certificate.h:69


Javascript API: console.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
console.h
Go to the documentation of this file.
1 #ifndef _CONSOLE_H_
2 #define _CONSOLE_H_
3
5 namespace javascript
6 {
8
17 class console : public CFXJS_EmbedObj
18 {
19 public:
20 console(CFXJS_Object* pJSObject);
21 virtual ~console(void);
22
23 public:
24
28 FX_BOOL clear(OBJ_METHOD_PARAMS);
29
33 FX_BOOL hide(OBJ_METHOD_PARAMS);
34
68 FX_BOOL println(OBJ_METHOD_PARAMS);
69
79 FX_BOOL show(OBJ_METHOD_PARAMS);
80 };
81
82 class CFXJS_Console : public CFXJS_Object
83 {
84 public:
85 CFXJS_Console(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
86 virtual ~CFXJS_Console(void) {};
87
88 DECLARE_JS_CLASS(CFXJS_Console);
89
90 JS_STATIC_METHOD(clear, console);
91 JS_STATIC_METHOD(hide, console);
92 JS_STATIC_METHOD(println, console);
93 JS_STATIC_METHOD(show, console);
94 };
95 }
96
97 #endif //_CONSOLE_H_
98
console
The console object is a static object that enables access to the Phantom JavaScript Console for execu...
Definition: console.h:17


Javascript API: Member List

Field Member List

This is the complete list of members for Field, including all inherited members.

alignment(OBJ_PROP_PARAMS) | Field
borderStyle(OBJ_PROP_PARAMS) | Field
browseForFileToSubmit(OBJ_METHOD_PARAMS) | Field
buttonFitBounds(OBJ_PROP_PARAMS) | Field
buttonGetCaption(OBJ_METHOD_PARAMS) | Field
buttonGetIcon(OBJ_METHOD_PARAMS) | Field
buttonPosition(OBJ_PROP_PARAMS) | Field
buttonScaleHow(OBJ_PROP_PARAMS) | Field
buttonScaleWhen(OBJ_PROP_PARAMS) | Field
buttonSetCaption(OBJ_METHOD_PARAMS) | Field
buttonSetIcon(OBJ_METHOD_PARAMS) | Field
calcOrderIndex(OBJ_PROP_PARAMS) | Field
charLimit(OBJ_PROP_PARAMS) | Field
checkThisBox(OBJ_METHOD_PARAMS) | Field
clearItems(OBJ_METHOD_PARAMS) | Field
comb(OBJ_PROP_PARAMS) | Field
commitOnSelChange(OBJ_PROP_PARAMS) | Field
currentValueIndices(OBJ_PROP_PARAMS) | Field
defaultIsChecked(OBJ_METHOD_PARAMS) | Field
defaultStyle(OBJ_PROP_PARAMS) | Field
defaultValue(OBJ_PROP_PARAMS) | Field
delay(OBJ_PROP_PARAMS) | Field
deleteItemAt(OBJ_METHOD_PARAMS) | Field
display(OBJ_PROP_PARAMS) | Field
doc(OBJ_PROP_PARAMS) | Field
doNotScroll(OBJ_PROP_PARAMS) | Field
doNotSpellCheck(OBJ_PROP_PARAMS) | Field
editable(OBJ_PROP_PARAMS) | Field
exportValues(OBJ_PROP_PARAMS) | Field
fileSelect(OBJ_PROP_PARAMS) | Field
fillColor(OBJ_PROP_PARAMS) | Field
getArray(OBJ_METHOD_PARAMS) | Field
getItemAt(OBJ_METHOD_PARAMS) | Field
getLock(OBJ_METHOD_PARAMS) | Field
hidden(OBJ_PROP_PARAMS) | Field
highlight(OBJ_PROP_PARAMS) | Field
insertItemAt(OBJ_METHOD_PARAMS) | Field
isBoxChecked(OBJ_METHOD_PARAMS) | Field
isDefaultChecked(OBJ_METHOD_PARAMS) | Field
lineWidth(OBJ_PROP_PARAMS) | Field
multiline(OBJ_PROP_PARAMS) | Field
multipleSelection(OBJ_PROP_PARAMS) | Field
name(OBJ_PROP_PARAMS) | Field
numItems(OBJ_PROP_PARAMS) | Field
page(OBJ_PROP_PARAMS) | Field
password(OBJ_PROP_PARAMS) | Field
print(OBJ_PROP_PARAMS) | Field
radiosInUnison(OBJ_PROP_PARAMS) | Field
readonly(OBJ_PROP_PARAMS) | Field
rect(OBJ_PROP_PARAMS) | Field
required(OBJ_PROP_PARAMS) | Field
richText(OBJ_PROP_PARAMS) | Field
richValue(OBJ_PROP_PARAMS) | Field
rotation(OBJ_PROP_PARAMS) | Field
setAction(OBJ_METHOD_PARAMS) | Field
setFocus(OBJ_METHOD_PARAMS) | Field
setItems(OBJ_METHOD_PARAMS) | Field
setLock(OBJ_METHOD_PARAMS) | Field
signatureGetModifications(OBJ_METHOD_PARAMS) | Field
signatureGetSeedValue(OBJ_METHOD_PARAMS) | Field
signatureInfo(OBJ_METHOD_PARAMS) | Field
signatureSetSeedValue(OBJ_METHOD_PARAMS) | Field
signatureSign(OBJ_METHOD_PARAMS) | Field
signatureValidate(OBJ_METHOD_PARAMS) | Field
strokeColor(OBJ_PROP_PARAMS) | Field
style(OBJ_PROP_PARAMS) | Field
submitName(OBJ_PROP_PARAMS) | Field
textColor(OBJ_PROP_PARAMS) | Field
textFont(OBJ_PROP_PARAMS) | Field
textSize(OBJ_PROP_PARAMS) | Field
type(OBJ_PROP_PARAMS) | Field
userName(OBJ_PROP_PARAMS) | Field
value(OBJ_PROP_PARAMS) | Field
valueAsString(OBJ_PROP_PARAMS) | Field


Javascript API: app.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
app.h
Go to the documentation of this file.
1 #ifndef _APP_H_
2 #define _APP_H_
3
4 #include "js_interface.h"
5 #include "js_object.h"
6
8 namespace javascript
9 {
10 class CFXJS_Runtime;
11 class CFXJS_Timer;
12
13 #define JS_STR_VIEWERTYPE_READER L"Reader"
14 #define JS_STR_VIEWERTYPE_STANDARD L"Exchange"
15 #define JS_STR_VIEWERVARIATION L"Full"
16 #define JS_STR_APPVERSION L"Foxit"
17 #define JS_STR_VIEWERVERSION 11.007
18 #define JS_NUM_FORMSVERSION 11
19
20 #if _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_ || _FX_OS_ == _FX_WIN32_DESKTOP_
21 #define JS_STR_PLATFORM L"WIN"
22 #elif _FX_OS_ == _FX_SOLARIS_ || _FX_OS_ == _FX_LINUX_EMBEDDED_ || _FX_OS_ == _FX_LINUX_DESKTOP_
23 #define JS_STR_PLATFORM L"LINUX"
24 #elif _FX_OS_ == _FX_IOS_
25 #define JS_STR_PLATFORM L"IOS"
26 #elif _FX_OS_ == _FX_MACOSX_
27 #define JS_STR_PLATFORM L"MAC"
28 #elif _FX_OS_ == _FX_ANDROID_
29 #define JS_STR_PLATFORM L"ANDROID"
30 #else
31 #define JS_STR_PLATFORM L"UNKNOWN"
32 #endif
33
34 class Thermometer :public CFXJS_EmbedObj
35 {
36 public:
37 Thermometer(CFXJS_Object* pJSObject) : CFXJS_EmbedObj(pJSObject) {}
38 virtual ~Thermometer() {}
39
40 public:
41 FX_BOOL cancelled(OBJ_PROP_PARAMS);
42 FX_BOOL duration(OBJ_PROP_PARAMS);
43 FX_BOOL text(OBJ_PROP_PARAMS);
44 FX_BOOL value(OBJ_PROP_PARAMS);
45
46 FX_BOOL begin(OBJ_METHOD_PARAMS);
47 FX_BOOL end(OBJ_METHOD_PARAMS);
48 };
49
50 class CFXJS_Thermometer : public CFXJS_Object
51 {
52 public:
53 CFXJS_Thermometer(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {}
54 virtual ~CFXJS_Thermometer() {}
55
56 DECLARE_JS_CLASS(CFXJS_Thermometer)
57
58 JS_STATIC_PROP(cancelled, Thermometer)
59 JS_STATIC_PROP(duration, Thermometer)
60 JS_STATIC_PROP(text, Thermometer)
61 JS_STATIC_PROP(value, Thermometer)
62
63 JS_STATIC_METHOD(begin, Thermometer)
64 JS_STATIC_METHOD(end, Thermometer)
65 };
66
67 /******************************************************************************/
68 /* timer object */
69 /******************************************************************************/
70
71 class TimerObj : public CFXJS_EmbedObj
72 {
73 public:
74 TimerObj(CFXJS_Object* pJSObject);
75 virtual ~TimerObj();
76
77 public:
78 void SetTimer(CFXJS_Timer* pTimer);
79 CFXJS_Timer* GetTimer() const;
80
81 private:
82 CFXJS_Timer * m_pTimer;
83 };
84
85 class CFXJS_TimerObj : public CFXJS_Object
86 {
87 public:
88 CFXJS_TimerObj(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {}
89 virtual ~CFXJS_TimerObj() {}
90
91 DECLARE_JS_CLASS(CFXJS_TimerObj);
92 };
93
94
95 class TreeItem : public CFXJS_EmbedObj
96 {
97 public:
98 TreeItem(CFXJS_Object* pJSObject) : CFXJS_EmbedObj(pJSObject) {}
99 virtual ~TreeItem() {}
100
101 public:
102 FX_BOOL cName(OBJ_PROP_PARAMS);
103 FX_BOOL oChildren(OBJ_PROP_PARAMS);
104
105 void SetEleName(const CFX_ByteString& csEleName) { m_csEleName = csEleName; }
106 void SetCateName(const CFX_ByteString& csCateName) { m_csCateName = csCateName; }
107 void SetPanelName(const CFX_ByteString& csPanelName) { m_csPanelName = csPanelName; }
108
109 static void CreateTreeItem(FXJSE_HVALUE hProp, const CFX_ByteString& csCategory, const CFX_ByteString& csPanel,
110 const CFX_ByteString& csEle, CFXJS_Runtime* pRuntime, std::vector<std::unique_ptr<CFXJS_Object>> & Objects);
111
112 private:
113 CFX_ByteString m_csEleName = "";
114 CFX_ByteString m_csCateName = "";
115 CFX_ByteString m_csPanelName = "";
116 };
117
118 class CFXJS_TreeItem : public CFXJS_Object
119 {
120 public:
121 CFXJS_TreeItem(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {}
122 virtual ~CFXJS_TreeItem() {}
123
124 DECLARE_JS_CLASS(CFXJS_TreeItem);
125
126 JS_STATIC_PROP(cName, TreeItem);
127 JS_STATIC_PROP(oChildren, TreeItem);
128 };
129
130 //*****************************************************************************
131 //* app
132 //*****************************************************************************
134
143 class app : public CFXJS_EmbedObj
144 {
145 public:
146 app(CFXJS_Object * pJSObject);
147 virtual ~app();
148
149 public:
170 FX_BOOL activeDocs(OBJ_PROP_PARAMS);
181 FX_BOOL calculate(OBJ_PROP_PARAMS);
182 FX_BOOL formsVersion(OBJ_PROP_PARAMS);
197 FX_BOOL fs(OBJ_PROP_PARAMS);
210 FX_BOOL fullscreen(OBJ_PROP_PARAMS);
242 FX_BOOL language(OBJ_PROP_PARAMS);
243
244 FX_BOOL plugIns(OBJ_PROP_PARAMS);
262 FX_BOOL printerNames(OBJ_PROP_PARAMS);
273 FX_BOOL media(OBJ_PROP_PARAMS);
291 FX_BOOL platform(OBJ_PROP_PARAMS);
311 FX_BOOL runtimeHighlight(OBJ_PROP_PARAMS);
327 FX_BOOL runtimeHighlightColor(OBJ_PROP_PARAMS);
342 FX_BOOL viewerType(OBJ_PROP_PARAMS);
361 FX_BOOL viewerVariation(OBJ_PROP_PARAMS);
376 FX_BOOL viewerVersion(OBJ_PROP_PARAMS);
377 FX_BOOL appVersion(OBJ_PROP_PARAMS);
378 FX_BOOL isFoxit(OBJ_PROP_PARAMS);
379 FX_BOOL appFoxitVersion(OBJ_PROP_PARAMS);
380 FX_BOOL persistentData(OBJ_PROP_PARAMS);
381 FX_BOOL user(OBJ_PROP_PARAMS);
382 FX_BOOL constants(OBJ_PROP_PARAMS);
383 FX_BOOL thermometer(OBJ_PROP_PARAMS);
411 FX_BOOL alert(OBJ_METHOD_PARAMS);
421 FX_BOOL beep(OBJ_METHOD_PARAMS);
457 FX_BOOL browseForDoc(OBJ_METHOD_PARAMS);
471 FX_BOOL clearInterval(OBJ_METHOD_PARAMS);
485 FX_BOOL clearTimeOut(OBJ_METHOD_PARAMS);
984 FX_BOOL execDialog(OBJ_METHOD_PARAMS);
1019 FX_BOOL execMenuItem(OBJ_METHOD_PARAMS);
1020 FX_BOOL findComponent(OBJ_METHOD_PARAMS);
1021 FX_BOOL goBack(OBJ_METHOD_PARAMS);
1022 FX_BOOL goForward(OBJ_METHOD_PARAMS);
1036 FX_BOOL launchURL(OBJ_METHOD_PARAMS);
1069 FX_BOOL mailMsg(OBJ_METHOD_PARAMS);
1070 FX_BOOL newFDF(OBJ_METHOD_PARAMS);
1084 FX_BOOL newDoc(OBJ_METHOD_PARAMS);
1102 FX_BOOL openDoc(OBJ_METHOD_PARAMS);
1103 FX_BOOL openFDF(OBJ_METHOD_PARAMS);
1143 FX_BOOL popUpMenuEx(OBJ_METHOD_PARAMS);
1164 FX_BOOL popUpMenu(OBJ_METHOD_PARAMS);
1193 FX_BOOL response(OBJ_METHOD_PARAMS);
1225 FX_BOOL setInterval(OBJ_METHOD_PARAMS);
1266 FX_BOOL setTimeOut(OBJ_METHOD_PARAMS);
1267 FX_BOOL execProgress(OBJ_METHOD_PARAMS);
1268 FX_BOOL addListeners(OBJ_METHOD_PARAMS);
1269 FX_BOOL deleteListeners(OBJ_METHOD_PARAMS);
1270 FX_BOOL onInitView(OBJ_METHOD_PARAMS);
1271 FX_BOOL getObject(OBJ_METHOD_PARAMS);
1272 FX_BOOL addListener(OBJ_METHOD_PARAMS);
1273 FX_BOOL getCurDoc(OBJ_METHOD_PARAMS);
1274 FX_BOOL sendEmail(OBJ_METHOD_PARAMS);
1275 FX_BOOL execHtmlDialog(OBJ_METHOD_PARAMS);
1276 FX_BOOL httpRequest(OBJ_METHOD_PARAMS);
1277 FX_BOOL getInfo(OBJ_METHOD_PARAMS);
1278 FX_BOOL loginWithUI(OBJ_METHOD_PARAMS);
1279 FX_BOOL signOut(OBJ_METHOD_PARAMS);
1280 FX_BOOL getDigestId(OBJ_METHOD_PARAMS);
1281 FX_BOOL log(OBJ_METHOD_PARAMS);
1282 FX_BOOL initPlugin(OBJ_METHOD_PARAMS);
1283 FX_BOOL registerDRMHandler(OBJ_METHOD_PARAMS);
1284 FX_BOOL enableToolButton(OBJ_METHOD_PARAMS);;
1285 FX_BOOL activateCategory(OBJ_METHOD_PARAMS);
1286 FX_BOOL encryptDocument(OBJ_METHOD_PARAMS);
1287 FX_BOOL removeEncryption(OBJ_METHOD_PARAMS);
1288 FX_BOOL loadHtmlView(OBJ_METHOD_PARAMS);
1289 FX_BOOL closeDoc(OBJ_METHOD_PARAMS);
1290 FX_BOOL expandPanel(OBJ_METHOD_PARAMS);
1291 FX_BOOL setHotPoint(OBJ_METHOD_PARAMS);
1292 FX_BOOL isPanelActivate(OBJ_METHOD_PARAMS);
1293 FX_BOOL opencPDFWebPage(OBJ_METHOD_PARAMS);
1294 FX_BOOL addFocusedDoc(OBJ_METHOD_PARAMS);
1295 FX_BOOL doOpenMessage(OBJ_METHOD_PARAMS);
1296 FX_BOOL showAllPinNote(OBJ_METHOD_PARAMS);
1297 FX_BOOL isShowAllPinNote(OBJ_METHOD_PARAMS);
1298
1336 FX_BOOL addMenuItem(OBJ_METHOD_PARAMS);
1337 FX_BOOL addSubMenu(OBJ_METHOD_PARAMS);
1338 FX_BOOL addToolButton(OBJ_METHOD_PARAMS);
1339 FX_BOOL removeToolButton(OBJ_METHOD_PARAMS);
1368 FX_BOOL listMenuItems(OBJ_METHOD_PARAMS);
1369
1370 private:
1371 void TimerProc(CFXJS_Timer* pTimer);
1372 void RunJsScript(CFXJS_Runtime * pRuntime, const CFX_WideString & wsScript);
1373 void ParsePopupMenuObj(FX_MenuItemEx * pMenuItem, FXJSE_HVALUE pObj);
1374 void DeleteMenuItems(FX_MenuItemExArray* pMenuItems);
1375 void ParserMenuItem(FX_Menu* pHead, CFX_ArrayTemplate<FXJSE_HVALUE>& args);
1376 void DestroyMenuItems(FX_Menu* pHead);
1377
1378 public:
1379 CFX_WideString GetAppInfo(AppInfoType type, CFXJS_Context* cc);
1380 static FX_BOOL CallbackExecHtmlDialogMessasge(CFX_Object* JsApp,FXJSE_HVALUE param);
1381 void OnExecHtmlDialog(FXJSE_HVALUE hDlgParam);
1382 private:
1383 FX_BOOL m_bCalculate;
1384 CFXJS_Runtime* m_pRuntime;
1385 FX_BOOL m_bRuntimeHighLight;
1386 CFX_ArrayTemplate<CFXJS_Timer*> m_aTimer;
1387 };
1388
1389 class CFXJS_App : public CFXJS_Object
1390 {
1391 public:
1392 CFXJS_App(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
1393 virtual ~CFXJS_App(void) {};
1394
1395 DECLARE_JS_CLASS(CFXJS_App);
1396
1397 JS_STATIC_PROP(activeDocs, app);
1398 JS_STATIC_PROP(calculate, app);
1399 JS_STATIC_PROP(formsVersion, app);
1400 JS_STATIC_PROP(fs, app);
1401 JS_STATIC_PROP(fullscreen, app);
1402 JS_STATIC_PROP(language, app);
1403 JS_STATIC_PROP(media, app);
1404 JS_STATIC_PROP(platform, app);
1405 JS_STATIC_PROP(runtimeHighlight, app);
1406 JS_STATIC_PROP(runtimeHighlightColor, app);
1407 JS_STATIC_PROP(viewerType, app);
1408 JS_STATIC_PROP(viewerVariation, app);
1409 JS_STATIC_PROP(viewerVersion, app);
1410 JS_STATIC_PROP(isFoxit, app);
1411 JS_STATIC_PROP(plugIns, app);
1412 JS_STATIC_PROP(printerNames, app);
1413 JS_STATIC_PROP(appVersion, app);
1414 JS_STATIC_PROP(appFoxitVersion, app);
1415 JS_STATIC_PROP(persistentData, app);
1416 JS_STATIC_PROP(user, app);
1417 JS_STATIC_PROP(constants, app);
1418 JS_STATIC_PROP(thermometer, app);
1419
1420 JS_STATIC_METHOD(alert, app);
1421 JS_STATIC_METHOD(beep, app);
1422 JS_STATIC_METHOD(browseForDoc, app);
1423 JS_STATIC_METHOD(clearInterval, app);
1424 JS_STATIC_METHOD(clearTimeOut, app);
1425 JS_STATIC_METHOD(execDialog, app);
1426 JS_STATIC_METHOD(execMenuItem, app);
1427 JS_STATIC_METHOD(findComponent, app);
1428 JS_STATIC_METHOD(goBack, app);
1429 JS_STATIC_METHOD(goForward, app);
1430 JS_STATIC_METHOD(launchURL, app);
1431 JS_STATIC_METHOD(mailMsg, app);
1432 JS_STATIC_METHOD(newFDF, app);
1433 JS_STATIC_METHOD(newDoc, app);
1434 JS_STATIC_METHOD(openDoc, app);
1435 JS_STATIC_METHOD(openFDF, app);
1436 JS_STATIC_METHOD(popUpMenuEx, app);
1437 JS_STATIC_METHOD(popUpMenu, app);
1438 JS_STATIC_METHOD(response, app);
1439 JS_STATIC_METHOD(setInterval, app);
1440 JS_STATIC_METHOD(setTimeOut, app);
1441 JS_STATIC_METHOD(execProgress, app);
1442 JS_STATIC_METHOD(addListeners, app);
1443 JS_STATIC_METHOD(deleteListeners, app);
1444 JS_STATIC_METHOD(onInitView, app);
1445 JS_STATIC_METHOD(getObject, app);
1446 JS_STATIC_METHOD(addListener, app);
1447 JS_STATIC_METHOD(getCurDoc, app);
1448 JS_STATIC_METHOD(sendEmail, app);
1449 JS_STATIC_METHOD(execHtmlDialog, app);
1450 JS_STATIC_METHOD(httpRequest, app);
1451 JS_STATIC_METHOD(getInfo, app);
1452 JS_STATIC_METHOD(loginWithUI, app);
1453 JS_STATIC_METHOD(signOut, app);
1454 JS_STATIC_METHOD(getDigestId, app);
1455 JS_STATIC_METHOD(log, app);
1456 JS_STATIC_METHOD(initPlugin, app);
1457 JS_STATIC_METHOD(registerDRMHandler, app);
1458 JS_STATIC_METHOD(enableToolButton, app);
1459 JS_STATIC_METHOD(activateCategory, app);
1460 JS_STATIC_METHOD(encryptDocument, app);
1461 JS_STATIC_METHOD(removeEncryption, app);
1462 JS_STATIC_METHOD(loadHtmlView, app);
1463 JS_STATIC_METHOD(closeDoc, app);
1464 JS_STATIC_METHOD(expandPanel, app);
1465 JS_STATIC_METHOD(setHotPoint, app);
1466 JS_STATIC_METHOD(isPanelActivate, app);
1467 JS_STATIC_METHOD(opencPDFWebPage, app);
1468 JS_STATIC_METHOD(addFocusedDoc, app);
1469 JS_STATIC_METHOD(doOpenMessage, app);
1470 JS_STATIC_METHOD(showAllPinNote, app);
1471 JS_STATIC_METHOD(isShowAllPinNote, app);
1472 JS_STATIC_METHOD(addMenuItem, app)
1473 JS_STATIC_METHOD(listMenuItems, app)
1474 JS_STATIC_METHOD(addSubMenu, app)
1475 JS_STATIC_METHOD(addToolButton, app)
1476 JS_STATIC_METHOD(removeToolButton, app)
1477 };
1478
1479 class privilegeController : public CFXJS_EmbedObj
1480 {
1481 public:
1482 privilegeController(CFXJS_Object * pJSObject);
1483 virtual ~privilegeController();
1484
1485 public:
1486 FX_BOOL beginTrusted(OBJ_METHOD_PARAMS);
1487 FX_BOOL endTrusted(OBJ_METHOD_PARAMS);
1488 };
1489
1490 class CFXJS_PrivilegeController : public CFXJS_Object
1491 {
1492 public:
1493 CFXJS_PrivilegeController(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {}
1494 virtual ~CFXJS_PrivilegeController() {};
1495
1496 DECLARE_JS_CLASS(CFXJS_PrivilegeController);
1497
1498 JS_STATIC_METHOD(beginTrusted, privilegeController);
1499 JS_STATIC_METHOD(endTrusted, privilegeController);
1500 };
1501
1503 class appInfo : public CFXJS_EmbedObj
1504 {
1505 public:
1506 appInfo(CFXJS_Object* pJSObject);
1507 virtual ~appInfo() {}
1508
1509
1510 FX_BOOL apiVersion(OBJ_PROP_PARAMS);
1511 FX_BOOL capabilities(OBJ_PROP_PARAMS);
1512 FX_BOOL language(OBJ_PROP_PARAMS);
1513 FX_BOOL appVersion(OBJ_PROP_PARAMS);
1514 FX_BOOL appName(OBJ_PROP_PARAMS);
1515 FX_BOOL baseUrl(OBJ_PROP_PARAMS);
1516 FX_BOOL shareUsageData(OBJ_PROP_PARAMS);
1517 FX_BOOL appId(OBJ_PROP_PARAMS);
1518 FX_BOOL isFipsMode(OBJ_PROP_PARAMS);
1519 };
1520
1521 class CFXJS_appInfo : public CFXJS_Object
1522 {
1523 public:
1524 CFXJS_appInfo(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {}
1525 virtual ~CFXJS_appInfo() {}
1526
1527 DECLARE_JS_CLASS(CFXJS_appInfo);
1528
1529 JS_STATIC_PROP(apiVersion, appInfo);
1530 JS_STATIC_PROP(capabilities, appInfo);
1531 JS_STATIC_PROP(language, appInfo);
1532 JS_STATIC_PROP(appVersion, appInfo);
1533 JS_STATIC_PROP(appName, appInfo);
1534 JS_STATIC_PROP(baseUrl, appInfo);
1535 JS_STATIC_PROP(shareUsageData, appInfo);
1536 JS_STATIC_PROP(appId, appInfo);
1537 JS_STATIC_PROP(isFipsMode, appInfo);
1538 };
1539
1540 class CFXJS_ProgressObj;
1541
1542 class ProgressObj : public CFXJS_EmbedObj
1543 {
1544 public:
1545 ProgressObj(CFXJS_Object* pJSObject);
1546 virtual ~ProgressObj();
1547
1548 void SetProgressObj(IFXJS_UIProgressProvider* pUIPro);
1549 IFXJS_UIProgressProvider* GetProgressObj();
1550
1551 FX_BOOL getCurrentValue(OBJ_METHOD_PARAMS);
1552 FX_BOOL setCurrentValue(OBJ_METHOD_PARAMS);
1553 FX_BOOL doCancel(OBJ_METHOD_PARAMS);
1554 FX_BOOL doDestroy(OBJ_METHOD_PARAMS);
1555
1556 private:
1557 IFXJS_UIProgressProvider* m_pProgress;
1558 };
1559
1560 class CFXJS_ProgressObj : public CFXJS_Object
1561 {
1562 public:
1563 CFXJS_ProgressObj(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {}
1564 virtual ~CFXJS_ProgressObj() {}
1565
1566 DECLARE_JS_CLASS(CFXJS_ProgressObj);
1567
1568 JS_STATIC_METHOD(getCurrentValue, ProgressObj);
1569 JS_STATIC_METHOD(setCurrentValue, ProgressObj);
1570 JS_STATIC_METHOD(doCancel, ProgressObj);
1571 JS_STATIC_METHOD(doDestroy, ProgressObj);
1572 };
1573
1574 class app_constants : public CFXJS_EmbedObj
1575 {
1576 public:
1577 app_constants(CFXJS_Object* pJSObject) : CFXJS_EmbedObj(pJSObject) {}
1578 virtual ~app_constants() {}
1579
1580 public:
1581 FX_BOOL align(OBJ_PROP_PARAMS);
1582 };
1583
1584 class CFXJS_app_constants : public CFXJS_Object
1585 {
1586 public:
1587 CFXJS_app_constants(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {}
1588 virtual ~CFXJS_app_constants() {}
1589
1590 DECLARE_JS_CLASS(CFXJS_app_constants);
1591
1592 JS_STATIC_PROP(align, app_constants);
1593 };
1594 }
1595
1596 #endif //_APP_H_
app
This object is used to set and get the properties and to set the JavaScript action of a link.
Definition: app.h:143


Javascript API: ocg.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
ocg.h
Go to the documentation of this file.
1 #ifndef _OCG_H_
2 #define _OCG_H_
3
4
5 #include "fpdfdoc/fpdf_doc.h"
7 namespace javascript
8 {
9 class CFXJS_OCGNotify;
10 class CFXJS_Runtime;
11 class IFXJS_DocumentProvider;
12 class IFXJS_DocViewProvider;
13
14 class states : public CFXJS_EmbedObj
15 {
16 public:
17 states(CFXJS_Object * pJSObject);
18 virtual ~states();
19 public:
20 FX_BOOL on(OBJ_PROP_PARAMS);
21 FX_BOOL off(OBJ_PROP_PARAMS);
22 };
23
24 class CFXJS_States : public CFXJS_Object
25 {
26 public:
27 CFXJS_States(CFXJS_Runtime* pRuntime);
28 virtual ~CFXJS_States() {};
29 public:
30 DECLARE_JS_CLASS(CFXJS_States);
31 JS_STATIC_PROP(on, states);
32 JS_STATIC_PROP(off, states);
33 };
34
35 class intents : public CFXJS_EmbedObj
36 {
37 public:
38 intents(CFXJS_Object * pJSObject);
39 virtual ~intents();
40 public:
41 FX_BOOL view(OBJ_PROP_PARAMS);
42 FX_BOOL design(OBJ_PROP_PARAMS);
43 };
44
45 class CFXJS_Intents : public CFXJS_Object
46 {
47 public:
48 CFXJS_Intents(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
49 virtual ~CFXJS_Intents() {};
50 public:
51 DECLARE_JS_CLASS(CFXJS_Intents);
52 JS_STATIC_PROP(view, intents);
53 JS_STATIC_PROP(design, intents);
54 };
55
56 class constants : public CFXJS_EmbedObj
57 {
58 public:
59 constants(CFXJS_Object * pJSObject);
60 virtual ~constants();
61 public:
62 FX_BOOL intents(OBJ_PROP_PARAMS);
63 FX_BOOL states(OBJ_PROP_PARAMS);
64 };
65
66 class CFXJS_Constants : public CFXJS_Object
67 {
68 public:
69 CFXJS_Constants(CFXJS_Runtime* pRuntime);
70 virtual ~CFXJS_Constants() {};
71 public:
72 DECLARE_JS_CLASS(CFXJS_Constants);
73 JS_STATIC_PROP(intents, constants);
74 JS_STATIC_PROP(states, constants);
75 };
76
78
89 class OCG : public CFXJS_EmbedObj
90 {
91 public:
92 OCG(CFXJS_Object * pJSObject);
93 virtual ~OCG();
94
95 public:
96 FX_BOOL constants(OBJ_PROP_PARAMS);
97
121 FX_BOOL name(OBJ_PROP_PARAMS);
122
144 FX_BOOL state(OBJ_PROP_PARAMS);
145
162 FX_BOOL initState(OBJ_PROP_PARAMS);
163
174 FX_BOOL locked(OBJ_PROP_PARAMS);
175
176 FX_BOOL getIntent(OBJ_METHOD_PARAMS);
177 FX_BOOL setIntent(OBJ_METHOD_PARAMS);
178
200 FX_BOOL setAction(OBJ_METHOD_PARAMS);
201 FX_BOOL toString(OBJ_METHOD_PARAMS);
202
203 public:
204 void SetOCGInfo(IFXJS_DocumentProvider* pDocument, IFXJS_DocViewProvider* pDocView, CPDF_Dictionary* pDict);
205 static void RunJavaScript(CFXJS_Runtime* pRuntime, CFX_WideString swJavaScript);
206 CFXJS_Runtime* GetJSRuntime() { return m_pRuntime; }
207 CFX_WideString GetJSScript() { return m_swJavaScript; }
208 CPDF_Dictionary* GetDictionary() { return m_pOCGDict; }
209 void SetOrderName(CFX_ByteString csName) { m_OrderName = csName; }
210 CFX_ByteString GetOrderName() { return m_OrderName; }
211
212 private:
213
214 IFXJS_DocumentProvider* m_pDocument;
215 IFXJS_DocViewProvider* m_pDocView;
216 CPDF_Dictionary* m_pOCGDict;
217 CFX_WideString m_swJavaScript;
218 CFXJS_Runtime* m_pRuntime;
219 CFX_ByteString m_OrderName;
220 std::unique_ptr<IPDF_OCNotify> s_pNotify;
221 };
222
223 class CFXJS_OCG : public CFXJS_Object
224 {
225 public:
226 CFXJS_OCG(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
227 virtual ~CFXJS_OCG() {};
228
229 public:
230 DECLARE_JS_CLASS(CFXJS_OCG);
231 JS_STATIC_PROP(constants, OCG);
232 JS_STATIC_PROP(name, OCG);
233 JS_STATIC_PROP(state, OCG);
234 JS_STATIC_PROP(initState, OCG);
235 JS_STATIC_PROP(locked, OCG);
236
237 JS_STATIC_METHOD(getIntent, OCG);
238 JS_STATIC_METHOD(setIntent, OCG);
239 JS_STATIC_METHOD(setAction, OCG);
240 JS_STATIC_METHOD(toString, OCG);
241 };
242
243 class CFXJS_OCGNotify : public IPDF_OCNotify
244 {
245 public:
246 CFXJS_OCGNotify(OCG* pOcg)
247 {
248 if (pOcg)
249 m_pOcg = pOcg;
250 }
251 ~CFXJS_OCGNotify() {}
252
253 virtual void OnOCGStateChanged(CPDF_Document *pDoc, CPDF_OCGroup ocg, FX_BOOL bVisible);
254 private:
255 OCG* m_pOcg;
256 };
257 }
258
259 #endif//_OCG_H_
260
OCG
An OCG object represents an optional content group in a PDF file. Content in the file can belong to o...
Definition: ocg.h:89


Javascript API: Member List

Bookmark Member List

This is the complete list of members for Bookmark, including all inherited members.

children(OBJ_PROP_PARAMS) | Bookmark
createChild(OBJ_METHOD_PARAMS) | Bookmark
doc(OBJ_PROP_PARAMS) | Bookmark
insertChild(OBJ_METHOD_PARAMS) | Bookmark
name(OBJ_PROP_PARAMS) | Bookmark
open(OBJ_PROP_PARAMS) | Bookmark
parent(OBJ_PROP_PARAMS) | Bookmark
remove(OBJ_METHOD_PARAMS) | Bookmark
setAction(OBJ_METHOD_PARAMS) | Bookmark


Javascript API: Member List

console Member List

This is the complete list of members for console, including all inherited members.

clear(OBJ_METHOD_PARAMS) | console
hide(OBJ_METHOD_PARAMS) | console
println(OBJ_METHOD_PARAMS) | console
show(OBJ_METHOD_PARAMS) | console


Javascript API: link.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
link.h
Go to the documentation of this file.
1 #ifndef _LINK_H_
2 #define _LINK_H_
3
5 namespace javascript
6 {
7 class IFXJS_AnnotProvider;
9
17 class Link : public CFXJS_EmbedObj
18 {
19 public:
20 Link(CFXJS_Object* pJSObject);
21 virtual ~Link();
22 bool CheckBaseExpects() override { return (bool)m_pLink; }
23 public:
34 FX_BOOL borderColor(OBJ_PROP_PARAMS);
45 FX_BOOL borderWidth(OBJ_PROP_PARAMS);
61 FX_BOOL highlightMode(OBJ_PROP_PARAMS);
72 FX_BOOL rect(OBJ_PROP_PARAMS);
82 FX_BOOL setAction(OBJ_METHOD_PARAMS);
83
84 public:
85 void SetAnnot(IFXJS_AnnotProvider* pLink);
86 CFX_ByteString GetHighLightMode(CFX_ByteString cbValue);
87 CFX_ByteString GetModeFromUser(CFX_ByteString cbUser);
88 private:
89 FX_BOOL Validate(FX_BOOL IsSet);
90 IFXJS_AnnotProvider* m_pLink;
91 };
92
93 class CFXJS_Link : public CFXJS_Object
94 {
95 public:
96 CFXJS_Link(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
97 virtual ~CFXJS_Link() {};
98
99 public:
100 DECLARE_JS_CLASS(CFXJS_Link);
101 JS_STATIC_PROP(borderColor, Link);
102 JS_STATIC_PROP(borderWidth, Link);
103 JS_STATIC_PROP(highlightMode, Link);
104 JS_STATIC_PROP(rect, Link);
105
106 JS_STATIC_METHOD(setAction, Link);
107 };
108
109 }
110
111
112 #endif //_LINK_H_
Link
This object is used to set and get the properties and to set the JavaScript action of a link.
Definition: link.h:17


Javascript API: span.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
span.h
Go to the documentation of this file.
1 #ifndef _JS_SPAN_H_
2 #define _JS_SPAN_H_
3
5 namespace javascript
6 {
7 class Doc;
9
19 class Span : public CFXJS_EmbedObj
20 {
21 public:
22 Span(CFXJS_Object * pJSObject);
23 virtual ~Span(void);
24
25
44 FX_BOOL alignment(OBJ_PROP_PARAMS);
45
68 FX_BOOL fontFamily(OBJ_PROP_PARAMS);
69
82 FX_BOOL fontStretch(OBJ_PROP_PARAMS);
83
96 FX_BOOL fontWeight(OBJ_PROP_PARAMS);
97
111 FX_BOOL fontStyle(OBJ_PROP_PARAMS);
112
123 FX_BOOL strikethrough(OBJ_PROP_PARAMS);
124
135 FX_BOOL subscript(OBJ_PROP_PARAMS);
136
177 FX_BOOL superscript(OBJ_PROP_PARAMS);
178
193 FX_BOOL text(OBJ_PROP_PARAMS);
194
209 FX_BOOL textColor(OBJ_PROP_PARAMS);
210
226 FX_BOOL textSize(OBJ_PROP_PARAMS);
227
242 FX_BOOL underline(OBJ_PROP_PARAMS);
243 private:
244 FX_BOOL FindNativeFont(CFX_WideString csName);
245
246 public:
247 CFX_ByteString m_alignment;
248 CFX_WideStringArray m_fontFamily;
249 CFX_ByteString m_fontStretch;
250 CFX_ByteString m_fontStyle;
251 CFX_ByteString m_csfont;
252 int m_fontWeight;
253 bool m_bStrikethrough;
254 bool m_bSubscript;
255 bool m_bSuperscript;
256 CFX_ByteString m_text;
257 CFX_ColorF m_color;
258 FX_FLOAT m_textsize;
259 bool m_bUnderline;
260 };
261
262 class CFXJS_Span : public CFXJS_Object
263
264 {
265 public:
266 CFXJS_Span(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
267 virtual ~CFXJS_Span(void) {};
268
269 DECLARE_JS_CLASS(CFXJS_Span);
270
271 JS_STATIC_PROP(alignment, Span)
272 JS_STATIC_PROP(fontFamily, Span)
273 JS_STATIC_PROP(fontStretch, Span)
274 JS_STATIC_PROP(fontWeight, Span)
275 JS_STATIC_PROP(fontStyle, Span)
276 JS_STATIC_PROP(strikethrough, Span)
277 JS_STATIC_PROP(subscript, Span)
278 JS_STATIC_PROP(superscript, Span)
279 JS_STATIC_PROP(text, Span)
280 JS_STATIC_PROP(textColor, Span)
281 JS_STATIC_PROP(textSize, Span)
282 JS_STATIC_PROP(underline, Span)
283 };
284 }
285
286 #endif
Doc
This object provides the interface between a PDF Doc open in the viewer and the JavaScript interprete...
Definition: document.h:202
Span
A generic object that represents a length of text and its associated properties in a rich text form f...
Definition: span.h:19


Javascript API: Member List

Doc Member List

This is the complete list of members for Doc, including all inherited members.

addAnnot(OBJ_METHOD_PARAMS) | Doc
addField(OBJ_METHOD_PARAMS) | Doc
addIcon(OBJ_METHOD_PARAMS) | Doc
addLink(OBJ_METHOD_PARAMS) | Doc
addWatermarkFromFile(OBJ_METHOD_PARAMS) | Doc
addWatermarkFromText(OBJ_METHOD_PARAMS) | Doc
addWeblinks(OBJ_METHOD_PARAMS) | Doc
author(OBJ_PROP_PARAMS) | Doc
baseURL(OBJ_PROP_PARAMS) | Doc
bookmarkRoot(OBJ_PROP_PARAMS) | Doc
calculate(OBJ_PROP_PARAMS) | Doc
calculateNow(OBJ_METHOD_PARAMS) | Doc
closeDoc(OBJ_METHOD_PARAMS) | Doc
createTemplate(OBJ_METHOD_PARAMS) | Doc
creationDate(OBJ_PROP_PARAMS) | Doc
creator(OBJ_PROP_PARAMS) | Doc
dataObjects(OBJ_PROP_PARAMS) | Doc
delay(OBJ_PROP_PARAMS) | Doc
deletePages(OBJ_METHOD_PARAMS) | Doc
dirty(OBJ_PROP_PARAMS) | Doc
documentFileName(OBJ_PROP_PARAMS) | Doc
dynamicXFAForm(OBJ_PROP_PARAMS) | Doc
exportAsFDF(OBJ_METHOD_PARAMS) | Doc
exportAsText(OBJ_METHOD_PARAMS) | Doc
exportAsXFDF(OBJ_METHOD_PARAMS) | Doc
exportAsXFDFStr(OBJ_METHOD_PARAMS) | Doc
exportDataObject(OBJ_METHOD_PARAMS) | Doc
external(OBJ_PROP_PARAMS) | Doc
extractPages(OBJ_METHOD_PARAMS) | Doc
filesize(OBJ_PROP_PARAMS) | Doc
flattenPages(OBJ_METHOD_PARAMS) | Doc
getAnnot(OBJ_METHOD_PARAMS) | Doc
getAnnots(OBJ_METHOD_PARAMS) | Doc
getDataObject(OBJ_METHOD_PARAMS) | Doc
getField(OBJ_METHOD_PARAMS) | Doc
getLinks(OBJ_METHOD_PARAMS) | Doc
getNthFieldName(OBJ_METHOD_PARAMS) | Doc
getOCGOrder(OBJ_METHOD_PARAMS) | Doc
getOCGs(OBJ_METHOD_PARAMS) | Doc
getPageBox(OBJ_METHOD_PARAMS) | Doc
getPageNthWord(OBJ_METHOD_PARAMS) | Doc
getPageNumWords(OBJ_METHOD_PARAMS) | Doc
getPageRotation(OBJ_METHOD_PARAMS) | Doc
getPageTransition(OBJ_METHOD_PARAMS) | Doc
getPrintParams(OBJ_METHOD_PARAMS) | Doc
getTemplate(OBJ_METHOD_PARAMS) | Doc
getURL(OBJ_METHOD_PARAMS) | Doc
gotoNamedDest(OBJ_METHOD_PARAMS) | Doc
hostContainer(OBJ_PROP_PARAMS) | Doc
icons(OBJ_PROP_PARAMS) | Doc
importAnFDF(OBJ_METHOD_PARAMS) | Doc
importAnXFDF(OBJ_METHOD_PARAMS) | Doc
importDataObject(OBJ_METHOD_PARAMS) | Doc
importTextData(OBJ_METHOD_PARAMS) | Doc
info(OBJ_PROP_PARAMS) | Doc
insertPages(OBJ_METHOD_PARAMS) | Doc
keywords(OBJ_PROP_PARAMS) | Doc
layout(OBJ_PROP_PARAMS) | Doc
mailDoc(OBJ_METHOD_PARAMS) | Doc
mailForm(OBJ_METHOD_PARAMS) | Doc
media(OBJ_PROP_PARAMS) | Doc
modDate(OBJ_PROP_PARAMS) | Doc
mouseX(OBJ_PROP_PARAMS) | Doc
mouseY(OBJ_PROP_PARAMS) | Doc
movePage(OBJ_METHOD_PARAMS) | Doc
newPage(OBJ_METHOD_PARAMS) | Doc
numFields(OBJ_PROP_PARAMS) | Doc
numPages(OBJ_PROP_PARAMS) | Doc
pageNum(OBJ_PROP_PARAMS) | Doc
pageWindowRect(OBJ_PROP_PARAMS) | Doc
path(OBJ_PROP_PARAMS) | Doc
print(OBJ_METHOD_PARAMS) | Doc
producer(OBJ_PROP_PARAMS) | Doc
removeDataObject(OBJ_METHOD_PARAMS) | Doc
removeField(OBJ_METHOD_PARAMS) | Doc
removeLinks(OBJ_METHOD_PARAMS) | Doc
removeTemplate(OBJ_METHOD_PARAMS) | Doc
removeWeblinks(OBJ_METHOD_PARAMS) | Doc
replacePages(OBJ_METHOD_PARAMS) | Doc
resetForm(OBJ_METHOD_PARAMS) | Doc
scroll(OBJ_METHOD_PARAMS) | Doc
securityHandler(OBJ_PROP_PARAMS) | Doc
setOCGOrder(OBJ_METHOD_PARAMS) | Doc
setPageBoxes(OBJ_METHOD_PARAMS) | Doc
setPageRotations(OBJ_METHOD_PARAMS) | Doc
setPageTabOrder(OBJ_METHOD_PARAMS) | Doc
setPageTransitions(OBJ_METHOD_PARAMS) | Doc
subject(OBJ_PROP_PARAMS) | Doc
submitForm(OBJ_METHOD_PARAMS) | Doc
syncAnnotScan(OBJ_METHOD_PARAMS) | Doc
templates(OBJ_PROP_PARAMS) | Doc
title(OBJ_PROP_PARAMS) | Doc
URL(OBJ_PROP_PARAMS) | Doc
xfa(OBJ_PROP_PARAMS) | Doc
zoom(OBJ_PROP_PARAMS) | Doc
zoomType(OBJ_PROP_PARAMS) | Doc


Javascript API: field.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
field.h
Go to the documentation of this file.
1 #ifndef _FIELD_H_
2 #define _FIELD_H_
3
4
5 #include "fxge/fx_color.h"
6 #include "javascript/fx_jsAppProvider.h"
8 namespace javascript
9 {
10 class Doc;
11 class IFXJS_WidgetProvider;
12
13 struct LOCKELEMENT
14 {
15 LOCKELEMENT()
16 {
17 cwLock = L"undefined";
18 Fields.RemoveAll();
19 }
20 CFX_WideString cwLock;
21 CFX_WideStringArray Fields;
22 };
23 class Document;
24
25 /* ------------------------------------- XFAField ------------------------------------- */
26
27 class XFAField : public CFXJS_EmbedObj
28 {
29 public:
30 XFAField(CFXJS_Object* pJSObject);
31 virtual ~XFAField(void);
32
33 FX_BOOL rect(OBJ_PROP_PARAMS);
34
35 FX_BOOL setFocus(OBJ_METHOD_PARAMS);
36 FX_BOOL setLock(OBJ_METHOD_PARAMS);
37 FX_BOOL signatureGetModifications(OBJ_METHOD_PARAMS);
38 FX_BOOL signatureGetSeedValue(OBJ_METHOD_PARAMS);
39 FX_BOOL signatureInfo(OBJ_METHOD_PARAMS);
40 FX_BOOL signatureSetSeedValue(OBJ_METHOD_PARAMS);
41 FX_BOOL signatureSign(OBJ_METHOD_PARAMS);
42 FX_BOOL signatureValidate(OBJ_METHOD_PARAMS);
43 public:
44 FX_INT32 QueryProperty(FX_BSTR szPropName);
45 FX_BOOL DoProperty(FXJSE_HVALUE hValue, FX_BSTR szPropName, JS_ErrorString& sError, FX_BOOL IsSet);
46 FX_BOOL DelProperty(FX_BSTR szPropName, JS_ErrorString & sError);
47
48 public:
49 FX_BOOL AttachField(Doc* pDocument, const CFX_WideString& csFieldName) { return true; };
50
51 public:
52 Doc* m_pJSDoc;
53 IFXJS_DocumentProvider* m_pDocument;
54 // CFX_WideString m_FieldName;
55 };
56
57 class CFXJS_XFAField : public CFXJS_Object
58 {
59 public:
60 CFXJS_XFAField(CFXJS_Runtime* pRuntime);
61 virtual ~CFXJS_XFAField(void);
62
63 DECLARE_JS_CLASS(CFXJS_XFAField);
64
65 JS_STATIC_PROP(rect, XFAField);
66
67 JS_STATIC_METHOD(setFocus, XFAField);
68 JS_STATIC_METHOD(setLock, XFAField);
69 JS_STATIC_METHOD(signatureGetModifications, XFAField);
70 JS_STATIC_METHOD(signatureGetSeedValue, XFAField);
71 JS_STATIC_METHOD(signatureInfo, XFAField);
72 JS_STATIC_METHOD(signatureSetSeedValue, XFAField);
73 JS_STATIC_METHOD(signatureSign, XFAField);
74 JS_STATIC_METHOD(signatureValidate, XFAField);
75 };
76
77 /* ------------------------------------- Field ------------------------------------- */
78
79 enum FIELD_PROP
80 {
81 FP_ALIGNMENT,
82 FP_BORDERSTYLE,
83 FP_BUTTONALIGNX,
84 FP_BUTTONALIGNY,
85 FP_BUTTONFITBOUNDS,
86 FP_BUTTONPOSITION,
87 FP_BUTTONSCALEHOW,
88 FP_BUTTONSCALEWHEN,
89 FP_CALCORDERINDEX,
90 FP_CHARLIMIT,
91 FP_COMB,
92 FP_COMMITONSELCHANGE,
93 FP_CURRENTVALUEINDICES,
94 FP_DEFAULTVALUE,
95 FP_DONOTSCROLL,
96 FP_DISPLAY,
97 FP_FILLCOLOR,
98 FP_HIDDEN,
99 FP_HIGHLIGHT,
100 FP_LINEWIDTH,
101 FP_MULTILINE,
102 FP_MULTIPLESELECTION,
103 FP_PASSWORD,
104 FP_RECT,
105 FP_RICHTEXT,
106 FP_RICHVALUE,
107 FP_ROTATION,
108 FP_STROKECOLOR,
109 FP_STYLE,
110 FP_TEXTCOLOR,
111 FP_TEXTFONT,
112 FP_TEXTSIZE,
113 FP_USERNAME,
114 FP_VALUE
115 };
116 struct CFXJS_DelayData
117 {
118 CFX_WideString sFieldName;
119 int nControlIndex = 0;
120 enum FIELD_PROP eProp = FP_ALIGNMENT;
121 FX_INT32 num = 0;
122 FX_BOOL b = false;
123 CFX_ByteString string;
124 CFX_WideString widestring;
125 CPDF_Rect rect;
126 CFX_ColorF color;
127 CFX_DWordArray wordarray;
128 std::vector<CFX_WideString> widestringarray;
129 };
130 struct js_field_Dynamic_data
131 {
132 js_field_Dynamic_data()
133 {
134 pData = NULL;
135 bDeleted = false;
136 }
137 FXJSE_HVALUE pData;
138 bool bDeleted;
139 };
140
141 struct js_RichText_data
142 {
143 CFX_ByteString alignment;
144 CFX_WideStringArray fontFamily;
145 CFX_ByteString fontStretch;
146 CFX_ByteString fontStyle;
147 int fontWeight;
148 bool strikethrough;
149 bool subscript;
150 bool superscript;
151 CFX_ByteString text;
152 CFX_ColorF color;
153 int textsize;
154 bool underline;
155
156 CFX_ByteString csfont;
157 js_RichText_data()
158 {
159 alignment = "left";
160 fontStretch = "normal";
161 fontStyle = "normal";
162 fontWeight = 400;
163 strikethrough = false;
164 subscript = false;
165 superscript = false;
166 textsize = 12.0;
167 underline = false;
168 }
169 };
170
171 using CPDF_FormFieldArray = CFX_ArrayTemplate<CPDF_FormField*>;
172 #define FIELD_PROP_PARAMS IFXJS_DocumentProvider* pDocument, const CPDF_FormFieldArray& FieldArray, int nControlIndex, JS_ErrorString& sError
173
184 class Field : public CFXJS_EmbedObj
185 {
186 public:
187 Field(CFXJS_Object* pJSObject);
188 virtual ~Field(void);
189 bool CheckBaseExpects() override;
190
211 FX_BOOL alignment(OBJ_PROP_PARAMS);
212
244 FX_BOOL borderStyle(OBJ_PROP_PARAMS);
245 FX_BOOL buttonAlignX(OBJ_PROP_PARAMS);
246 FX_BOOL buttonAlignY(OBJ_PROP_PARAMS);
247
268 FX_BOOL buttonFitBounds(OBJ_PROP_PARAMS);
269
299 FX_BOOL buttonPosition(OBJ_PROP_PARAMS);
300
324 FX_BOOL buttonScaleHow(OBJ_PROP_PARAMS);
325
351 FX_BOOL buttonScaleWhen(OBJ_PROP_PARAMS);
352
372 FX_BOOL calcOrderIndex(OBJ_PROP_PARAMS);
373
393 FX_BOOL charLimit(OBJ_PROP_PARAMS);
394
424 FX_BOOL comb(OBJ_PROP_PARAMS);
425
445 FX_BOOL commitOnSelChange(OBJ_PROP_PARAMS);
446
482 FX_BOOL currentValueIndices(OBJ_PROP_PARAMS);
483
520 FX_BOOL defaultStyle(OBJ_PROP_PARAMS);
521
539 FX_BOOL defaultValue(OBJ_PROP_PARAMS);
540
560 FX_BOOL doNotScroll(OBJ_PROP_PARAMS);
561
581 FX_BOOL doNotSpellCheck(OBJ_PROP_PARAMS);
582
609 FX_BOOL delay(OBJ_PROP_PARAMS);
610
633 FX_BOOL display(OBJ_PROP_PARAMS);
634
658 FX_BOOL doc(OBJ_PROP_PARAMS);
659
679 FX_BOOL editable(OBJ_PROP_PARAMS);
680
707 FX_BOOL exportValues(OBJ_PROP_PARAMS);
708
724 FX_BOOL fileSelect(OBJ_PROP_PARAMS);
725
748 FX_BOOL fillColor(OBJ_PROP_PARAMS);
749
778 FX_BOOL hidden(OBJ_PROP_PARAMS);
779
809 FX_BOOL highlight(OBJ_PROP_PARAMS);
810
836 FX_BOOL lineWidth(OBJ_PROP_PARAMS);
837
865 FX_BOOL multiline(OBJ_PROP_PARAMS);
866
895 FX_BOOL multipleSelection(OBJ_PROP_PARAMS);
896
917 FX_BOOL name(OBJ_PROP_PARAMS);
918
938 FX_BOOL numItems(OBJ_PROP_PARAMS);
939
962 FX_BOOL page(OBJ_PROP_PARAMS);
963
991 FX_BOOL password(OBJ_PROP_PARAMS);
992
1021 FX_BOOL print(OBJ_PROP_PARAMS);
1022
1041 FX_BOOL radiosInUnison(OBJ_PROP_PARAMS);
1042
1062 FX_BOOL readonly(OBJ_PROP_PARAMS);
1063
1096 FX_BOOL rect(OBJ_PROP_PARAMS);
1097
1116 FX_BOOL required(OBJ_PROP_PARAMS);
1117
1149 FX_BOOL richText(OBJ_PROP_PARAMS);
1150
1213 FX_BOOL richValue(OBJ_PROP_PARAMS);
1214
1236 FX_BOOL rotation(OBJ_PROP_PARAMS);
1237
1261 FX_BOOL strokeColor(OBJ_PROP_PARAMS);
1262
1291 FX_BOOL style(OBJ_PROP_PARAMS);
1292
1309 FX_BOOL submitName(OBJ_PROP_PARAMS);
1310
1331 FX_BOOL textColor(OBJ_PROP_PARAMS);
1332
1369 FX_BOOL textFont(OBJ_PROP_PARAMS);
1370
1388 FX_BOOL textSize(OBJ_PROP_PARAMS);
1389
1418 FX_BOOL type(OBJ_PROP_PARAMS);
1419
1438 FX_BOOL userName(OBJ_PROP_PARAMS);
1458 FX_BOOL value(OBJ_PROP_PARAMS);
1472 FX_BOOL valueAsString(OBJ_PROP_PARAMS);
1473 FX_BOOL source(OBJ_PROP_PARAMS);
1474 FX_BOOL forReal(OBJ_PROP_PARAMS);
1475 FX_BOOL stampName(OBJ_PROP_PARAMS);
1476
1477
1488 FX_BOOL browseForFileToSubmit(OBJ_METHOD_PARAMS);
1489
1512 FX_BOOL buttonGetCaption(OBJ_METHOD_PARAMS);
1513
1534 FX_BOOL buttonGetIcon(OBJ_METHOD_PARAMS);
1535 FX_BOOL buttonImportIcon(OBJ_METHOD_PARAMS);
1536
1553 FX_BOOL buttonSetCaption(OBJ_METHOD_PARAMS);
1554
1579 FX_BOOL buttonSetIcon(OBJ_METHOD_PARAMS);
1580
1598 FX_BOOL checkThisBox(OBJ_METHOD_PARAMS);
1599
1609 FX_BOOL clearItems(OBJ_METHOD_PARAMS);
1610
1630 FX_BOOL defaultIsChecked(OBJ_METHOD_PARAMS);
1631
1648 FX_BOOL deleteItemAt(OBJ_METHOD_PARAMS);
1649
1665 FX_BOOL getArray(OBJ_METHOD_PARAMS);
1666
1694 FX_BOOL getItemAt(OBJ_METHOD_PARAMS);
1695
1702 FX_BOOL getLock(OBJ_METHOD_PARAMS);
1703
1720 FX_BOOL insertItemAt(OBJ_METHOD_PARAMS);
1721
1740 FX_BOOL isBoxChecked(OBJ_METHOD_PARAMS);
1741
1760 FX_BOOL isDefaultChecked(OBJ_METHOD_PARAMS);
1761
1787 FX_BOOL setAction(OBJ_METHOD_PARAMS);
1788
1806 FX_BOOL setFocus(OBJ_METHOD_PARAMS);
1807
1831 FX_BOOL setItems(OBJ_METHOD_PARAMS);
1832
1851 FX_BOOL setLock(OBJ_METHOD_PARAMS);
1852
1894 FX_BOOL signatureGetModifications(OBJ_METHOD_PARAMS);
1895
1914 FX_BOOL signatureGetSeedValue(OBJ_METHOD_PARAMS);
1915
1942 FX_BOOL signatureInfo(OBJ_METHOD_PARAMS);
1943
1996 FX_BOOL signatureSetSeedValue(OBJ_METHOD_PARAMS);
1997
2030 FX_BOOL signatureSign(OBJ_METHOD_PARAMS);
2031
2064 FX_BOOL signatureValidate(OBJ_METHOD_PARAMS);
2065
2066 public:
2067 FX_INT32 QueryProperty(FX_BSTR szPropName);
2068 FX_BOOL DoProperty(FXJSE_HVALUE hValue, FX_BSTR szPropName, JS_ErrorString& sError, FX_BOOL IsSet);
2069 FX_BOOL DelProperty(FX_BSTR szPropName, JS_ErrorString & sError);
2070 FX_BOOL SetGlobalVariables(CFXJS_Runtime* pRuntime, FX_BSTR propname, FXJSE_HVALUE hValue);
2071
2072 public:
2073 static bool SetAlignment(FIELD_PROP_PARAMS, const CFX_ByteString& string);
2074 static bool SetBorderStyle(FIELD_PROP_PARAMS, const CFX_ByteString& string);
2075 static bool SetButtonAlignX(FIELD_PROP_PARAMS, int number);
2076 static bool SetButtonAlignY(FIELD_PROP_PARAMS, int number);
2077 static bool SetButtonFitBounds(FIELD_PROP_PARAMS, FX_BOOL b);
2078 static bool SetButtonPosition(FIELD_PROP_PARAMS, int number);
2079 static bool SetButtonScaleHow(FIELD_PROP_PARAMS, int number);
2080 static bool SetButtonScaleWhen(FIELD_PROP_PARAMS, int number);
2081 static bool SetCalcOrderIndex(FIELD_PROP_PARAMS, int number);
2082 static bool SetCharLimit(FIELD_PROP_PARAMS, int number);
2083 static bool SetComb(FIELD_PROP_PARAMS, FX_BOOL b);
2084 static bool SetCommitOnSelChange(FIELD_PROP_PARAMS, FX_BOOL b);
2085 static bool SetCurrentValueIndices(FIELD_PROP_PARAMS, const CFX_DWordArray& array);
2086 static bool SetDefaultStyle(FIELD_PROP_PARAMS, const js_RichText_data* pData);
2087 static bool SetDefaultValue(FIELD_PROP_PARAMS, const CFX_WideString& string);
2088 static bool SetDoNotScroll(FIELD_PROP_PARAMS, FX_BOOL b);
2089 static bool SetDisplay(FIELD_PROP_PARAMS, int number);
2090 static bool SetFillColor(FIELD_PROP_PARAMS, const CFX_ColorF& color);
2091 static bool SetHidden(FIELD_PROP_PARAMS, FX_BOOL b);
2092 static bool SetHighlight(FIELD_PROP_PARAMS, const CFX_ByteString& string);
2093 static bool SetLineWidth(FIELD_PROP_PARAMS, int number);
2094 static bool SetMultiline(FIELD_PROP_PARAMS, FX_BOOL b);
2095 static bool SetMultipleSelection(FIELD_PROP_PARAMS, FX_BOOL b);
2096 static bool SetPassword(FIELD_PROP_PARAMS, FX_BOOL b);
2097 static bool SetRect(FIELD_PROP_PARAMS, const CPDF_Rect& rect);
2098 static bool SetRichText(FIELD_PROP_PARAMS, FX_BOOL b);
2099 static bool SetRichValue(FIELD_PROP_PARAMS, CFX_ByteString csRVXML, const CFX_WideString& string);
2100 static bool GetRichValue(FIELD_PROP_PARAMS, const CFX_ByteString csName, CFX_WideStringArray& csArrRVXML);
2101 static bool SetRotation(FIELD_PROP_PARAMS, int number);
2102 static bool SetStrokeColor(FIELD_PROP_PARAMS, const CFX_ColorF& color);
2103 static bool SetStyle(FIELD_PROP_PARAMS, const CFX_ByteString& string);
2104 static bool SetTextColor(FIELD_PROP_PARAMS, const CFX_ColorF& color);
2105 static bool SetTextFont(FIELD_PROP_PARAMS, const CFX_ByteString& string);
2106 static bool SetTextSize(FIELD_PROP_PARAMS, int number);
2107 static bool SetUserName(FIELD_PROP_PARAMS, const CFX_WideString& string);
2108 static bool SetValue(FIELD_PROP_PARAMS, const std::vector<CFX_WideString>& strArray);
2109 static bool SetTMName(FIELD_PROP_PARAMS, const CFX_ByteString& string);
2110
2111
2112 void ParseXML2Span(CXML_Element* pXML);
2113 void SplitStyle(CFX_WideString sStyle, js_RichText_data* pBlock);
2114 void ClearSpanBlocks();
2115 bool IsXFADocument();
2116 public:
2117 static bool AddField(IFXJS_DocumentProvider* pDocument, int nPageIndex, int nFieldType,
2118 const CFX_WideString& sName, const CPDF_Rect& rcCoords);
2119 CFX_WideString GetFieldName() { return m_FieldName; }
2120 public:
2121 static void UpdateFormField(IFXJS_DocumentProvider* pDocument, CPDF_FormField* pFormField,
2122 FX_BOOL bResetAP = true, FX_BOOL bValueChanged = false, FX_BOOL bResetRV = true);
2123 static void UpdateFormControl(IFXJS_DocumentProvider* pDocument, CPDF_FormControl* pFormControl,
2124 FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh);
2125
2126 static IFXJS_WidgetProvider* GetWidget(IFXJS_DocumentProvider* pDocument, CPDF_FormControl* pFormControl);
2127 static CPDF_FormFieldArray GetFormFields(IFXJS_DocumentProvider* pDocument, const CFX_WideString& csFieldName);
2128
2129 static void DoDelay(IFXJS_DocumentProvider* pDocument, JS_ErrorString& sError, CFXJS_DelayData* pData);
2130
2131 public:
2132 FX_BOOL AttachField(Doc* pDocument, const CFX_WideString& csFieldName);
2133 void SetDelay(FX_BOOL bDelay);
2134 static void ParseFieldName(const std::wstring &strFieldNameParsed, std::wstring &strFieldName, int & iControlNo);
2135 protected:
2136 CPDF_FormFieldArray GetFormFields();
2137 CPDF_FormControl* GetSmartFieldControl(CPDF_FormField* pFormField);
2138 FX_BOOL ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel);
2139
2140 void AddDelay_Int(enum FIELD_PROP prop, FX_INT32 n);
2141 void AddDelay_Bool(enum FIELD_PROP prop, FX_BOOL b);
2142 void AddDelay_String(enum FIELD_PROP prop, const CFX_ByteString& string);
2143 void AddDelay_WideString(enum FIELD_PROP prop, const CFX_WideString& string);
2144 void AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect);
2145 void AddDelay_Color(enum FIELD_PROP prop, const CFX_ColorF& color);
2146 void AddDelay_WordArray(enum FIELD_PROP prop, const CFX_DWordArray& array);
2147 void AddDelay_WideStringArray(enum FIELD_PROP prop, const std::vector<CFX_WideString>& array);
2148
2149 CFX_WideString GetStyle(js_RichText_data* data);
2150 CFX_ByteString GetRVXML();
2151
2152 private:
2153 FX_BOOL Validate(FX_BOOL IsSet) { return !(IsSet && !IsCanSet()); }
2154 FX_BOOL IsSignatureField(CPDF_FormField* pFormField);
2155 void AnalysisSignModifyDetect(FXJSE_HVALUE hReturnValue, CPDF_FormField*pFormField);
2156
2157
2158 void AnalysisFormModifyDetect(FXJSE_HVALUE hReturnValue, CPDF_FormField *pFormField);
2159 void AnalysisAnnotModifyDetect(FXJSE_HVALUE hReturnValue, CPDF_FormField *pFormField);
2160 void AnalysisPageModifyDetect(FXJSE_HVALUE hReturnValue, CPDF_FormField*pFormField);
2161
2162
2163
2164 Doc* GetJSDocument();
2165 void SetModifyFieldProp(FXJSE_HVALUE hProp, FX_INT32 nIndex, const JS_MODIFYDATA& data);
2166 void SetModifyAnnotProp(FXJSE_HVALUE hProp, FX_INT32 nIndex, const JS_MODIFYDATA & data);
2167
2168 CFX_ByteString GetFieldTypeBuffer(CPDF_Dictionary *pFormDict);
2169 CFXJS_Object* FindJSDocument(IFXJS_DocumentProvider* pDoc);
2170 public:
2171 Doc* m_pJSDoc;
2172 IFXJS_DocumentProvider* m_pDocument;
2173 CFX_WideString m_FieldName;
2174 int m_nFormControlIndex;
2175 std::vector<std::unique_ptr<js_RichText_data> > m_arrDefValue;
2176 CFX_WideString m_cwValue;
2177 std::vector<std::unique_ptr<js_RichText_data> > m_SpanBlocks;
2178 };
2179
2180 class CFXJS_Field : public CFXJS_Object
2181 {
2182 public:
2183 CFXJS_Field(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
2184 virtual ~CFXJS_Field(void) {};
2185
2186 DECLARE_JS_DYNAMIC_CLASS(CFXJS_Field);
2187
2188 JS_STATIC_PROP(alignment, Field);
2189 JS_STATIC_PROP(borderStyle, Field);
2190 JS_STATIC_PROP(buttonAlignX, Field);
2191 JS_STATIC_PROP(buttonAlignY, Field);
2192 JS_STATIC_PROP(buttonFitBounds, Field);
2193 JS_STATIC_PROP(buttonPosition, Field);
2194 JS_STATIC_PROP(buttonScaleHow, Field);
2195 JS_STATIC_PROP(buttonScaleWhen, Field);
2196 JS_STATIC_PROP(calcOrderIndex, Field);
2197 JS_STATIC_PROP(charLimit, Field);
2198 JS_STATIC_PROP(comb, Field);
2199 JS_STATIC_PROP(commitOnSelChange, Field);
2200 JS_STATIC_PROP(currentValueIndices, Field);
2201 JS_STATIC_PROP(defaultStyle, Field);
2202 JS_STATIC_PROP(defaultValue, Field);
2203 JS_STATIC_PROP(doNotScroll, Field);
2204 JS_STATIC_PROP(doNotSpellCheck, Field);
2205 JS_STATIC_PROP(delay, Field);
2206 JS_STATIC_PROP(display, Field);
2207 JS_STATIC_PROP(doc, Field);
2208 JS_STATIC_PROP(editable, Field);
2209 JS_STATIC_PROP(exportValues, Field);
2210 JS_STATIC_PROP(fileSelect, Field);
2211 JS_STATIC_PROP(fillColor, Field);
2212 JS_STATIC_PROP(hidden, Field);
2213 JS_STATIC_PROP(highlight, Field);
2214 JS_STATIC_PROP(lineWidth, Field);
2215 JS_STATIC_PROP(multiline, Field);
2216 JS_STATIC_PROP(multipleSelection, Field);
2217 JS_STATIC_PROP(name, Field);
2218 JS_STATIC_PROP(numItems, Field);
2219 JS_STATIC_PROP(page, Field);
2220 JS_STATIC_PROP(password, Field);
2221 JS_STATIC_PROP(print, Field);
2222 JS_STATIC_PROP(radiosInUnison, Field);
2223 JS_STATIC_PROP(readonly, Field);
2224 JS_STATIC_PROP(rect, Field);
2225 JS_STATIC_PROP(required, Field);
2226 JS_STATIC_PROP(richText, Field);
2227 JS_STATIC_PROP(richValue, Field);
2228 JS_STATIC_PROP(rotation, Field);
2229 JS_STATIC_PROP(strokeColor, Field);
2230 JS_STATIC_PROP(style, Field);
2231 JS_STATIC_PROP(submitName, Field);
2232 JS_STATIC_PROP(textColor, Field);
2233 JS_STATIC_PROP(textFont, Field);
2234 JS_STATIC_PROP(textSize, Field);
2235 JS_STATIC_PROP(type, Field);
2236 JS_STATIC_PROP(userName, Field);
2237 JS_STATIC_PROP(value, Field);
2238 JS_STATIC_PROP(valueAsString, Field);
2239 JS_STATIC_PROP(source, Field);
2240 JS_STATIC_PROP(forReal, Field);
2241 JS_STATIC_PROP(stampName, Field);
2242
2243 JS_STATIC_METHOD(browseForFileToSubmit, Field);
2244 JS_STATIC_METHOD(buttonGetCaption, Field);
2245 JS_STATIC_METHOD(buttonGetIcon, Field);
2246 JS_STATIC_METHOD(buttonImportIcon, Field);
2247 JS_STATIC_METHOD(buttonSetCaption, Field);
2248 JS_STATIC_METHOD(buttonSetIcon, Field);
2249 JS_STATIC_METHOD(checkThisBox, Field);
2250 JS_STATIC_METHOD(clearItems, Field);
2251 JS_STATIC_METHOD(defaultIsChecked, Field);
2252 JS_STATIC_METHOD(deleteItemAt, Field);
2253 JS_STATIC_METHOD(getArray, Field);
2254 JS_STATIC_METHOD(getItemAt, Field);
2255 JS_STATIC_METHOD(getLock, Field);
2256 JS_STATIC_METHOD(insertItemAt, Field);
2257 JS_STATIC_METHOD(isBoxChecked, Field);
2258 JS_STATIC_METHOD(isDefaultChecked, Field);
2259 JS_STATIC_METHOD(setAction, Field);
2260 JS_STATIC_METHOD(setFocus, Field);
2261 JS_STATIC_METHOD(setItems, Field);
2262 JS_STATIC_METHOD(setLock, Field);
2263 JS_STATIC_METHOD(signatureGetModifications, Field);
2264 JS_STATIC_METHOD(signatureGetSeedValue, Field);
2265 JS_STATIC_METHOD(signatureInfo, Field);
2266 JS_STATIC_METHOD(signatureSetSeedValue, Field);
2267 JS_STATIC_METHOD(signatureSign, Field);
2268 JS_STATIC_METHOD(signatureValidate, Field);
2269 };
2270
2271
2272 //---------------------------------------------------Lock -----------------------------------------
2273 class Lock : public CFXJS_EmbedObj
2274 {
2275 public:
2276 Lock(CFXJS_Object* pJSObject);
2277 virtual ~Lock(void);
2278
2279 FX_BOOL action(OBJ_PROP_PARAMS);
2280 FX_BOOL fields(OBJ_PROP_PARAMS);
2281
2282
2283 public:
2284 void SetField(CPDF_FormField *pFormField) { m_pFormField = pFormField; }
2285 void GetLockElement(LOCKELEMENT & lockEle);
2286
2287 FX_BOOL SetLock(const LOCKELEMENT& lockEle);
2288
2289
2290 private:
2291
2292
2293 private:
2294 void GetLockEleFromDict();
2295
2296 CPDF_FormField* m_pFormField;
2297 LOCKELEMENT m_LockElement;
2298
2299 };
2300
2301
2302 class CFXJS_Lock : public CFXJS_Object
2303 {
2304 public:
2305 CFXJS_Lock(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
2306 virtual ~CFXJS_Lock(void) {};
2307
2308 DECLARE_JS_CLASS(CJS_Lock);
2309
2310 JS_STATIC_PROP(action, Lock);
2311 JS_STATIC_PROP(fields, Lock);
2312
2313 };
2314 }
2315
2316 #endif //_FIELD_H_
Field
This object represents an form field (that is, a field created using the form tool or the Doc addFiel...
Definition: field.h:184
Doc
This object provides the interface between a PDF Doc open in the viewer and the JavaScript interprete...
Definition: document.h:202


Javascript API: Member List

app Member List

This is the complete list of members for app, including all inherited members.

activeDocs(OBJ_PROP_PARAMS) | app
addMenuItem(OBJ_METHOD_PARAMS) | app
alert(OBJ_METHOD_PARAMS) | app
beep(OBJ_METHOD_PARAMS) | app
browseForDoc(OBJ_METHOD_PARAMS) | app
calculate(OBJ_PROP_PARAMS) | app
clearInterval(OBJ_METHOD_PARAMS) | app
clearTimeOut(OBJ_METHOD_PARAMS) | app
execDialog(OBJ_METHOD_PARAMS) | app
execMenuItem(OBJ_METHOD_PARAMS) | app
fs(OBJ_PROP_PARAMS) | app
fullscreen(OBJ_PROP_PARAMS) | app
language(OBJ_PROP_PARAMS) | app
launchURL(OBJ_METHOD_PARAMS) | app
listMenuItems(OBJ_METHOD_PARAMS) | app
mailMsg(OBJ_METHOD_PARAMS) | app
media(OBJ_PROP_PARAMS) | app
newDoc(OBJ_METHOD_PARAMS) | app
openDoc(OBJ_METHOD_PARAMS) | app
platform(OBJ_PROP_PARAMS) | app
popUpMenu(OBJ_METHOD_PARAMS) | app
popUpMenuEx(OBJ_METHOD_PARAMS) | app
printerNames(OBJ_PROP_PARAMS) | app
response(OBJ_METHOD_PARAMS) | app
runtimeHighlight(OBJ_PROP_PARAMS) | app
runtimeHighlightColor(OBJ_PROP_PARAMS) | app
setInterval(OBJ_METHOD_PARAMS) | app
setTimeOut(OBJ_METHOD_PARAMS) | app
viewerType(OBJ_PROP_PARAMS) | app
viewerVariation(OBJ_PROP_PARAMS) | app
viewerVersion(OBJ_PROP_PARAMS) | app


Javascript API: Member List

Index Member List

This is the complete list of members for Index, including all inherited members.

available(OBJ_PROP_PARAMS) | Index
name(OBJ_PROP_PARAMS) | Index
path(OBJ_PROP_PARAMS) | Index
selected(OBJ_PROP_PARAMS) | Index


Javascript API: Member List

search Member List

This is the complete list of members for search, including all inherited members.

addIndex(OBJ_METHOD_PARAMS) | search
attachments(OBJ_PROP_PARAMS) | search
bookmarks(OBJ_PROP_PARAMS) | search
docText(OBJ_PROP_PARAMS) | search
ignoreAccents(OBJ_PROP_PARAMS) | search
ignoreAsianCharacterWidth(OBJ_PROP_PARAMS) | search
markup(OBJ_PROP_PARAMS) | search
matchCase(OBJ_PROP_PARAMS) | search
matchWholeWord(OBJ_PROP_PARAMS) | search
maxDocs(OBJ_PROP_PARAMS) | search
proximity(OBJ_PROP_PARAMS) | search
query(OBJ_METHOD_PARAMS) | search
removeIndex(OBJ_METHOD_PARAMS) | search
stem(OBJ_PROP_PARAMS) | search
wordMatching(OBJ_PROP_PARAMS) | search


Javascript API: Member List

OCG Member List

This is the complete list of members for OCG, including all inherited members.

initState(OBJ_PROP_PARAMS) | OCG
locked(OBJ_PROP_PARAMS) | OCG
name(OBJ_PROP_PARAMS) | OCG
setAction(OBJ_METHOD_PARAMS) | OCG
state(OBJ_PROP_PARAMS) | OCG


Javascript API: Member List

Annotation Member List

This is the complete list of members for Annotation, including all inherited members.

alignment(OBJ_PROP_PARAMS) | Annotation
AP(OBJ_PROP_PARAMS) | Annotation
arrowBegin(OBJ_PROP_PARAMS) | Annotation
arrowEnd(OBJ_PROP_PARAMS) | Annotation
attachIcon(OBJ_PROP_PARAMS) | Annotation
author(OBJ_PROP_PARAMS) | Annotation
borderEffectIntensity(OBJ_PROP_PARAMS) | Annotation
borderEffectStyle(OBJ_PROP_PARAMS) | Annotation
callout(OBJ_PROP_PARAMS) | Annotation
caretSymbol(OBJ_PROP_PARAMS) | Annotation
contents(OBJ_PROP_PARAMS) | Annotation
creationDate(OBJ_PROP_PARAMS) | Annotation
dash(OBJ_PROP_PARAMS) | Annotation
delay(OBJ_PROP_PARAMS) | Annotation
destroy(OBJ_METHOD_PARAMS) | Annotation
doc(OBJ_PROP_PARAMS) | Annotation
doCaption(OBJ_PROP_PARAMS) | Annotation
fillColor(OBJ_PROP_PARAMS) | Annotation
gestures(OBJ_PROP_PARAMS) | Annotation
hidden(OBJ_PROP_PARAMS) | Annotation
inReplyTo(OBJ_PROP_PARAMS) | Annotation
intent(OBJ_PROP_PARAMS) | Annotation
leaderExtend(OBJ_PROP_PARAMS) | Annotation
leaderLength(OBJ_PROP_PARAMS) | Annotation
lineEnding(OBJ_PROP_PARAMS) | Annotation
lock(OBJ_PROP_PARAMS) | Annotation
modDate(OBJ_PROP_PARAMS) | Annotation
name(OBJ_PROP_PARAMS) | Annotation
noteIcon(OBJ_PROP_PARAMS) | Annotation
noView(OBJ_PROP_PARAMS) | Annotation
opacity(OBJ_PROP_PARAMS) | Annotation
page(OBJ_PROP_PARAMS) | Annotation
point(OBJ_PROP_PARAMS) | Annotation
points(OBJ_PROP_PARAMS) | Annotation
popupOpen(OBJ_PROP_PARAMS) | Annotation
popupRect(OBJ_PROP_PARAMS) | Annotation
print(OBJ_PROP_PARAMS) | Annotation
quads(OBJ_PROP_PARAMS) | Annotation
readOnly(OBJ_PROP_PARAMS) | Annotation
rect(OBJ_PROP_PARAMS) | Annotation
refType(OBJ_PROP_PARAMS) | Annotation
soundIcon(OBJ_PROP_PARAMS) | Annotation
strokeColor(OBJ_PROP_PARAMS) | Annotation
style(OBJ_PROP_PARAMS) | Annotation
subject(OBJ_PROP_PARAMS) | Annotation
textFont(OBJ_PROP_PARAMS) | Annotation
textSize(OBJ_PROP_PARAMS) | Annotation
toggleNoView(OBJ_PROP_PARAMS) | Annotation
type(OBJ_PROP_PARAMS) | Annotation
vertices(OBJ_PROP_PARAMS) | Annotation
width(OBJ_PROP_PARAMS) | Annotation


Javascript API: search.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
search.h
Go to the documentation of this file.
1 #ifndef SEARCH_H_
2 #define SEARCH_H_
3
5 namespace javascript
6 {
8
16 class Index : public CFXJS_EmbedObj
17 {
18 public:
19 Index(CFXJS_Object * pJSObject);
20 virtual ~Index(void);
31 FX_BOOL available(OBJ_PROP_PARAMS);
50 FX_BOOL name(OBJ_PROP_PARAMS);
61 FX_BOOL path(OBJ_PROP_PARAMS);
72 FX_BOOL selected(OBJ_PROP_PARAMS);
73
74 public:
75 bool m_bAvailable;
76 bool m_bSelected;
77 CFX_WideString m_csName;
78 CFX_WideString m_csPath;
79
80 };
81
82 class CFXJS_Index : public CFXJS_Object
83 {
84 public:
85 CFXJS_Index(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
86 virtual ~CFXJS_Index(void) {};
87
88 DECLARE_JS_CLASS(CFXJS_Index)
89
90 JS_STATIC_PROP(available, Index)
91 JS_STATIC_PROP(name, Index)
92 JS_STATIC_PROP(path, Index)
93 JS_STATIC_PROP(selected, Index)
94 };
95
97
107 class search : public CFXJS_EmbedObj
108 {
109 public:
110 search(CFXJS_Object * pJSObject);
111 virtual ~search(void);
122 FX_BOOL matchWholeWord(OBJ_PROP_PARAMS);
133 FX_BOOL attachments(OBJ_PROP_PARAMS);
143 FX_BOOL bookmarks(OBJ_PROP_PARAMS);
153 FX_BOOL docText(OBJ_PROP_PARAMS);
163 FX_BOOL ignoreAccents(OBJ_PROP_PARAMS);
173 FX_BOOL markup(OBJ_PROP_PARAMS);
183 FX_BOOL matchCase(OBJ_PROP_PARAMS);
193 FX_BOOL maxDocs(OBJ_PROP_PARAMS);
203 FX_BOOL proximity(OBJ_PROP_PARAMS);
204 FX_BOOL refine(OBJ_PROP_PARAMS);
214 FX_BOOL stem(OBJ_PROP_PARAMS);
229 FX_BOOL wordMatching(OBJ_PROP_PARAMS);
239 FX_BOOL ignoreAsianCharacterWidth(OBJ_PROP_PARAMS);
258 FX_BOOL query(OBJ_METHOD_PARAMS);
276 FX_BOOL addIndex(OBJ_METHOD_PARAMS);
284 FX_BOOL removeIndex(OBJ_METHOD_PARAMS);
285 private:
286 FX_SearchOption m_searchOpt;
287 };
288
289 class CFXJS_Search : public CFXJS_Object
290 {
291 public:
292 CFXJS_Search( CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
293 virtual ~CFXJS_Search(void){};
294
295 DECLARE_JS_CLASS(CFXJS_Search);
296 JS_STATIC_PROP(matchWholeWord, search);
297 JS_STATIC_PROP(attachments, search);
298 JS_STATIC_PROP(bookmarks, search);
299 JS_STATIC_PROP(docText, search);
300 JS_STATIC_PROP(ignoreAccents, search);
301 JS_STATIC_PROP(markup, search);
302 JS_STATIC_PROP(matchCase, search);
303 JS_STATIC_PROP(maxDocs, search);
304 JS_STATIC_PROP(proximity, search);
305 JS_STATIC_PROP(refine, search);
306 JS_STATIC_PROP(stem, search);
307 JS_STATIC_PROP(wordMatching, search);
308 JS_STATIC_PROP(ignoreAsianCharacterWidth, search)
309
310 JS_STATIC_METHOD(query, search);
311 JS_STATIC_METHOD(addIndex, search);
312 JS_STATIC_METHOD(removeIndex, search);
313 };
314 }//namespace fxJavascript
315
316 #endif//SEARCH_H_
search
The search object is a static object that accesses the functionality provided by the Phantom Search p...
Definition: search.h:107
Index
An object that represents a Catalog-generated index. It is non-creatable and returned by various meth...
Definition: search.h:16


Javascript API: Member List

Link Member List

This is the complete list of members for Link, including all inherited members.

borderColor(OBJ_PROP_PARAMS) | Link
borderWidth(OBJ_PROP_PARAMS) | Link
highlightMode(OBJ_PROP_PARAMS) | Link
rect(OBJ_PROP_PARAMS) | Link
setAction(OBJ_METHOD_PARAMS) | Link


Javascript API: document.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
document.h
Go to the documentation of this file.
1 #ifndef _DOCUMENT_H_
2 #define _DOCUMENT_H_
3
4
5 #include "annotation.h"
6 //class CFX_Annot;
7 class CPDF_Page;
8 class CPDF_Document;
10
11 namespace javascript
12 {
13 class Doc;
14 class CFXJS_Icon;
15 struct CFXJS_AnnotObj;
16 // class BasicEventInfo;
17 class JField;
18 struct print_Range;
19 //#ifdef BUILD_PHANTOM
20 struct JS_WatemarkElementInfo;
21 //#endif
22 struct CFXJS_DelayData;
23
24 struct TemplateElement
25 {
26 TemplateElement() : csName(""), hValue(NULL) {}
27 ~TemplateElement()
28 {
29 if (hValue)
30 FXJSE_Value_Release(hValue);
31 }
32 CFX_ByteString csName;
33 FXJSE_HVALUE hValue;
34 };
35 struct IconElement
36 {
37 IconElement() : IconName(L""), IconStream(NULL), NextIcon(NULL) {}
38 virtual ~IconElement()
39 {
40 }
41 CFX_WideString IconName;
42 IconElement* NextIcon;
43 CFXJS_Icon* IconStream;
44 };
45
46 class JIconTree
47 {
48 public:
49 JIconTree() :m_pHead(NULL), m_pEnd(NULL), m_iLength(0)
50 {
51
52 }
53
54 virtual ~JIconTree()
55 {
56 }
57
58 public:
59 void InsertIconElement(IconElement* pNewIcon);
60 void DeleteIconElement(CFX_WideString swIconName);
61 void DeleteIconTree();
62 int GetLength();
63 IconElement* operator[](int iIndex);
64
65 private:
66 IconElement * m_pHead;
67 IconElement* m_pEnd;
68 int m_iLength;
69 };
70
71
72 typedef struct _JS_BulbMessageInfo
73 {
74 CFX_ByteString name;
75 CFX_WideString message;
76 CFX_WideString title;
77 void* pPriData;
78 int opBtnCount;
79 CFX_ArrayTemplate<CFX_ByteString> arOpBtnName;
80 CFX_ArrayTemplate<CFX_WideString> arOpBtnTitle;
81 //FXJSE_HVALUE hCallbackFunc;
82 //std::vector<std::unique_ptr<BasicEventInfo> > arCallbackFunc;
83 CFXJS_Runtime* pRuntime;
84 Doc* pJSDoc;
85 _JS_BulbMessageInfo()
86 {
87 name = "";
88 message = L"";
89 title = L"";
90 pPriData = NULL;
91 opBtnCount = 0;
92 pRuntime = NULL;
93 pJSDoc = NULL;
94 }
95 }JS_BULBMESSAGEINFO, *JS_PBULBMESSAGEINFO;
96
97
98 class Info : public CFXJS_EmbedObj
99 {
100 public:
101 Info(CFXJS_Object* pJSObject);
102 virtual ~Info();
103 FX_BOOL Title(OBJ_PROP_PARAMS);
104 FX_BOOL Author(OBJ_PROP_PARAMS);
105 FX_BOOL Subject(OBJ_PROP_PARAMS);
106 FX_BOOL Keywords(OBJ_PROP_PARAMS);
107 FX_BOOL Creator(OBJ_PROP_PARAMS);
108 FX_BOOL Producer(OBJ_PROP_PARAMS);
109 FX_BOOL CreationDate(OBJ_PROP_PARAMS);
110 FX_BOOL ModDate(OBJ_PROP_PARAMS);
111 FX_BOOL Trapped(OBJ_PROP_PARAMS);
112 void AttachDoc(IFXJS_DocumentProvider* pDocument);
113 private:
114 FX_BOOL DealWithInfoObject(FXJSE_HVALUE hValue, FX_BOOL IsSet, FX_BSTR csName);
115
116 IFXJS_DocumentProvider* m_pDocument;
117 };
118 class CFXJS_DocInfoList : public CFXJS_Object
119 {
120 public:
121 CFXJS_DocInfoList(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
122 virtual ~CFXJS_DocInfoList() {};
123
124 public:
125 DECLARE_JS_CLASS(CFXJS_DocInfoList);
126 JS_STATIC_PROP(Title, Info);
127 JS_STATIC_PROP(Author, Info);
128 JS_STATIC_PROP(Subject, Info);
129 JS_STATIC_PROP(Keywords, Info);
130 JS_STATIC_PROP(Creator, Info);
131 JS_STATIC_PROP(Producer, Info);
132 JS_STATIC_PROP(CreationDate, Info);
133 JS_STATIC_PROP(ModDate, Info);
134 JS_STATIC_PROP(Trapped, Info);
135 };
136 //struct CJS_DelayData;
137 //struct CJS_DelayAnnot;
138 //struct CJS_AnnotObj;
139
140
141 struct CJS_FIELD
142 {
143 enum EXPORT_TYPE
144 {
145 FDF = 0,
146 TXT,
147 XFDF,
148 XFDFSTR
149 };
150
151 FX_BOOL bAllField = false;
152 FX_BOOL bNoPassWord = true;
153 CFX_PtrArray aFields;
154 FX_BOOL bFlags = false;
155
156 CFX_WideString cPath = L"";
157 FX_BOOL bAnnotations = false;
158 EXPORT_TYPE type;
159
160 CFX_WideString cHRef = L"";
161 CFX_ByteString csXFDFStr = "";
162
163 };
164 struct InfoWord
165 {
166 InfoWord()
167 {
168 wsWord = L"";
169 nStart = 0;
170 nEnd = 0;
171 nCount = 0;
172 }
173 int nStart;
174 int nEnd;
175 int nCount;
176 CFX_WideString wsWord;
177 };
178 #define DURATION_INIT -10
179 struct TransDict
180 {
181 CFX_ByteString csM = "I";//Split, Box and Fly transition styles only
182 CFX_ByteString csDm = "";//Split and Blinds transition styles only
183 int nDi = 0;//Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only
184 int nDuration = DURATION_INIT;
185 CFX_ByteString csTransition = "";
186 int nTransDuration = -1;
187 };
189
195 class IFXJS_DialogProvider;
196 class IFXJS_FileAttachmentProvider;
197 class IFXJS_PrintMgrProvider;
202 class Doc : public Root
203 {
204 public:
205 Doc(CFXJS_Object* pJSObject);
206 virtual ~Doc();
207
208 public:
209 FX_BOOL ADBE(OBJ_PROP_PARAMS);
228 FX_BOOL author(OBJ_PROP_PARAMS);
247 FX_BOOL baseURL(OBJ_PROP_PARAMS);
248
274 FX_BOOL bookmarkRoot(OBJ_PROP_PARAMS);
275
295 FX_BOOL calculate(OBJ_PROP_PARAMS);
296
297 FX_BOOL Collab(OBJ_PROP_PARAMS);
298
313 FX_BOOL creationDate(OBJ_PROP_PARAMS);
314
333 FX_BOOL creator(OBJ_PROP_PARAMS);
334
354 FX_BOOL delay(OBJ_PROP_PARAMS);
355
384 FX_BOOL dirty(OBJ_PROP_PARAMS);
385
403 FX_BOOL documentFileName(OBJ_PROP_PARAMS);
404
427 FX_BOOL external(OBJ_PROP_PARAMS);
428
443 FX_BOOL filesize(OBJ_PROP_PARAMS);
444
476 FX_BOOL icons(OBJ_PROP_PARAMS);
477
515 FX_BOOL info(OBJ_PROP_PARAMS);
516
535 FX_BOOL keywords(OBJ_PROP_PARAMS);
536
558 FX_BOOL layout(OBJ_PROP_PARAMS);
559
578 FX_BOOL media(OBJ_PROP_PARAMS);
579
594 FX_BOOL modDate(OBJ_PROP_PARAMS);
595
614 FX_BOOL mouseX(OBJ_PROP_PARAMS);
615
626 FX_BOOL mouseY(OBJ_PROP_PARAMS);
627
642 FX_BOOL numFields(OBJ_PROP_PARAMS);
643
664 FX_BOOL numPages(OBJ_PROP_PARAMS);
665
684 FX_BOOL pageNum(OBJ_PROP_PARAMS);
685
701 FX_BOOL pageWindowRect(OBJ_PROP_PARAMS);
702
718 FX_BOOL path(OBJ_PROP_PARAMS);
719
738 FX_BOOL producer(OBJ_PROP_PARAMS);
739
757 FX_BOOL securityHandler(OBJ_PROP_PARAMS);
758
778 FX_BOOL subject(OBJ_PROP_PARAMS);
779
798 FX_BOOL title(OBJ_PROP_PARAMS);
799
818 FX_BOOL zoom(OBJ_PROP_PARAMS);
819
846 FX_BOOL zoomType(OBJ_PROP_PARAMS);
847
865 FX_BOOL dynamicXFAForm(OBJ_PROP_PARAMS);
866
878 FX_BOOL URL(OBJ_PROP_PARAMS);
879
899 FX_BOOL dataObjects(OBJ_PROP_PARAMS);
900
912 FX_BOOL hostContainer(OBJ_PROP_PARAMS);
913
949 FX_BOOL xfa(OBJ_PROP_PARAMS);
950
973 FX_BOOL templates(OBJ_PROP_PARAMS);
974
975 FX_BOOL page(OBJ_PROP_PARAMS);
976 FX_BOOL guid(OBJ_PROP_PARAMS);
977 FX_BOOL isInProtectedViewMode(OBJ_PROP_PARAMS);
978 FX_BOOL ANSB_None(OBJ_PROP_PARAMS);
979 FX_BOOL ANSB_Page(OBJ_PROP_PARAMS);
980 FX_BOOL ANSB_Seq(OBJ_PROP_PARAMS);
981 FX_BOOL ANSB_Author(OBJ_PROP_PARAMS);
982 FX_BOOL ANSB_ModDate(OBJ_PROP_PARAMS);
983 FX_BOOL ANSB_Type(OBJ_PROP_PARAMS);
984 FX_BOOL ANSB_Subject(OBJ_PROP_PARAMS);
985 FX_BOOL ANFB_ShouldNone(OBJ_PROP_PARAMS);
986 FX_BOOL ANFB_ShouldPrint(OBJ_PROP_PARAMS);
987 FX_BOOL ANFB_ShouldView(OBJ_PROP_PARAMS);
988 FX_BOOL ANFB_ShouldEdit(OBJ_PROP_PARAMS);
989 FX_BOOL ANFB_ShouldAppearInPanel(OBJ_PROP_PARAMS);
990 FX_BOOL ANFB_ShouldSummarize(OBJ_PROP_PARAMS);
991 FX_BOOL ANFB_ShouldExport(OBJ_PROP_PARAMS);
992 FX_BOOL ANFB_ShouldCollaborate(OBJ_PROP_PARAMS);
993
1033 FX_BOOL addAnnot(OBJ_METHOD_PARAMS);
1070 FX_BOOL addField(OBJ_METHOD_PARAMS);
1104 FX_BOOL addLink(OBJ_METHOD_PARAMS);
1120 FX_BOOL addIcon(OBJ_METHOD_PARAMS);
1132 FX_BOOL calculateNow(OBJ_METHOD_PARAMS);
1151 FX_BOOL closeDoc(OBJ_METHOD_PARAMS);
1152 FX_BOOL createDataObject(OBJ_METHOD_PARAMS);
1153 FX_BOOL createIcon(OBJ_METHOD_PARAMS);
1175 FX_BOOL createTemplate(OBJ_METHOD_PARAMS);
1192 FX_BOOL deletePages(OBJ_METHOD_PARAMS);
1213 FX_BOOL exportAsText(OBJ_METHOD_PARAMS);
1236 FX_BOOL exportAsFDF(OBJ_METHOD_PARAMS);
1254 FX_BOOL exportAsXFDF(OBJ_METHOD_PARAMS);
1273 FX_BOOL exportAsXFDFStr(OBJ_METHOD_PARAMS);
1274
1275 FX_BOOL exportXFAData(OBJ_METHOD_PARAMS);
1295 FX_BOOL extractPages(OBJ_METHOD_PARAMS);
1316 FX_BOOL exportDataObject(OBJ_METHOD_PARAMS);
1336 FX_BOOL getAnnot(OBJ_METHOD_PARAMS);
1363 FX_BOOL getAnnots(OBJ_METHOD_PARAMS);
1364 FX_BOOL getAnnot3D(OBJ_METHOD_PARAMS);
1365 FX_BOOL getAnnots3D(OBJ_METHOD_PARAMS);
1404 FX_BOOL getField(OBJ_METHOD_PARAMS);
1405 FX_BOOL getIcon(OBJ_METHOD_PARAMS);
1432 FX_BOOL getLinks(OBJ_METHOD_PARAMS);
1450 FX_BOOL getNthFieldName(OBJ_METHOD_PARAMS);
1468 FX_BOOL getOCGs(OBJ_METHOD_PARAMS);
1488 FX_BOOL getPageBox(OBJ_METHOD_PARAMS);
1507 FX_BOOL getPageNthWord(OBJ_METHOD_PARAMS);
1508 FX_BOOL getPageNthWordQuads(OBJ_METHOD_PARAMS);
1525 FX_BOOL getPageNumWords(OBJ_METHOD_PARAMS);
1543 FX_BOOL getPageRotation(OBJ_METHOD_PARAMS);
1556 FX_BOOL getPrintParams(OBJ_METHOD_PARAMS);
1570 FX_BOOL getURL(OBJ_METHOD_PARAMS);
1588 FX_BOOL getDataObject(OBJ_METHOD_PARAMS);
1607 FX_BOOL getTemplate(OBJ_METHOD_PARAMS);
1628 FX_BOOL gotoNamedDest(OBJ_METHOD_PARAMS);
1643 FX_BOOL importAnFDF(OBJ_METHOD_PARAMS);
1658 FX_BOOL importAnXFDF(OBJ_METHOD_PARAMS);
1678 FX_BOOL importDataObject(OBJ_METHOD_PARAMS);
1711 FX_BOOL importTextData(OBJ_METHOD_PARAMS);
1712
1713 FX_BOOL importXFAData(OBJ_METHOD_PARAMS);
1740 FX_BOOL insertPages(OBJ_METHOD_PARAMS);
1769 FX_BOOL mailForm(OBJ_METHOD_PARAMS);
1803 FX_BOOL print(OBJ_METHOD_PARAMS);
1821 FX_BOOL removeField(OBJ_METHOD_PARAMS);
1843 FX_BOOL removeDataObject(OBJ_METHOD_PARAMS);
1857 FX_BOOL removeTemplate(OBJ_METHOD_PARAMS);
1876 FX_BOOL replacePages(OBJ_METHOD_PARAMS);
1906 FX_BOOL resetForm(OBJ_METHOD_PARAMS);
1907
1908 FX_BOOL saveAs(OBJ_METHOD_PARAMS);
1950 FX_BOOL submitForm(OBJ_METHOD_PARAMS);
1984 FX_BOOL mailDoc(OBJ_METHOD_PARAMS);
1985 FX_BOOL removeIcon(OBJ_METHOD_PARAMS);
1986 FX_BOOL spawnPageFromTemplate(OBJ_METHOD_PARAMS);
2005 FX_BOOL scroll(OBJ_METHOD_PARAMS);
2027 FX_BOOL syncAnnotScan(OBJ_METHOD_PARAMS);
2028
2029 //FX_BOOL createBulbmessage(OBJ_METHOD_PARAMS);
2030 //FX_BOOL showBulbmessage(OBJ_METHOD_PARAMS);
2031 FX_BOOL addPageOpenJSMessage(OBJ_METHOD_PARAMS);
2032 FX_BOOL showBalloon(OBJ_METHOD_PARAMS);
2033 FX_BOOL hideBalloon(OBJ_METHOD_PARAMS);
2034 FX_BOOL getDocId(OBJ_METHOD_PARAMS);
2035 FX_BOOL getVersionID(OBJ_METHOD_PARAMS);
2036 FX_BOOL isCpdf(OBJ_METHOD_PARAMS);
2037 FX_BOOL getPageCount(OBJ_METHOD_PARAMS);
2038 FX_BOOL getCurPageIndex(OBJ_METHOD_PARAMS);
2039 FX_BOOL convertTocPDF(OBJ_METHOD_PARAMS);
2040 FX_BOOL saveAsNewcPDF(OBJ_METHOD_PARAMS);
2041 //FX_BOOL getDigestId(OBJ_METHOD_PARAMS);
2042 FX_BOOL getSize(OBJ_METHOD_PARAMS);
2043 FX_BOOL readBuf(OBJ_METHOD_PARAMS);
2044 FX_BOOL importAnnotFromXFDF(OBJ_METHOD_PARAMS);
2045 FX_BOOL exportAnonymousAnnot(OBJ_METHOD_PARAMS);
2046 FX_BOOL exportAllAnnots(OBJ_METHOD_PARAMS);
2047 FX_BOOL deleteAnnot(OBJ_METHOD_PARAMS);
2048 FX_BOOL goToAnnot(OBJ_METHOD_PARAMS);
2049 FX_BOOL saveOfflineCopy(OBJ_METHOD_PARAMS);
2050 FX_BOOL getEncryptionMethod(OBJ_METHOD_PARAMS);
2051 FX_BOOL getURI(OBJ_METHOD_PARAMS);
2052 FX_BOOL getPageObjNum(OBJ_METHOD_PARAMS);
2053 FX_BOOL getPageIndexByPageObjNum(OBJ_METHOD_PARAMS);
2054 FX_BOOL isForm(OBJ_METHOD_PARAMS);
2055 FX_BOOL setReviewType(OBJ_METHOD_PARAMS);
2056
2057 FX_BOOL activePin(OBJ_METHOD_PARAMS);
2058 FX_BOOL deletePin(OBJ_METHOD_PARAMS);
2059 FX_BOOL createPin(OBJ_METHOD_PARAMS);
2060 FX_BOOL hoverPin(OBJ_METHOD_PARAMS);
2061
2062 FX_BOOL updateACL(OBJ_METHOD_PARAMS);
2063 FX_BOOL addAdLayer(OBJ_METHOD_PARAMS);
2064 FX_BOOL gotoPage(OBJ_METHOD_PARAMS);
2084 FX_BOOL setPageTabOrder(OBJ_METHOD_PARAMS);
2085
2086 //#ifdef BUILD_PHANTOM
2087
2135 FX_BOOL addWatermarkFromText(OBJ_METHOD_PARAMS);
2184 FX_BOOL addWatermarkFromFile(OBJ_METHOD_PARAMS);
2185 //#endif
2206 FX_BOOL flattenPages(OBJ_METHOD_PARAMS);
2227 FX_BOOL setPageTransitions(OBJ_METHOD_PARAMS);
2246 FX_BOOL getPageTransition(OBJ_METHOD_PARAMS);
2247
2248 FX_BOOL selectPageNthWord(OBJ_METHOD_PARAMS);
2249
2250 FX_BOOL importIcon(OBJ_METHOD_PARAMS);
2267 FX_BOOL movePage(OBJ_METHOD_PARAMS);
2268
2287 FX_BOOL newPage(OBJ_METHOD_PARAMS);
2288
2306 FX_BOOL setPageRotations(OBJ_METHOD_PARAMS);
2327 FX_BOOL setPageBoxes(OBJ_METHOD_PARAMS);
2348 FX_BOOL addWeblinks(OBJ_METHOD_PARAMS);
2349
2369 FX_BOOL removeWeblinks(OBJ_METHOD_PARAMS);
2370
2393 FX_BOOL removeLinks(OBJ_METHOD_PARAMS);
2394
2408 FX_BOOL getOCGOrder(OBJ_METHOD_PARAMS);
2428 FX_BOOL setOCGOrder(OBJ_METHOD_PARAMS);
2429
2430 FX_BOOL setPageLabels(OBJ_METHOD_PARAMS);
2431 FX_BOOL getPageLabel(OBJ_METHOD_PARAMS);
2432 FXJSE_HRUNTIME GetHRunTime();
2433 public:
2434 void AttachDoc(IFXJS_DocumentProvider* pDoc);
2435 IFXJS_DocumentProvider* GetReaderDoc();
2436 void AttachDialog(IFXJS_DialogProvider* pDialog);
2437 void AttachFileAttachment(IFXJS_FileAttachmentProvider* pFileAttachment);
2438
2439 static FX_BOOL ExtractFileName(IFXJS_DocumentProvider* pDoc, CFX_ByteString& strFileName);
2440 static FX_BOOL ExtractFolderName(IFXJS_DocumentProvider* pDoc, CFX_ByteString& strFolderName);
2441
2442 public:
2443 CFXJS_DelayData * AddDelayData(CFX_WideString field_name, int control_index, FIELD_PROP prop);
2444 void DoFieldDelay(const CFX_WideString& sFieldName, JS_ErrorString& sError, int nControlIndex);
2445
2446 CFXJS_AnnotObj* AddDelayAnnotData(IFXJS_AnnotProvider* annot, ANNOT_TYPE annot_type, CFX_WideString name);
2447 void DoAnnotDelay(CFX_WideString cwNM);
2448
2449 CPDF_Document* GetDocument();
2450 FXJSE_HRUNTIME m_hRuntime;
2451 //annot
2452 FXJSE_HVALUE GetAnnotHValueByGUID(CFX_ByteString bsGUID);
2453 FXJSE_HVALUE GetAnnotHValue(IFXJS_AnnotProvider* pAnnot);
2454 void DeleteAnnotHValue(FX_INT32 nPageIndex, CFX_WideString wsAnnotName);
2455 Annotation* GetJSAnnotByReaderAnnot(IFXJS_AnnotProvider* pAnnot);
2456 CFX_RectArray &GetRcWordquads() { return m_rcWordquads; }
2457 void OnConvertToCPDF();
2458 void OnSaveAsNewCPDF(const CFX_WideString& wsNewName);
2459 void OnExportAnnots(FX_BOOL bAnnoymous);
2460 static FX_BOOL CallbackExportAnnots(CFX_Object* JsDoc,FX_BOOL bAnnoy);
2461 static FX_BOOL CallbackConvertToCPDFMessasge(CFX_Object* JsDoc);
2462 static FX_BOOL CallbackSaveAsNewCPDFMessasge(CFX_Object* JsDoc,CFX_WideString NewName);
2463
2464 public: //print
2465 FX_BOOL IsShowPrintWaring();
2466 FX_BOOL PrintByJSPrintParams(CFXJSE_Arguments &args);
2467 FX_BOOL PrintByJSPrintParams(CFXJS_EmbedObj * pEmbedObj, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp);
2468 FX_BOOL PrintByJSPrintParams(FXJSE_HVALUE hFristValue);
2469
2470 void SetJSPrintMode(IFXJS_PrintMgrProvider* pPrintMgr, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp, FX_INT32 interactive);
2471 void SetJSPrintRange(IFXJS_PrintMgrProvider* pPrintMgr, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp);
2472 void SetJSPrinterGroup(IFXJS_PrintMgrProvider* pPrintMgr, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp);
2473 void SetJSPrintHandling(IFXJS_PrintMgrProvider* pPrintMgr, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp);
2474
2475 void SetJSPrintScale(IFXJS_PrintMgrProvider* pPrintMgr, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp, int nPageHandling);
2476 void SetJSPrintMultiple(IFXJS_PrintMgrProvider* pPrintMgr, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp);
2477 void SetJSPrintTileLarge(IFXJS_PrintMgrProvider* pPrintMgr, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp);
2478 void SetJSPrintBooklet(IFXJS_PrintMgrProvider* pPrintMgr, FXJSE_HVALUE hFristValue, FXJSE_HVALUE hProp);
2479
2480 FX_BOOL GetPrintRangeArry(FXJSE_HVALUE hProp, CFX_WordArray& wPrintPagesArry);
2481 FX_BOOL GetPrintRangeArry(FXJSE_HVALUE hProp, std::vector<print_Range>& printRangeVec);
2482 private:
2483 bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
2484 int CountWords(CPDF_TextObject* pTextObj);
2485 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
2486
2487 FX_BOOL ParserParams(JSFXObject pObj, CFXJS_AnnotObj& annotobj);
2488 FX_BOOL EnumNamedItems(CFX_ByteString csNameItem, CFX_WideStringArray& items);
2489 FX_BOOL EnumNamedItems(CPDF_Dictionary* pNode, CFX_WideStringArray& items);
2490
2491 FX_BOOL IsShareViewDoc();
2492 FX_BOOL GetByteStringArrFormHValue(FXJSE_HVALUE hValue, CFX_ByteStringArray &array);
2493 std::unique_ptr<TemplateElement> FindTemplates(CFX_ByteString csName, CPDF_Dictionary* pTemplates);
2494 FX_BOOL RemoveTemplate(CPDF_Dictionary* pTemplates, CFX_ByteString csName);
2495
2496 // FX_BOOL AddMessage(std::unique_ptr<JS_BULBMESSAGEINFO>&& msgInfo);
2497 // static void BulbMsgCenterBtn1ExecuteProc(void* clientData);
2498 // static void BulbMsgCenterBtn2ExecuteProc(void* clientData);
2499 // static void BulbMsgCenterBtn3ExecuteProc(void* clientData);
2500
2502 static FX_BOOL AnnotCanBeFetched(IFXJS_AnnotProvider* pAnnot);
2503
2504 //#ifdef BUILD_PHANTOM
2505 void ParseWatermarkParam(JS_WatemarkElementInfo& wInfo, int nStartIndex, const CFXJSE_Arguments& args);
2506 FX_BOOL AddWatermark(const JS_WatemarkElementInfo& wInfo);
2507 FX_BOOL IsValidFileType(const CFX_WideString wsFilePath);
2508 void CheckPageRange(JS_WatemarkElementInfo& wInfo);
2509 //#endif
2510 FX_BOOL ParseFieldParams(CFXJSE_Arguments &args, std::map<int, CFX_ByteString>& argMap, CJS_FIELD& fieldInfo, JS_ErrorString& sError);
2511 private:
2512 int GetWordSearch(std::wstring wsPageText, CFX_WideString wsRegExpression, int nWord);
2513 FX_BOOL GetFields(CFX_PtrArray& aFields, CFXJS_Runtime* pRunTime, FXJSE_HVALUE hValue, CPDF_InterForm* pPDFForm);
2514 CFXJS_Object* FindFieldObject(CFX_WideString cwName);
2515 FXJSE_HCLASS GetFieldObjectHClass(CFXJS_Runtime* pRuntime);
2516
2517 bool GetTrans(FXJSE_HVALUE hProp, TransDict& nTransDict);
2518 CFX_WideString GetTransNameByDict(CPDF_Dictionary* pDicTrans);
2519 void GetOCGs(CPDF_Array* pOCGOrderArray, FXJSE_HVALUE hRgValue);
2520 bool SetOCGs(CPDF_Array* pOCGOrderArray, FXJSE_HVALUE hParam);
2521
2522 private:
2523 CFX_RectArray m_rcWordquads;
2524 std::vector<InfoWord> m_InfoWord;
2525 std::unique_ptr<JIconTree> m_pIconTree;
2526 IFXJS_DocumentProvider* m_pDocument;
2527 CFX_WideString m_cwBaseURL;
2528
2529 FX_BOOL m_bDelay;
2530 std::vector<std::unique_ptr<CFXJS_DelayData> > m_DelayData;
2531 std::vector<std::unique_ptr<CFXJS_AnnotObj> > m_DelayAnnotData;
2532
2533 CFX_MapByteStringToPtr m_DataMap;
2534 CFX_MapPtrTemplate<IFXJS_DocumentProvider*, FX_BOOL> m_DocsMap;// the Doc has been showPrintWaring, Not need show again
2535 std::vector<std::unique_ptr<JS_BULBMESSAGEINFO> > m_arBulbMsgInfo;
2536 FXJSE_HCLASS m_hFieldClass;
2537 std::map<IFXJS_AnnotProvider::Observer, void*> m_AnnotToJSAnnot;
2538
2539 //CFX_MapPtrToPtr m_AnnotToJSAnnot;
2540
2541 /* std::unique_ptr<BasicEventInfo> m_hValueConvertToCPDFFunc;
2542 std::unique_ptr<BasicEventInfo> m_hExportAnnotSuccessFunc;
2543 std::unique_ptr<BasicEventInfo> m_hValueSaveAsNewCPDFFunc;*/
2544
2545 //getAnnots param nSortBy values.
2546 const int m_ANSB_None_Value = 0;
2547 const int m_ANSB_Page_Value = 1;
2548 const int m_ANSB_Seq_Value = 2;
2549 const int m_ANSB_Author_Value = 3;
2550 const int m_ANSB_ModDate_Value = 4;
2551 const int m_ANSB_Type_Value = 5;
2552 const int m_ANSB_Subject_Value = 6;
2553
2554 //getAnnots param nFilterBy values. Values not listed in js api reference are commented out.
2555 const int m_ANFB_ShouldNone_Value = 7;
2556 const int m_ANFB_ShouldPrint_Value = 0;
2557 const int m_ANFB_ShouldView_Value = 1;
2558 const int m_ANFB_ShouldEdit_Value = 2;
2559 const int m_ANFB_ShouldAppearInPanel_Value = 3;
2560 const int m_ANFB_ShouldSummarize_Value = 4;
2561 const int m_ANFB_ShouldExport_Value = 5;
2562 const int m_ANFB_ShouldCollaborate_Value = 6;
2563
2564 };
2566 class CFXJS_Document : public CFXJS_Root
2567 {
2568 public:
2569 CFXJS_Document(CFXJS_Runtime* pRuntime);
2570 virtual ~CFXJS_Document() {};
2571
2572 DECLARE_ROOT_CLASS(CFXJS_Document);
2573
2574 JS_STATIC_PROP(ADBE, Doc);
2575 JS_STATIC_PROP(author, Doc);
2576 JS_STATIC_PROP(baseURL, Doc);
2577 JS_STATIC_PROP(bookmarkRoot, Doc);
2578 JS_STATIC_PROP(calculate, Doc);
2579 JS_STATIC_PROP(Collab, Doc);
2580 JS_STATIC_PROP(creationDate, Doc);
2581 JS_STATIC_PROP(creator, Doc);
2582 JS_STATIC_PROP(delay, Doc);
2583 JS_STATIC_PROP(dirty, Doc);
2584 JS_STATIC_PROP(documentFileName, Doc);
2585 JS_STATIC_PROP(external, Doc);
2586 JS_STATIC_PROP(filesize, Doc);
2587 JS_STATIC_PROP(icons, Doc);
2588 JS_STATIC_PROP(info, Doc);
2589 JS_STATIC_PROP(keywords, Doc);
2590 JS_STATIC_PROP(layout, Doc);
2591 JS_STATIC_PROP(media, Doc);
2592 JS_STATIC_PROP(modDate, Doc);
2593 JS_STATIC_PROP(mouseX, Doc);
2594 JS_STATIC_PROP(mouseY, Doc);
2595 JS_STATIC_PROP(numFields, Doc);
2596 JS_STATIC_PROP(numPages, Doc);
2597 JS_STATIC_PROP(pageNum, Doc);
2598 JS_STATIC_PROP(pageWindowRect, Doc);
2599 JS_STATIC_PROP(path, Doc);
2600 JS_STATIC_PROP(producer, Doc);
2601 JS_STATIC_PROP(securityHandler, Doc);
2602 JS_STATIC_PROP(subject, Doc);
2603 JS_STATIC_PROP(title, Doc);
2604 JS_STATIC_PROP(zoom, Doc);
2605 JS_STATIC_PROP(zoomType, Doc);
2606 JS_STATIC_PROP(dynamicXFAForm, Doc);
2607 JS_STATIC_PROP(URL, Doc);
2608 JS_STATIC_PROP(dataObjects, Doc);
2609 JS_STATIC_PROP(hostContainer, Doc);
2610 JS_STATIC_PROP(xfa, Doc);
2611 JS_STATIC_PROP(templates, Doc);
2612 JS_STATIC_PROP(page, Doc);
2613 JS_STATIC_PROP(guid, Doc);
2614 JS_STATIC_PROP(isInProtectedViewMode, Doc);
2615 JS_STATIC_PROP(ANSB_None, Doc)
2616 JS_STATIC_PROP(ANSB_Page, Doc)
2617 JS_STATIC_PROP(ANSB_Seq, Doc)
2618 JS_STATIC_PROP(ANSB_Author, Doc)
2619 JS_STATIC_PROP(ANSB_ModDate, Doc)
2620 JS_STATIC_PROP(ANSB_Type, Doc)
2621 JS_STATIC_PROP(ANSB_Subject, Doc)
2622 JS_STATIC_PROP(ANFB_ShouldNone, Doc)
2623 JS_STATIC_PROP(ANFB_ShouldPrint, Doc)
2624 JS_STATIC_PROP(ANFB_ShouldView, Doc)
2625 JS_STATIC_PROP(ANFB_ShouldEdit, Doc)
2626 JS_STATIC_PROP(ANFB_ShouldAppearInPanel, Doc)
2627 JS_STATIC_PROP(ANFB_ShouldSummarize, Doc)
2628 JS_STATIC_PROP(ANFB_ShouldExport, Doc)
2629 JS_STATIC_PROP(ANFB_ShouldCollaborate, Doc)
2630
2631 JS_STATIC_METHOD(addAnnot, Doc);
2632 JS_STATIC_METHOD(addField, Doc);
2633 JS_STATIC_METHOD(addLink, Doc);
2634 JS_STATIC_METHOD(addIcon, Doc);
2635 JS_STATIC_METHOD(calculateNow, Doc);
2636 JS_STATIC_METHOD(closeDoc, Doc);
2637 JS_STATIC_METHOD(createDataObject, Doc);
2638 JS_STATIC_METHOD(createIcon, Doc);
2639 JS_STATIC_METHOD(createTemplate, Doc);
2640 JS_STATIC_METHOD(deletePages, Doc);
2641 JS_STATIC_METHOD(exportAsText, Doc);
2642 JS_STATIC_METHOD(exportAsFDF, Doc);
2643 JS_STATIC_METHOD(exportAsXFDF, Doc);
2644 JS_STATIC_METHOD(exportAsXFDFStr, Doc);
2645 JS_STATIC_METHOD(exportXFAData, Doc);
2646 JS_STATIC_METHOD(extractPages, Doc);
2647 JS_STATIC_METHOD(exportDataObject, Doc);
2648 JS_STATIC_METHOD(getAnnot, Doc);
2649 JS_STATIC_METHOD(getAnnots, Doc);
2650 JS_STATIC_METHOD(getAnnot3D, Doc);
2651 JS_STATIC_METHOD(getAnnots3D, Doc);
2652 JS_STATIC_METHOD(getField, Doc);
2653 JS_STATIC_METHOD(getIcon, Doc);
2654 JS_STATIC_METHOD(getLinks, Doc);
2655 JS_STATIC_METHOD(getNthFieldName, Doc);
2656 JS_STATIC_METHOD(getOCGs, Doc);
2657 JS_STATIC_METHOD(getPageBox, Doc);
2658 JS_STATIC_METHOD(getPageNthWord, Doc);
2659 JS_STATIC_METHOD(getPageNthWordQuads, Doc);
2660 JS_STATIC_METHOD(getPageNumWords, Doc);
2661 JS_STATIC_METHOD(getPageRotation, Doc);
2662 JS_STATIC_METHOD(getPrintParams, Doc);
2663 JS_STATIC_METHOD(getURL, Doc);
2664 JS_STATIC_METHOD(getDataObject, Doc);
2665 JS_STATIC_METHOD(getTemplate, Doc);
2666 JS_STATIC_METHOD(removeDataObject, Doc);
2667 JS_STATIC_METHOD(gotoNamedDest, Doc);
2668 JS_STATIC_METHOD(importAnFDF, Doc);
2669 JS_STATIC_METHOD(importAnXFDF, Doc);
2670 JS_STATIC_METHOD(importDataObject, Doc);
2671 JS_STATIC_METHOD(importTextData, Doc);
2672 JS_STATIC_METHOD(importXFAData, Doc);
2673 JS_STATIC_METHOD(insertPages, Doc);
2674 JS_STATIC_METHOD(mailForm, Doc);
2675 JS_STATIC_METHOD(print, Doc);
2676 JS_STATIC_METHOD(removeField, Doc);
2677 JS_STATIC_METHOD(replacePages, Doc);
2678 JS_STATIC_METHOD(removeIcon, Doc);
2679 JS_STATIC_METHOD(removeTemplate, Doc);
2680 JS_STATIC_METHOD(resetForm, Doc);
2681 JS_STATIC_METHOD(saveAs, Doc);
2682 JS_STATIC_METHOD(submitForm, Doc);
2683 JS_STATIC_METHOD(mailDoc, Doc);
2684 JS_STATIC_METHOD(spawnPageFromTemplate, Doc);
2685 JS_STATIC_METHOD(scroll, Doc);
2686 JS_STATIC_METHOD(syncAnnotScan, Doc);
2687
2688 //JS_STATIC_METHOD(createBulbmessage,Doc);
2689 //JS_STATIC_METHOD(showBulbmessage,Doc);
2690 JS_STATIC_METHOD(addPageOpenJSMessage, Doc);
2691 JS_STATIC_METHOD(showBalloon, Doc);
2692 JS_STATIC_METHOD(hideBalloon, Doc);
2693 JS_STATIC_METHOD(convertTocPDF, Doc);
2694 JS_STATIC_METHOD(saveAsNewcPDF, Doc);
2695 JS_STATIC_METHOD(getDocId, Doc);
2696 JS_STATIC_METHOD(getVersionID, Doc);
2697 JS_STATIC_METHOD(isCpdf, Doc);
2698 JS_STATIC_METHOD(getCurPageIndex, Doc);
2699 JS_STATIC_METHOD(getPageCount, Doc);
2700 //JS_STATIC_METHOD(getDigestId,Doc);
2701 JS_STATIC_METHOD(getSize, Doc);
2702 JS_STATIC_METHOD(readBuf, Doc);
2703 JS_STATIC_METHOD(importAnnotFromXFDF, Doc)
2704 JS_STATIC_METHOD(exportAnonymousAnnot, Doc)
2705 JS_STATIC_METHOD(exportAllAnnots, Doc)
2706 JS_STATIC_METHOD(deleteAnnot, Doc)
2707 JS_STATIC_METHOD(goToAnnot, Doc)
2708 JS_STATIC_METHOD(saveOfflineCopy, Doc)
2709 JS_STATIC_METHOD(getEncryptionMethod, Doc)
2710 JS_STATIC_METHOD(getURI, Doc)
2711 JS_STATIC_METHOD(getPageObjNum, Doc)
2712 JS_STATIC_METHOD(getPageIndexByPageObjNum, Doc)
2713 JS_STATIC_METHOD(isForm, Doc)
2714 JS_STATIC_METHOD(setReviewType, Doc)
2715
2716 JS_STATIC_METHOD(activePin, Doc);
2717 JS_STATIC_METHOD(deletePin, Doc);
2718 JS_STATIC_METHOD(createPin, Doc);
2719 JS_STATIC_METHOD(hoverPin, Doc);
2720
2721 JS_STATIC_METHOD(updateACL, Doc);
2722 JS_STATIC_METHOD(addAdLayer, Doc);
2723 JS_STATIC_METHOD(gotoPage, Doc);
2724 JS_STATIC_METHOD(setPageTabOrder, Doc);
2725
2726 //#ifdef BUILD_PHANTOM
2727 JS_STATIC_METHOD(addWatermarkFromText, Doc);
2728 JS_STATIC_METHOD(addWatermarkFromFile, Doc);
2729 //#endif
2730 JS_STATIC_METHOD(flattenPages, Doc);
2731 JS_STATIC_METHOD(setPageTransitions, Doc);
2732 JS_STATIC_METHOD(getPageTransition, Doc);
2733 JS_STATIC_METHOD(selectPageNthWord, Doc);
2734 JS_STATIC_METHOD(importIcon, Doc);
2735 JS_STATIC_METHOD(movePage, Doc);
2736 JS_STATIC_METHOD(newPage, Doc);
2737 JS_STATIC_METHOD(setPageRotations, Doc);
2738 JS_STATIC_METHOD(addWeblinks, Doc);
2739 JS_STATIC_METHOD(removeWeblinks, Doc);
2740 JS_STATIC_METHOD(setPageBoxes, Doc);
2741 JS_STATIC_METHOD(removeLinks, Doc)
2742 JS_STATIC_METHOD(getOCGOrder, Doc)
2743 JS_STATIC_METHOD(setOCGOrder, Doc)
2744 JS_STATIC_METHOD(setPageLabels, Doc);
2745 JS_STATIC_METHOD(getPageLabel, Doc);
2746 };
2747
2748 class Page :public CFXJS_EmbedObj
2749 {
2750 public:
2751 Page(CFXJS_Object* pObject) :CFXJS_EmbedObj(pObject) {}
2752 virtual ~Page() {}
2753
2754 public:
2755 FX_BOOL pageindex(OBJ_PROP_PARAMS);
2756
2757 void AttachDocument(IFXJS_DocumentProvider* pDoc);
2758
2759 IFXJS_DocumentProvider* m_pDoc;
2760 };
2761
2762 class CFXJS_Page :public CFXJS_Object
2763 {
2764 public:
2765 CFXJS_Page(CFXJS_Runtime* pRuntime) :CFXJS_Object(pRuntime) {}
2766 virtual ~CFXJS_Page() {};
2767
2768 DECLARE_JS_CLASS(CFXJS_Page)
2769
2770 JS_STATIC_PROP(pageindex, Page);
2771
2772 };
2773 }
2774
2775 #endif//_DOCUMENT_H_
2776
annotation.h
JavaScript API for attachment.
Doc
This object provides the interface between a PDF Doc open in the viewer and the JavaScript interprete...
Definition: document.h:202
Annotation
This object represents an Phantom annotation. Annotations can be created using the Phantom annotation...
Definition: annotation.h:335


Javascript API: Member List

attachment Member List

This is the complete list of members for attachment, including all inherited members.

contentStream(OBJ_PROP_PARAMS) | attachment
creationDate(OBJ_PROP_PARAMS) | attachment
MIMEType(OBJ_PROP_PARAMS) | attachment
modDate(OBJ_PROP_PARAMS) | attachment
name(OBJ_PROP_PARAMS) | attachment
path(OBJ_PROP_PARAMS) | attachment
size(OBJ_PROP_PARAMS) | attachment


Javascript API: Member List

Certificate Member List

This is the complete list of members for Certificate, including all inherited members.

binary(OBJ_PROP_PARAMS) | Certificate
issuerDN(OBJ_PROP_PARAMS) | Certificate
keyUsage(OBJ_PROP_PARAMS) | Certificate
MD5Hash(OBJ_PROP_PARAMS) | Certificate
privateKeyValidityEnd(OBJ_PROP_PARAMS) | Certificate
privateKeyValidityStart(OBJ_PROP_PARAMS) | Certificate
serialNumber(OBJ_PROP_PARAMS) | Certificate
SHA1Hash(OBJ_PROP_PARAMS) | Certificate
subjectCN(OBJ_PROP_PARAMS) | Certificate
subjectDN(OBJ_PROP_PARAMS) | Certificate
validityEnd(OBJ_PROP_PARAMS) | Certificate
validityStart(OBJ_PROP_PARAMS) | Certificate


Javascript API: bookmark.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
bookmark.h
Go to the documentation of this file.
1 #ifndef _BOOKMARK_H_
2 #define _BOOKMARK_H_
3
5
6 namespace javascript
7 {
8 class Doc;
10
19 class Bookmark : public CFXJS_EmbedObj
20 {
21 public:
22 Bookmark(CFXJS_Object* pJSObject);
23 virtual ~Bookmark();
24
25 public:
26
54 FX_BOOL children(OBJ_PROP_PARAMS);
55 FX_BOOL color(OBJ_PROP_PARAMS);
56
73 FX_BOOL doc(OBJ_PROP_PARAMS);
74
91 FX_BOOL name(OBJ_PROP_PARAMS);
92
109 FX_BOOL parent(OBJ_PROP_PARAMS);
110 FX_BOOL style(OBJ_PROP_PARAMS);
111
127 FX_BOOL open(OBJ_PROP_PARAMS);
128
129
146 FX_BOOL createChild(OBJ_METHOD_PARAMS);
147
163 FX_BOOL insertChild(OBJ_METHOD_PARAMS);
164
174 FX_BOOL remove(OBJ_METHOD_PARAMS);
175
192 FX_BOOL setAction(OBJ_METHOD_PARAMS);
193 FX_BOOL execute(OBJ_METHOD_PARAMS);
194 private:
195 CPDF_Dictionary * CreateChildDict(CPDF_Dictionary *pParentDict, CFX_WideString wsTitle, CFX_WideString wsJScExpr, int nChildIndex);
196 CPDF_Dictionary * InsertChildDict(CPDF_Dictionary *pParentDict, CPDF_Dictionary *pSrcDict, int nChildIndex);
197 FX_INT32 CheckMoveItemRelation(CPDF_Dictionary *pSrcItem, CPDF_Dictionary *pDestParent, CPDF_Dictionary *pDestAfter);
198 FX_BOOL RemoveDict(CPDF_Dictionary *pRemoveDict);
199 FX_BOOL SetActionDict(CPDF_Dictionary *pCurrentDict, CFX_WideString wsJScScript);
200 FX_BOOL IsExistBookmark(CPDF_Dictionary* pBookmark);
201 FX_BOOL RemoveItemDict(CPDF_Dictionary *pRemoveDict);
202 CPDF_Dictionary* GetTreeRoot(CPDF_Document* pDocument);
203 public:
204 void SetDoc(Doc* pDoc) { m_pJSDoc = pDoc; }
205 void SetBookmark(CPDF_Dictionary* pBookmark) { m_pBookmark = pBookmark; }
206 CPDF_Dictionary* GetBookmark() { return m_pBookmark; }
207 void SetRootBookmarkFlag(bool bRoot = true) { m_bRoot = bRoot; };
208 protected:
209 std::unique_ptr<CFXJS_Object> CreateObjectAndSet(FXJSE_HVALUE value, CPDF_Dictionary* dict, CFXJS_Runtime* pRuntime);
210 private:
211 Doc* m_pJSDoc;
212 CPDF_Dictionary* m_pBookmark;
213 bool m_bRoot;
214 };
215
216 class CFXJS_Bookmark : public CFXJS_Object
217 {
218 public:
219 CFXJS_Bookmark(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
220 virtual ~CFXJS_Bookmark() {};
221
222 public:
223 DECLARE_JS_CLASS(CFXJS_Bookmark);
224
225 JS_STATIC_PROP(children, Bookmark);
226 JS_STATIC_PROP(color, Bookmark);
227 JS_STATIC_PROP(doc, Bookmark);
228 JS_STATIC_PROP(name, Bookmark);
229 JS_STATIC_PROP(parent, Bookmark);
230 JS_STATIC_PROP(style, Bookmark);
231 JS_STATIC_PROP(open, Bookmark);
232
233 JS_STATIC_METHOD(createChild, Bookmark);
234 JS_STATIC_METHOD(insertChild, Bookmark);
235 JS_STATIC_METHOD(remove, Bookmark);
236 JS_STATIC_METHOD(setAction, Bookmark);
237 JS_STATIC_METHOD(execute, Bookmark);
238 };
239 }
240
241 #endif //_BOOKMARK_H_
Doc
This object provides the interface between a PDF Doc open in the viewer and the JavaScript interprete...
Definition: document.h:202
Bookmark
A Bookmark object represents a node in the bookmark tree that appears in the bookmarks navigational p...
Definition: bookmark.h:19


Javascript API: annotation.h Source File

  • G:
  • workspace
  • javascript
  • interaction
  • src
  • javascript
  • inc
annotation.h
Go to the documentation of this file.
1 #ifndef _ANNOTATION_H_
2 #define _ANNOTATION_H_
3
4 #include "fpdfannot/fpdf_annot.h"
5 #include "fxge/fx_color.h"
6 #include "../../../include/javascript/fx_jsAnnotProvider.h"
8
9 namespace javascript
10 {
11 class Doc;
12 class Span;
13 class IFXJS_PageProvider;
14 //class BasicEventInfo;
15 enum JS_ANNOTTYPE
16 {
17 ANNOT_UNKNOWN = -1,
18 ANNOT_CARET = 0,
19 ANNOT_CIRCLE,
20 ANNOT_FILEATTACHMENT,
21 ANNOT_FREETEXT,
22 ANNOT_HIGHLIGHT,
23 ANNOT_INK,
24 ANNOT_LINE,
25 ANNOT_POLYGON,
26 ANNOT_POLYLINE,
27 ANNOT_SOUND,
28 ANNOT_SQUARE,
29 ANNOT_SQUIGGLY,
30 ANNOT_STAMP,
31 ANNOT_STRIKEOUT,
32 ANNOT_TEXT,
33 ANNOT_UNDERLINE,
34 ANNOT_REDACT,
35 };
36
37 enum ANNOT_TYPE
38 {
39 ANNOT_ANNOTNAME = 0,
40 ANNOT_ARROWBEGIN,
41 ANNOT_ARROWEND,
42 ANNOT_ATTACHICON,
43 ANNOT_AUTHOR,
44 ANNOT_BORDEREFFECTINTENSITY,
45 ANNOT_BORDEREFFECTSTYLE,
46 ANNOT_CALLOUT,
47 ANNOT_CARETSYMBOL,
48 ANNOT_CONTENTS,
49 ANNOT_CREATIONDATE,
50 ANNOT_DASH,
51 ANNOT_FILLCOLOR,
52 ANNOT_GESTURES,
53 ANNOT_HIDE,
54 ANNOT_LEADEREXTEND,
55 ANNOT_LEADERLENGTH,
56 ANNOT_LINEENDING,
57 ANNOT_NOVIEW,
58 ANNOT_POINT,
59 ANNOT_POINTS,
60 ANNOT_POPUPOPEN,
61 ANNOT_POPUPRECT,
62 ANNOT_PRINT,
63 ANNOT_READONLY,
64 ANNOT_RECT,
65 ANNOT_SOUNDICON,
66 ANNOT_STROKECOLOR,
67 ANNOT_STYLE,
68 ANNOT_SUBJECT,
69 ANNOT_TEXTFONT,
70 ANNOT_TEXTSIZE,
71 ANNOT_WIDTH,
72 ANNOT_ALIGNMENT,
73 ANNOT_VERTICES,
74 ANNOT_QUADS,
75 ANNOT_NOTEICON,
76 ANNOT_OPACITY
77 };
78
79 struct FXJS_jsAnnotation_RichText_data
80 {
81 CFX_ByteString alignment;
82 CFX_WideStringArray fontFamily;
83 CFX_ByteString fontStretch;
84 CFX_ByteString fontStyle;
85 int fontWeight;
86 bool strikethrough;
87 bool subscript;
88 bool superscript;
89 CFX_WideString text;
90 CFX_ColorF color;
91 int textsize;
92 bool underline;
93
94 CFX_ByteString csfont;
95 FXJS_jsAnnotation_RichText_data()
96 {
97 alignment = "left";
98 fontStretch = "normal";
99 fontStyle = "normal";
100 fontWeight = 400;
101 strikethrough = false;
102 subscript = false;
103 superscript = false;
104 textsize = 12.0;
105 underline = false;
106 }
107 };
108
109 struct CFXJS_AnnotObj {
110 CFXJS_AnnotObj()
111 {
112 pAnnot = nullptr;
113 pAnnotAdd = nullptr;
114 }
115 int nAnnotType = 0;
116 ANNOT_TYPE nDoAnnotType = ANNOT_ANNOTNAME;
117 CFX_WideString cwType;
118 IFXJS_AnnotProvider* pAnnot;
119 int nPageNo = 0;
120 int nAlignment = 0;
121 CFX_WideString cwLineBegin;
122 CFX_WideString cwLineEnd;
123 CFX_WideString cwAttachIcon;
124 CFX_WideString cwAuthor;
125
126 CFX_WideString cwSymbol;
127 CFX_WideString cwContents;
128 CJS_IntArray dashArray;
129 CFX_ColorF fillcolor;
130 FX_BOOL bHide = false;
131 int iLeaderExtend = 0;
132 int iLeaderLength = 0;
133 CFX_WideString cwLineEnding;
134 CFX_WideString cwNoteIcon;
135 CFX_WideString cwAnnotName;
136 CPDF_Point pointArray = CPDF_Point(0, 0);
137 CJS_PointsArray pointsArray;
138 FX_BOOL bPopupOpen = false;
139 CPDF_Rect popupArray;
140 FX_BOOL bPrint = true;
141 FX_BOOL bReadOnly = false;
142 CPDF_Rect rectArray;
143 CFX_WideString cwSoundIcon;
144 CFX_ColorF strokecolor;
145 CFX_WideString cwStyle;
146 CFX_WideString cwSubject;
147 CFX_WideString cwTextFont;
148 int iTextSize = 0;
149 int iWidth = 0;
150 CJS_PointsArray verticesArray;
151 CJS_PointsArray gesturesArray;
152 CJS_PointsArray quadsArray;
153 CJS_PointsArray freecalloutArray;
154 float fOpacity = 0.0;
155 CFX_WideString cwBorderEffectStyle;
156 float fBorderEffectIntensity = 0.0;
157 int irotate = 0;
158
159 CFX_WideString cwNM;
160 CFX_WideString cwCreationDate;
161 CFX_WideString cwModDate;
162 CFX_WideString cwIntent;
163 FX_BOOL btoggleNoView = false;
164 FX_BOOL block = false;
165 FX_BOOL bnoView = false;
166 FX_BOOL bdoCaption = false;
167 std::vector<std::unique_ptr<FXJS_jsAnnotation_RichText_data> > m_arrDefValue;
168 //FAA
169 CFX_WideString cwAttachmentPath;
170 //Stamp
171 CFX_WideString cwStampAP;
172 FX_BOOL bTransparentColor = false;
173 IFXJS_AnnotProvider*pAnnotAdd;//用于设置annotation属性
174 };
175
177
187 class attachment : public CFXJS_EmbedObj
188 {
189 public:
190 attachment(CFXJS_Object* pJSObject);
191 virtual ~attachment();
192
193 void Initial(IFXJS_AnnotProvider* pAnnot) { m_pAnnot.Reset(pAnnot); }
194
195
206 FX_BOOL name(OBJ_PROP_PARAMS);
207
218 FX_BOOL creationDate(OBJ_PROP_PARAMS);
219
230 FX_BOOL modDate(OBJ_PROP_PARAMS);
231
242 FX_BOOL MIMEType(OBJ_PROP_PARAMS);
243
254 FX_BOOL path(OBJ_PROP_PARAMS);
255
281 FX_BOOL size(OBJ_PROP_PARAMS);
282
295 FX_BOOL contentStream(OBJ_PROP_PARAMS);
296 private:
297 IFXJS_AnnotProvider::Observer m_pAnnot;
298 };
299
300 class CFXJS_Attachment : public CFXJS_Object
301 {
302 public:
303 CFXJS_Attachment(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {}
304 virtual ~CFXJS_Attachment() {}
305
306 DECLARE_JS_CLASS(CFXJS_Attachment);
307
308 JS_STATIC_PROP(name, attachment);
309 JS_STATIC_PROP(creationDate, attachment);
310 JS_STATIC_PROP(modDate, attachment);
311 JS_STATIC_PROP(MIMEType, attachment);
312 JS_STATIC_PROP(path, attachment);
313 JS_STATIC_PROP(size, attachment);
314 JS_STATIC_PROP(contentStream, attachment);
315 };
317
335 class Annotation : public CFXJS_EmbedObj
336 {
337 public:
338 Annotation(CFXJS_Object* pJSObject);
339 virtual ~Annotation();
340 bool CheckBaseExpects() override { return (bool)m_pAnnot; }
341 static void GetPointsArray(FXJSE_HVALUE hPropValue, CFXJS_Runtime *pRuntime, CJS_PointsArray& pPointsArray);
342 static FX_BOOL ParserParams(JSFXObject pObj, CFXJS_AnnotObj& annotobj, CFXJS_Runtime *pRuntime, IFXJS_DocumentProvider *pDocument, CFX_RectArray &rcWordquads,FX_BOOL bIgnoreAttachmentPath=false);
343 public:
344
370 FX_BOOL alignment(OBJ_PROP_PARAMS);
371
409 FX_BOOL AP(OBJ_PROP_PARAMS);
410
438 FX_BOOL arrowBegin(OBJ_PROP_PARAMS);
439
467 FX_BOOL arrowEnd(OBJ_PROP_PARAMS);
468
490 FX_BOOL attachIcon(OBJ_PROP_PARAMS);
491
492 FX_BOOL attachment(OBJ_PROP_PARAMS);
515 FX_BOOL author(OBJ_PROP_PARAMS);
516
539 FX_BOOL borderEffectIntensity(OBJ_PROP_PARAMS);
540
563 FX_BOOL borderEffectStyle(OBJ_PROP_PARAMS);
564
586 FX_BOOL callout(OBJ_PROP_PARAMS);
587
610 FX_BOOL caretSymbol(OBJ_PROP_PARAMS);
611
637 FX_BOOL contents(OBJ_PROP_PARAMS);
659 FX_BOOL creationDate(OBJ_PROP_PARAMS);
660
682 FX_BOOL dash(OBJ_PROP_PARAMS);
683
704 FX_BOOL delay(OBJ_PROP_PARAMS);
705
729 FX_BOOL doc(OBJ_PROP_PARAMS);
730
753 FX_BOOL doCaption(OBJ_PROP_PARAMS);
754
784 FX_BOOL fillColor(OBJ_PROP_PARAMS);
785
808 FX_BOOL gestures(OBJ_PROP_PARAMS);
809
832 FX_BOOL hidden(OBJ_PROP_PARAMS);
833
856 FX_BOOL inReplyTo(OBJ_PROP_PARAMS);
857
887 FX_BOOL intent(OBJ_PROP_PARAMS);
888
913 FX_BOOL leaderExtend(OBJ_PROP_PARAMS);
914
939 FX_BOOL leaderLength(OBJ_PROP_PARAMS);
940
973 FX_BOOL lineEnding(OBJ_PROP_PARAMS);
974
996 FX_BOOL lock(OBJ_PROP_PARAMS);
997
1015 FX_BOOL modDate(OBJ_PROP_PARAMS);
1016
1037 FX_BOOL name(OBJ_PROP_PARAMS);
1038
1074 FX_BOOL noteIcon(OBJ_PROP_PARAMS);
1075
1100 FX_BOOL noView(OBJ_PROP_PARAMS);
1101
1122 FX_BOOL opacity(OBJ_PROP_PARAMS);
1123
1141 FX_BOOL page(OBJ_PROP_PARAMS);
1142
1169 FX_BOOL point(OBJ_PROP_PARAMS);
1170
1196 FX_BOOL points(OBJ_PROP_PARAMS);
1197
1218 FX_BOOL popupOpen(OBJ_PROP_PARAMS);
1219
1240 FX_BOOL popupRect(OBJ_PROP_PARAMS);
1241
1262 FX_BOOL print(OBJ_PROP_PARAMS);
1263
1284 FX_BOOL quads(OBJ_PROP_PARAMS);
1285
1306 FX_BOOL readOnly(OBJ_PROP_PARAMS);
1307
1328 FX_BOOL rect(OBJ_PROP_PARAMS);
1329
1350 FX_BOOL refType(OBJ_PROP_PARAMS);
1351 FX_BOOL richContents(OBJ_PROP_PARAMS);
1352 FX_BOOL richDefaults(OBJ_PROP_PARAMS);
1353 FX_BOOL rotate(OBJ_PROP_PARAMS);
1354 FX_BOOL seqNum(OBJ_PROP_PARAMS);
1355
1376 FX_BOOL soundIcon(OBJ_PROP_PARAMS);
1377 FX_BOOL state(OBJ_PROP_PARAMS);
1378 FX_BOOL stateModel(OBJ_PROP_PARAMS);
1379
1398 FX_BOOL strokeColor(OBJ_PROP_PARAMS);
1399
1420 FX_BOOL style(OBJ_PROP_PARAMS);
1421
1442 FX_BOOL subject(OBJ_PROP_PARAMS);
1443
1469 FX_BOOL textFont(OBJ_PROP_PARAMS);
1470
1487 FX_BOOL textSize(OBJ_PROP_PARAMS);
1488
1515 FX_BOOL toggleNoView(OBJ_PROP_PARAMS);
1516
1553 FX_BOOL type(OBJ_PROP_PARAMS);
1554 FX_BOOL subType(OBJ_PROP_PARAMS);
1555
1579 FX_BOOL vertices(OBJ_PROP_PARAMS);
1580
1602 FX_BOOL width(OBJ_PROP_PARAMS);
1603 FX_BOOL guid(OBJ_PROP_PARAMS);
1604 FX_BOOL pageIndex(OBJ_PROP_PARAMS);
1605
1616 FX_BOOL destroy(OBJ_METHOD_PARAMS);
1617 FX_BOOL exportToXFDF(OBJ_METHOD_PARAMS);
1618 FX_BOOL setProps(OBJ_METHOD_PARAMS);
1619 FX_BOOL getProps(OBJ_METHOD_PARAMS);
1620 public:
1621 void Initial(Doc* pDocument, IFXJS_AnnotProvider* pAnnot, CFXJS_AnnotObj& AnnotobjProp); void SetChangeNotity();
1622 JS_ANNOTTYPE GetAnnotType();
1623
1624 public:
1625 static void UpdateAnnot(IFXJS_AnnotProvider *pAnnot, FX_BOOL bResetApp, FX_BOOL bRefresh);
1626 static FX_BOOL CheckAllow(const CFX_WideString& string);
1627
1628
1629 static IFXJS_AnnotProvider* AddAnnot(IFXJS_DocumentProvider* pDocument, CFXJS_AnnotObj& annotobj);
1630 static void SetAlignment(IFXJS_AnnotProvider *pAnnot, int nAlignment);
1631 static void ArrowBegin(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwBegin);
1632 static void ArrowEnd(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwEnd);
1633 static void AttachIcon(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwAttachIcon);
1634 static void Author(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwAuthor);
1635 static void BorderEffectStyle(IFXJS_AnnotProvider* pAnnot, CFX_WideString cwBorderEffectStyle);
1636 static void BorderEffectIntensity(IFXJS_AnnotProvider *pAnnot, float fBorderEffectIntensity);
1637 static void CallOut(IFXJS_AnnotProvider *pAnnot, CJS_PointsArray* calloutArray);
1638 static void CaretSymbol(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwSymbol);
1639 static void Contents(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwContents);
1640 static void Dash(IFXJS_AnnotProvider *pAnnot, CJS_IntArray* dashArray);
1641 static void FillColor(IFXJS_AnnotProvider *pAnnot, CFX_ColorF fillcolor);
1642 static void Gestures(IFXJS_AnnotProvider *pAnnot, CJS_PointsArray* gesturesArray);
1643 static void Hidden(IFXJS_AnnotProvider *pAnnot, FX_BOOL bHide);
1644 static void NoView(IFXJS_AnnotProvider *pAnnot, FX_BOOL bNoView);
1645 static void LeaderExtend(IFXJS_AnnotProvider *pAnnot, int iLeaderExtend);
1646 static void LeaderLength(IFXJS_AnnotProvider *pAnnot, int iLeaderLength);
1647 static void LineEnding(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwLineEnding);
1648 static void Name(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwName);
1649 static void NoteIcon(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwNoteIcon);
1650 static void Opacity(IFXJS_AnnotProvider *pAnnot, float fOpacity);
1651 static void Point(IFXJS_AnnotProvider *pAnnot, CPDF_Point pointArray);
1652 static void Points(IFXJS_AnnotProvider *pAnnot, CJS_PointsArray* pointsArray);
1653 static void PopupOpen(IFXJS_AnnotProvider *pAnnot, FX_BOOL bOpen);
1654 static void PopupRect(IFXJS_AnnotProvider *pAnnot, CPDF_Rect popupArray);
1655 static void BPrint(IFXJS_AnnotProvider*pAnnot, FX_BOOL bPrint);
1656 static void BReadOnly(IFXJS_AnnotProvider *pAnnot, FX_BOOL bRead);
1657 static void Rect(IFXJS_AnnotProvider *pAnnot, CPDF_Rect rectArray);
1658 static void SoundIcon(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwSoundIcon);
1659 static void StrockColor(IFXJS_AnnotProvider *pAnnot, CFX_ColorF strokecolor);
1660 static void SetStyle(IFXJS_AnnotProvider* pAnnot, CFX_WideString cwStyle);
1661 static void Subject(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwSubject);
1662 static void TextFont(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwTextFont);
1663 static void TextSize(IFXJS_AnnotProvider *pAnnot, int iTextSize);
1664 static void SetWidth(IFXJS_AnnotProvider *pAnnot, int iWidth);
1665 static void Vertices(IFXJS_AnnotProvider *pAnnot, CJS_PointsArray* verticesArray);
1666 static void Quads(IFXJS_AnnotProvider *pAnnot, CJS_PointsArray* quadsArray);
1667
1668 static void SetDA(IFXJS_AnnotProvider *pAnnot, FX_COLORREF Colo);
1669 static void SetCreationDate(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwDate);
1670 static void SetRichcontents(IFXJS_AnnotProvider *pAnnot, CFXJS_AnnotObj& annotobj);
1671 static CFX_WideString GetStyle(FXJS_jsAnnotation_RichText_data* data, CFXJS_AnnotObj& annotobj);
1672 static CFX_ByteString GetRVXML(IFXJS_AnnotProvider *pAnnot, CFXJS_AnnotObj& annotobj);
1673 static void SetModDate(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwDate);
1674 static void setcalloutLine(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwLineEnding);
1675 static void setIntent(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwtintent);
1676 static void SetRotate(IFXJS_AnnotProvider *pAnnot, int rotate);
1677 static void NoLock(IFXJS_AnnotProvider *pAnnot, FX_BOOL bNoLock);
1678 static void NoToggleNoView(IFXJS_AnnotProvider *pAnnot, FX_BOOL bNoToggleNoView);
1679 static void SetCaption(IFXJS_AnnotProvider *pAnnot, FX_BOOL bCaption);
1680
1681 static FX_BOOL SetStartPoint(IFXJS_AnnotProvider *pAnnot, const CPDF_Point& point);
1682 static FX_BOOL SetEndPoint(IFXJS_AnnotProvider *pAnnot, const CPDF_Point& point);
1683
1684 static void DoDelay(CFXJS_AnnotObj *pData);
1685 void SetDelay(FX_BOOL bDelay);
1686
1687 static void SetDefaultRect(CPDF_Rect &defArray);
1688 static IFXJS_AnnotProvider* AddLine(IFXJS_PageProvider* pPage, CFXJS_AnnotObj& annotobj);
1689 static IFXJS_AnnotProvider* AddCircle(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1690 static IFXJS_AnnotProvider* AddSquare(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1691 static IFXJS_AnnotProvider* AddPolygon(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1692 static IFXJS_AnnotProvider* AddPolyline(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1693 static IFXJS_AnnotProvider* AddInk(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1694 static IFXJS_AnnotProvider* AddUnderline(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1695 static IFXJS_AnnotProvider* AddHighlight(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1696 static IFXJS_AnnotProvider* AddCaret(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1697 static IFXJS_AnnotProvider* AddSquiggly(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1698 static IFXJS_AnnotProvider* AddStrikeOut(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1699 static IFXJS_AnnotProvider* AddFileAttachment(IFXJS_AppProvider* pApp, IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1700 static IFXJS_AnnotProvider* AddText(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1701 static IFXJS_AnnotProvider* AddFreeText(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1702 static IFXJS_AnnotProvider* AddStamp(IFXJS_PageProvider *pPage, CFXJS_AnnotObj& annotobj);
1703
1704 static CFX_ByteString GetAnnotSubtype(IFXJS_AnnotProvider *pAnnot, CPDF_Dictionary *pAnnotDict);
1705 //faa
1706 static FX_BOOL AttachFile(IFXJS_AnnotProvider *pAnnot, CFX_WideString cwAttachPath);
1707 private:
1708 static CPDF_Array* GetColorsArray(CFX_ColorF pwlcolor);
1709 public:
1710 FX_BOOL ICommentsAnnotExportAnnotToXFDF();
1711 static FX_BOOL OnExportXFDFMessasge(IFXJS_AnnotProvider* pAnnot, CFX_Object* JsDoc);
1712
1713 private:
1714 FX_BOOL IsValidAnnot();
1715
1716 private:
1717 Doc * m_pDocument;
1718 IFXJS_AnnotProvider* m_pAnnot;
1719 IFXJS_AnnotProvider::Observer m_pAnnotObserver;
1720 CFXJS_AnnotObj m_AnnotobjProp;
1721 //std::unique_ptr<BasicEventInfo> m_hValueExportAnnotToXFDFFunc; //cpdf
1722 };
1723
1724 class CFXJS_Annotation : public CFXJS_Object
1725 {
1726 public:
1727 CFXJS_Annotation(CFXJS_Runtime* pRuntime) : CFXJS_Object(pRuntime) {};
1728 virtual ~CFXJS_Annotation() {};
1729
1730 public:
1731 DECLARE_JS_CLASS(CFXJS_Annotation);
1732
1733 JS_STATIC_PROP(alignment, Annotation);
1734 JS_STATIC_PROP(AP, Annotation);
1735 JS_STATIC_PROP(arrowBegin, Annotation);
1736 JS_STATIC_PROP(arrowEnd, Annotation);
1737 JS_STATIC_PROP(attachIcon, Annotation);
1738 JS_STATIC_PROP(attachment, Annotation);
1739 JS_STATIC_PROP(author, Annotation);
1740 JS_STATIC_PROP(borderEffectIntensity, Annotation);
1741 JS_STATIC_PROP(borderEffectStyle, Annotation);
1742 JS_STATIC_PROP(callout, Annotation);
1743 JS_STATIC_PROP(caretSymbol, Annotation);
1744 JS_STATIC_PROP(contents, Annotation);
1745 JS_STATIC_PROP(creationDate, Annotation);
1746 JS_STATIC_PROP(dash, Annotation);
1747 JS_STATIC_PROP(delay, Annotation);
1748 JS_STATIC_PROP(doc, Annotation);
1749 JS_STATIC_PROP(doCaption, Annotation);
1750 JS_STATIC_PROP(fillColor, Annotation);
1751 JS_STATIC_PROP(gestures, Annotation);
1752 JS_STATIC_PROP(hidden, Annotation);
1753 JS_STATIC_PROP(inReplyTo, Annotation);
1754 JS_STATIC_PROP(intent, Annotation);
1755 JS_STATIC_PROP(leaderExtend, Annotation);
1756 JS_STATIC_PROP(leaderLength, Annotation);
1757 JS_STATIC_PROP(lineEnding, Annotation);
1758 JS_STATIC_PROP(lock, Annotation);
1759 JS_STATIC_PROP(modDate, Annotation);
1760 JS_STATIC_PROP(name, Annotation);
1761 JS_STATIC_PROP(noteIcon, Annotation);
1762 JS_STATIC_PROP(noView, Annotation);
1763 JS_STATIC_PROP(opacity, Annotation);
1764 JS_STATIC_PROP(page, Annotation);
1765 JS_STATIC_PROP(point, Annotation);
1766 JS_STATIC_PROP(points, Annotation);
1767 JS_STATIC_PROP(popupOpen, Annotation);
1768 JS_STATIC_PROP(popupRect, Annotation);
1769 JS_STATIC_PROP(print, Annotation);
1770 JS_STATIC_PROP(quads, Annotation);
1771 JS_STATIC_PROP(readOnly, Annotation);
1772 JS_STATIC_PROP(rect, Annotation);
1773 JS_STATIC_PROP(refType, Annotation);
1774 JS_STATIC_PROP(richContents, Annotation);
1775 JS_STATIC_PROP(richDefaults, Annotation);
1776 JS_STATIC_PROP(rotate, Annotation);
1777 JS_STATIC_PROP(seqNum, Annotation);
1778 JS_STATIC_PROP(soundIcon, Annotation);
1779 JS_STATIC_PROP(state, Annotation);
1780 JS_STATIC_PROP(stateModel, Annotation);
1781 JS_STATIC_PROP(strokeColor, Annotation);
1782 JS_STATIC_PROP(style, Annotation);
1783 JS_STATIC_PROP(subject, Annotation);
1784 JS_STATIC_PROP(textFont, Annotation);
1785 JS_STATIC_PROP(textSize, Annotation);
1786 JS_STATIC_PROP(toggleNoView, Annotation);
1787 JS_STATIC_PROP(type, Annotation);
1788 JS_STATIC_PROP(subType, Annotation);
1789 JS_STATIC_PROP(vertices, Annotation);
1790 JS_STATIC_PROP(width, Annotation);
1791 JS_STATIC_PROP(guid, Annotation);
1792 JS_STATIC_PROP(pageIndex, Annotation);
1793
1794 JS_STATIC_METHOD(destroy, Annotation);
1795 JS_STATIC_METHOD(exportToXFDF, Annotation);
1796 JS_STATIC_METHOD(getProps, Annotation);
1797 JS_STATIC_METHOD(setProps, Annotation);
1798 };
1799 }
1800 #endif //_ANNOTATION_H_
Doc
This object provides the interface between a PDF Doc open in the viewer and the JavaScript interprete...
Definition: document.h:202
Annotation
This object represents an Phantom annotation. Annotations can be created using the Phantom annotation...
Definition: annotation.h:335
Span
A generic object that represents a length of text and its associated properties in a rich text form f...
Definition: span.h:19
attachment
The annotAttachment object represents the file stored as the attachment for a FileAttachment type ann...
Definition: annotation.h:187


Javascript API: Member List

Span Member List

This is the complete list of members for Span, including all inherited members.

alignment(OBJ_PROP_PARAMS) | Span
fontFamily(OBJ_PROP_PARAMS) | Span
fontStretch(OBJ_PROP_PARAMS) | Span
fontStyle(OBJ_PROP_PARAMS) | Span
fontWeight(OBJ_PROP_PARAMS) | Span
strikethrough(OBJ_PROP_PARAMS) | Span
subscript(OBJ_PROP_PARAMS) | Span
superscript(OBJ_PROP_PARAMS) | Span
text(OBJ_PROP_PARAMS) | Span
textColor(OBJ_PROP_PARAMS) | Span
textSize(OBJ_PROP_PARAMS) | Span
underline(OBJ_PROP_PARAMS) | Span