(HOOPS Publish Advanced) Functions for setting JavaScript code on PDF entities. More...

Enumerations

enum  A3DPDFEEventActionType {
  kA3DPDFEventAutomatic = -1,
  kA3DPDFEventPageOpened = 0,
  kA3DPDFEventPageClosed = 1,
  kA3DPDFEventPageVisible = 2,
  kA3DPDFEventPageInvisible = 3,
  kA3DPDFEventFieldEnter = 4,
  kA3DPDFEventFieldExit = 5,
  kA3DPDFEventFieldMouseDown = 6,
  kA3DPDFEventFieldMouseUp = 7,
  kA3DPDFEventFieldFocusIn = 8,
  kA3DPDFEventFieldFocusOut = 9,
  kA3DPDFEventDocWillClose = 10,
  kA3DPDFEventDocWillSave = 11,
  kA3DPDFEventDocDidSave = 12,
  kA3DPDFEventDocWillPrint = 13,
  kA3DPDFEventDocDidPrint = 14,
  kA3DPDFEventFieldKeyStroke = 15
}
 Set of events that can trigger the execution of an action. More...
 

Functions

A3DStatus A3DPDF3DAnnotSetActionJavascript (A3DPDFPage *pPage, A3DPDF3DAnnot *p3DAnnot, const A3DPDFEEventActionType eEventActionType, const A3DUTF8Char *pcJavascriptString)
 Function to define a javaScript action to an event triggered on an annotation. The JavaScript is defined as a string. More...
 
A3DStatus A3DPDFDocumentAddJavascriptFromString (A3DPDFDocument *pDoc, const A3DUTF8Char *pcScriptName, const A3DUTF8Char *pcJavascriptString)
 Adds JavaScript to a document. This JavaScript is launched when the file is opened. More...
 
A3DStatus A3DPDFDocumentSetActionJavascript (A3DPDFDocument *pDoc, const A3DPDFEEventActionType eEventActionType, const A3DUTF8Char *pcJavascriptString)
 Function to define a javaScript action to an event triggered on the document. The JavaScript is defined as a string. More...
 
A3DStatus A3DPDFPageFieldSetActionJavascript (A3DPDFPage *pPage, const A3DUTF8Char *pcFieldName, const A3DPDFEEventActionType eEventActionType, const A3DUTF8Char *pcJavascriptString)
 Function to attach JavaScript to a form field. The JavaScript is defined as a string. More...
 
A3DStatus A3DPDFPageFieldSetActionJavascriptFromString (A3DPDFPage *pPage, const A3DUTF8Char *pcFieldName, const A3DUTF8Char *pcJavascriptString)
 Function to attach JavaScript to a form field. The JavaScript is defined as a string. More...
 
A3DStatus A3DPDFPageSetActionJavascript (A3DPDFPage *pPage, const A3DPDFEEventActionType eEventActionType, const A3DUTF8Char *pcJavascriptString)
 Function to define a javaScript action to an event triggered on the page. The JavaScript is defined as a string. More...
 

Detailed Description

(HOOPS Publish Advanced) Functions for setting JavaScript code on PDF entities.

This module describes the functions and structures that allow you to define JavaScript code on PDF entities, such as Document, Page, 3D annot, or Fields.

Enumeration Type Documentation

◆ A3DPDFEEventActionType

Set of events that can trigger the execution of an action.

The kA3DPDFEventPageOpened and kA3DPDFEventPageClosed event on an annotation object have a similar function in the page object. However, associating these triggers with annotations allows annotation objects to be self-contained. The kA3DPDFEventPageVisible and kA3DPDFEventPageInvisible types allow a distinction between pages that are open and pages that are visible. At any one time, while more than one page may be visible, depending on the page layout.

Version
9.0
Enumerator
kA3DPDFEventAutomatic 

The action is performed when an event (automatically determined depending on the function called) is triggered. See documentation for function using this.

kA3DPDFEventPageOpened 

An action that shall be performed when the page, or the page containing the annotation, is opened.

kA3DPDFEventPageClosed 

An action that shall be performed when the page, or the page containing the annotation, is closed.

kA3DPDFEventPageVisible 

An action that shall be performed when the page containing the annotation becomes visible.

kA3DPDFEventPageInvisible 

An action that shall be performed when the page containing the annotation is no longer visible in the conforming reader’s user interface.

kA3DPDFEventFieldEnter 

An action that shall be performed when the cursor enters the annotation’s active area.

kA3DPDFEventFieldExit 

An action that shall be performed when the cursor exits the annotation’s active area.

kA3DPDFEventFieldMouseDown 

An action that shall be performed when the mouse button is pressed inside the annotation’s active area.

kA3DPDFEventFieldMouseUp 

An action that shall be performed when the mouse button is released inside the annotation’s active area.

kA3DPDFEventFieldFocusIn 

An action that shall be performed when the annotation receives the input focus.

kA3DPDFEventFieldFocusOut 

An action that shall be performed when the annotation loses the input focus.

kA3DPDFEventDocWillClose 

An action that shall be performed before closing a document.

kA3DPDFEventDocWillSave 

An action that shall be performed before saving a document.

kA3DPDFEventDocDidSave 

An action that shall be performed after saving a document.

