HOME | Doc Class
The Doc object provides the interface between a PDF document open in the viewer and the JavaScript interpreter. It provides methods and properties for accessing the PDF document.
Methods
getField
-
cName
Maps a Field object in the PDF document to a JavaScript variable.
Parameters:
-
cName
StringThe name of the field of interest.
Returns:
A Field object representing a form field in the PDF document.
resetForm
-
[fieldNames=null]
Resets the field values within a document. Resetting a field causes it to take on its default value (which, in the case of text fields, is usually blank).
Parameters:
-
[fieldNames=null]
Object optionalAn array specifying the fields to reset. If not present or null, all fields in the form are reset.
submitForm
-
cURL
-
[cSubmitAs='FDF']
-
[cCharset='utf-8']
Submits the form to a specified URL. Currently only supports FormsCentral submissions.
submitForm JS API currently only supports FormsCentral submissions. And FormsCentral has now been decommissioned. Leave the submitForm code intact so that if it is executed, the return response can be processed by the application. Leave the submitForm code intact so that it can serve as a guide for any future non-FormsCentral submit functionality. But mark the API as private so that any autogenerated documentation does NOT include this API.
Parameters:
-
cURL
StringThe URL to submit to. cURL must be a FormsCentral target.
-
[cSubmitAs='FDF']
String optionalThis parameter indicates the format for submission. Must be 'HTML' to support FormsCentral submission.
-
[cCharset='utf-8']
String optionalThe encoding for the values submitted. Must be 'utf-8' to support FormsCentral submission.
Properties
numFields
Number
The total number of fields in the document.
pageNum
Number
Gets or sets the current page of the document. When setting pageNum to a specific page, remember that the values are 0-based.