kA3DPDFEventDocWillPrint 

An action that shall be performed before printing a document.

kA3DPDFEventDocDidPrint 

An action that shall be performed after printing a document.

kA3DPDFEventFieldKeyStroke 

An action that shall be performed when the user modifies a character in a text field or combo box or modifies the selection in a scrollable list box.

Function Documentation

◆ A3DPDFDocumentAddJavascriptFromString()

A3DStatus A3DPDFDocumentAddJavascriptFromString ( A3DPDFDocument pDoc,
const A3DUTF8Char pcScriptName,
const A3DUTF8Char pcJavascriptString 
)

Adds JavaScript to a document. This JavaScript is launched when the file is opened.

Parameters
[in,out]pDocThe Document object to work with.
[in]pcScriptNameThe name of the script. It is not used by Acrobat but needs to be unique.
[in]pcJavascriptStringThe string which contains the JavaScript.
Returns
A3D_SUCCESS
Version
4.3

◆ A3DPDFPageFieldSetActionJavascriptFromString()

A3DStatus A3DPDFPageFieldSetActionJavascriptFromString ( A3DPDFPage pPage,
const A3DUTF8Char pcFieldName,
const A3DUTF8Char pcJavascriptString 
)

Function to attach JavaScript to a form field. The JavaScript is defined as a string.

The goal of this function is to define a JavaScript action to be launched on an event. The action event is different depending on the type of the field. For fields of type:

  • dropdown list: the action is the selection of a list item.
  • listbox list: the action is the selection of a list item.
  • button: the action is the button pushed.
Parameters
[in,out]pPageThe Page object to work with.
[in]pcFieldNameThe name of the form field. Only Acroform fields are supported.
[in]pcJavascriptStringThe string which contains the JavaScript.
Returns
A3D_SUCCESS
Version
4.1

◆ A3DPDFPageFieldSetActionJavascript()

A3DStatus A3DPDFPageFieldSetActionJavascript ( A3DPDFPage pPage,
const A3DUTF8Char pcFieldName,
const A3DPDFEEventActionType  eEventActionType,
const A3DUTF8Char pcJavascriptString 
)

Function to attach JavaScript to a form field. The JavaScript is defined as a string.

The goal of this function is to define a JavaScript action to be launched on an event. The action event is different depending on the type of the field. For fields of type:

  • dropdown list: the action is the selection of a list item.
  • listbox list: the action is the selection of a list item.
  • button: the action is the button pushed.
Parameters
[in,out]pPageThe Page object to work with.
[in]pcFieldNameThe name of the form field. Only Acroform fields are supported.
[in]eEventActionTypeThe action type. Only kA3DPDFEventPageOpened and kA3DPDFEventPageClosed are relevant at page level.
[in]pcJavascriptStringThe string which contains the JavaScript.
Returns
A3D_SUCCESS
Version
9.0

◆ A3DPDFDocumentSetActionJavascript()

A3DStatus A3DPDFDocumentSetActionJavascript ( A3DPDFDocument pDoc,
const A3DPDFEEventActionType  eEventActionType,
const A3DUTF8Char pcJavascriptString 
)

Function to define a javaScript action to an event triggered on the document. The JavaScript is defined as a string.

The goal of this function is to define a JavaScript action to be launched on an event triggered on the document level.

Parameters
[in]pDocThe Document object to work with.
[in]eEventActionTypeThe action type. Only kA3DPDFEventDocWillClose, kA3DPDFEventDocWillSave kA3DPDFEventDocDidSave kA3DPDFEventDocWillPrint and kA3DPDFEventDocDidPrint are relevant at document level.
[in]pcJavascriptStringThe string which contains the JavaScript.
Returns
A3D_SUCCESS
Version
9.0

◆ A3DPDFPageSetActionJavascript()

A3DStatus A3DPDFPageSetActionJavascript ( A3DPDFPage pPage,
const A3DPDFEEventActionType  eEventActionType,
const A3DUTF8Char pcJavascriptString 
)

Function to define a javaScript action to an event triggered on the page. The JavaScript is defined as a string.

The goal of this function is to define a JavaScript action to be launched on an event triggered on the page level.

Parameters
[in]pPageThe Page object to work with.
[in]eEventActionTypeThe action type. Only kA3DPDFEventPageOpened and kA3DPDFEventPageClosed are relevant at page level.
[in]pcJavascriptStringThe string which contains the JavaScript.
Returns
A3D_SUCCESS
Version
9.0

◆ A3DPDF3DAnnotSetActionJavascript()

A3DStatus A3DPDF3DAnnotSetActionJavascript ( A3DPDFPage pPage,
A3DPDF3DAnnot p3DAnnot,
const A3DPDFEEventActionType  eEventActionType,
const A3DUTF8Char pcJavascriptString 
)

Function to define a javaScript action to an event triggered on an annotation. The JavaScript is defined as a string.

The goal of this function is to define a JavaScript action to be launched on an event triggered on an annotation.

Parameters
[in]pPageThe Page object to work with.
[in]p3DAnnotThe 3D annot object to work with.
[in]eEventActionTypeThe action type.
[in]pcJavascriptStringThe string which contains the JavaScript.
Returns
A3D_SUCCESS
Version
9.0