Foxit PDF SDK
FSDK.ActionCallback Class Reference

Public Member Functions

 Beep (type)
 A callback function to cause the system to play a sound. More...
 
 CloseDoc (document, is_prompt_to_save)
 A callback function to close document. More...
 
 CreateBlankDoc ()
 A callback function to create a blank PDF document object. More...
 
 ExecuteNamedAction (document, named_action)
 A callback function to execute a named action. More...
 
 GetAttachmentsFilePath (pdf_doc, name)
 A callback function to get the file path of attachments file. More...
 
 GetCurrentDoc ()
 A callback function to receive current PDF document object. More...
 
 GetCurrentPage (document)
 A callback function used to receive current page index. More...
 
 GetDocChangeMark (document)
 A callback function to receive the change mark which indicates whether the content of document is changed or not. More...
 
 GetExtractedEmbeddedFilePath (pdf_doc, name)
 A callback function to get the file path of extracted embedded file. More...
 
 GetFilePath (document)
 A callback function to get the file path of current PDF document. More...
 
 GetOpenedDocCount ()
 A callback function to receive the count of opened documents. More...
 
 GetPageRotation (document, page_index)
 A callback function used to receive current displaying rotation of a page on PDF viewer. More...
 
 InvalidateRect (document, page_index, pdf_rect)
 A callback function to invalidate the client area within the specified rectangle. More...
 
 IsLocalFile (document)
 A callback function to check whether the file is local file. More...
 
 OpenDoc (file_path, password)
 A callback function to open a PDF file. More...
 
 Print (document, is_ui, page_range, is_silent, is_shrunk_to_fit, is_printed_as_image, is_reversed, is_to_print_annots)
 A callback function to print pages within a specified index range. More...
 
 Print (document, print_params) SubmitForm(document
 A callback function to print document with print parameters. More...
 
 Release ()
 A callback function used to release current callback object itself. More...
 
 Response (question, title, default_value, label, is_password)
 A callback function to display a dialog box containing a question and an entry field for the user to reply to the question. More...
 
 SetCurrentPage (document, page_index)
 A callback function used to set the current page by index. More...
 
 SetCurrentPage (document, destination)
 A callback function used to set the current page by destination. More...
 
 SetDocChangeMark (document, change_mark)
 A callback function to set the change mark which indicates whether the content of document is changed or not. More...
 
 SetPageRotation (document, page_index, rotation)
 A callback function used to set the rotation value of a page on PDF viewer. More...
 

Static Public Attributes

static e_AppInfoTypeAppVersion
 Application's app version information.
 
static e_AppInfoTypeFormsVersion
 Enumeration for application's information type. More...
 
static e_AppInfoTypeViewerType
 Application's viewer type information.
 
static e_AppInfoTypeViewerVariation
 Application's viewer variation information.
 
static e_AppInfoTypeViewerVersion
 Application's viewer version information.
 
static e_JSFieldValueChangedByCalculation
 javascript field value changed type : calculation.
 
static e_JSFieldValueChangedByFormat
 Enumeration for javascript field value change type. More...
 
static e_JSFieldValueChangedBySet
 javascript field value changed type: field set.
 
static e_JSMailResultFailed
 Enumeration for result of the mail. More...
 
static e_JSMailResultSuccess
 Mailed result: mail success.
 
static e_JSMailResultUserAbort
 Mailed result: user abort.
 
static e_JSMediaPlayerStateClose
 media player state: Close.
 
static e_JSMediaPlayerStateOpen
 Enumeration for media player state. More...
 
static e_JSMediaPlayerStatePlaying
 media player state: Playing.
 
static e_JSMediaPlayerStateStop
 media player state: Stop.
 
static e_JSMediaPlayerStateSuspend
 media player state: Suspend.
 
static e_LanguageCHS
 Chinese Simplified.
 
static e_LanguageCHT
 Chinese Traditional.
 
static e_LanguageDAN
 Danish.
 
static e_LanguageDEU
 German.
 
static e_LanguageENU
 English.
 
static e_LanguageESP
 Spanish.
 
static e_LanguageFRA
 French.
 
static e_LanguageITA
 Italian.
 
static e_LanguageJPN
 Japanese.
 
static e_LanguageKOR
 Korean.
 
static e_LanguageNLD
 Dutch.
 
static e_LanguageNOR
 Norwegian.
 
static e_LanguagePTB
 Brazilian Portuguese.
 
static e_LanguageSUO
 Finnish.
 
static e_LanguageSVE
 Swedish.
 
static e_LanguageUnknown
 Enumeration for language. More...
 
static e_LayoutModeContinuous
 Layout mode: continuous page.
 
static e_LayoutModeContinuousFacing
 Layout mode: continuous two pages.
 
static e_LayoutModeFacing
 Layout mode: two pages.
 
static e_LayoutModeSinglePage
 Enumeration for layout mode. More...
 
static e_MailTypeDoc
 Enumeration for data type to be mailed. More...
 
static e_MailTypeForm
 Mailed data type: form.
 
static e_MailTypeMsg
 Mailed data type: string message.
 
static e_SearchScopeActiveDoc
 Enumeration for search scope. More...
 
static e_SearchScopeActiveIndexes
 Search scope: active indexes.
 
static e_SearchScopeFolder
 Search scope: folder.
 
static e_SearchScopeIndex
 Search scope: index.
 

Detailed Description

This class represents a callback object for performing PDF actions. All the pure virtual functions in this class are used as callback functions and should be implemented by user, to perform PDF actions, such as javascript actions.

Member Function Documentation

◆ Beep()

FSDK.ActionCallback.Beep (   type)
inline

A callback function to cause the system to play a sound.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]typeSound type. The value would be on of following values:
  • 0: Error
  • 1: Warning
  • 2: Question
  • 3: Status
  • 4: Default (default value)
Returns
true means success, while false means failure.

◆ CloseDoc()

FSDK.ActionCallback.CloseDoc (   document,
  is_prompt_to_save 
)
inline

A callback function to close document.

This callback function will be triggered by the javascript method "Doc.closeDoc". This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]is_prompt_to_savetrue means show save prompt, while false means not.
Returns
None.

◆ CreateBlankDoc()

FSDK.ActionCallback.CreateBlankDoc ( )
inline

A callback function to create a blank PDF document object.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The newly created blank PDF document object.

◆ ExecuteNamedAction()

FSDK.ActionCallback.ExecuteNamedAction (   document,
  named_action 
)
inline

A callback function to execute a named action.

Please refer to description of "Named Actions" in Section 8.5.3 of <PDF Reference 1.7> for more details. This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]named_actionA string to specify a named action.
Returns
true means success, while false means failure.

◆ GetAttachmentsFilePath()

FSDK.ActionCallback.GetAttachmentsFilePath (   pdf_doc,
  name 
)
inline

A callback function to get the file path of attachments file.

This callback function will be triggered by the javascript method "Doc.importDataObject". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]pdf_docA PDF document object. It will embed with a data object.
[in]nameThe name to associate with the data object. It's the parameter "cName" of the method "Doc.importDataObject".
Returns
The path of the file which will be embedded as a data object.

◆ GetCurrentDoc()

FSDK.ActionCallback.GetCurrentDoc ( )
inline

A callback function to receive current PDF document object.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
Current PDF document object.

◆ GetCurrentPage()

FSDK.ActionCallback.GetCurrentPage (   document)
inline

A callback function used to receive current page index.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
Current page index. The value should be stared from 0 and less than page count of the specified document.

◆ GetDocChangeMark()

FSDK.ActionCallback.GetDocChangeMark (   document)
inline

A callback function to receive the change mark which indicates whether the content of document is changed or not.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
true means the PDF document is changed, while false means not.

◆ GetExtractedEmbeddedFilePath()

FSDK.ActionCallback.GetExtractedEmbeddedFilePath (   pdf_doc,
  name 
)
inline

A callback function to get the file path of extracted embedded file.

This callback function will be triggered by the javascript method "Doc.exportDataObject". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]pdf_docA PDF document object. It will be embedded as a data object to the file .
[in]nameThe name of the data object to extract. It's the parameter "cName" of the method "Doc.exportDataObject".
Returns
The path of the file which will embed with a data object.

◆ GetFilePath()

FSDK.ActionCallback.GetFilePath (   document)
inline

A callback function to get the file path of current PDF document.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
The file path.

◆ GetOpenedDocCount()

FSDK.ActionCallback.GetOpenedDocCount ( )
inline

A callback function to receive the count of opened documents.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The count of opened documents.A callback function to receive an opened PDF document object by index.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]indexThe index of an opened PDF documents. Valid range: from 0 to count-1. count is returned by callback function FSDK.ActionCallback.GetOpenedDocCount;
Returns
A opened PDF document object.

◆ GetPageRotation()

FSDK.ActionCallback.GetPageRotation (   document,
  page_index 
)
inline

A callback function used to receive current displaying rotation of a page on PDF viewer.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index, used to specify which page's rotation is to be retrieved. The index would start from 0 and less than page count of the specified document.
Returns
The rotation of specified page. Please refer to values starting from FSDK.e_Rotation0 and this should be one of these values.

◆ InvalidateRect()

FSDK.ActionCallback.InvalidateRect (   document,
  page_index,
  pdf_rect 
)
inline

A callback function to invalidate the client area within the specified rectangle.

All positions are measured in PDF "user space". Implementation should call function FSDK.Renderer.StartRender for repainting a specified page area.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index. It would start from 0 and less than page count of the specified document.
[in]pdf_rectA rectangle that specifies the page area in PDF coordinate system. If this is an empty rectangle, that means to refresh the whole page.
Returns
true means success, while false means failure.

◆ IsLocalFile()

FSDK.ActionCallback.IsLocalFile (   document)
inline

A callback function to check whether the file is local file.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
true means the PDF file is loacl file.

◆ OpenDoc()

FSDK.ActionCallback.OpenDoc (   file_path,
  password 
)
inline

A callback function to open a PDF file.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]file_pathA full path of an existing PDF file.
[in]passwordPassword for input PDF file. This may be an empty string.
Returns
An opened PDF document object.

◆ Print() [1/2]

FSDK.ActionCallback.Print (   document,
  is_ui,
  page_range,
  is_silent,
  is_shrunk_to_fit,
  is_printed_as_image,
  is_reversed,
  is_to_print_annots 
)
inline

A callback function to print pages within a specified index range.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]is_uitrue means that a UI should be presented to the user to obtain printing information and confirm the action.
[in]page_rangeA range object to specify the page range for printing. All the indexes represented in this range would start from 0 and less than page count of the specified document.
[in]is_silenttrue means that the cancel dialog box should be suppressed while the document is printing.
[in]is_shrunk_to_fittrue means that the page should be shrunk (if necessary) to fit within the area of the printed page.
[in]is_printed_as_imagetrue means that pages should be printed as image.
[in]is_reversedtrue means that the printing order should be from parameter end to parameter start.
[in]is_to_print_annotstrue means that annotations should be printed with page.
Returns
true means success, while false means failure.

◆ Print() [2/2]

FSDK.ActionCallback.Print (   document,
  print_params 
)

A callback function to print document with print parameters.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]print_paramsA FSDK.PrintParams object.
Returns
true means success, while false means failure.A callback function to submit the form data to a specified URL.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]form_dataA form data buffer which is to be submitted.
[in]lengthThe size (in bytes) of the buffer parameterform_data.
[in]urlA URL, to which the form data will be submitted.
[in]file_format_typeFile format type for submission form. Please refer to values starting from FSDK.e_FileFormatTypeFDF and this would be one of these values.
Returns
true means success, while false means failure.

◆ Release()

FSDK.ActionCallback.Release ( )
inline

A callback function used to release current callback object itself.

Returns
None.

◆ Response()

FSDK.ActionCallback.Response (   question,
  title,
  default_value,
  label,
  is_password 
)
inline

A callback function to display a dialog box containing a question and an entry field for the user to reply to the question.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]questionA string that specifies the question to be posed to the user.
[in]titleA string that specifies the title of the dialog box.
[in]default_valueA string that specifies a default value as the answer to the question. If the answer is not specified, no default value is presented.
[in]labelA string that specifies a short string to appear in front of the edit text field.
[in]is_passwordA boolean value that indicates whether user's response should be masked to show:
true means that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information.
Returns
User's response. It can be an empty string.

◆ SetCurrentPage() [1/2]

FSDK.ActionCallback.SetCurrentPage (   document,
  page_index 
)
inline

A callback function used to set the current page by index.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index which is used to change current page. The index would start from 0 and less than page count of the specified document.
Returns
None.

◆ SetCurrentPage() [2/2]

FSDK.ActionCallback.SetCurrentPage (   document,
  destination 
)
inline

A callback function used to set the current page by destination.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]destinationA FSDK.object. None.

◆ SetDocChangeMark()

FSDK.ActionCallback.SetDocChangeMark (   document,
  change_mark 
)
inline

A callback function to set the change mark which indicates whether the content of document is changed or not.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]change_markA boolean value that indicates whether the content of document is changed or not.
Returns
true means success, while false means failure.

◆ SetPageRotation()

FSDK.ActionCallback.SetPageRotation (   document,
  page_index,
  rotation 
)
inline

A callback function used to set the rotation value of a page on PDF viewer.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index, used to specify which page's rotation is to be changed. The index would start from 0 and less than page count of the specified document.
[in]rotationNew rotation value. Please refer to values starting from FSDK.e_Rotation0 and this should be one of these values except FSDK.e_RotationUnknown.
Returns
true means success, while false means failure.

Member Data Documentation

◆ e_AppInfoTypeFormsVersion

FSDK.ActionCallback.e_AppInfoTypeFormsVersion
static

Enumeration for application's information type.

Values of this enumeration should be used alone.Application's forms version information.

◆ e_JSFieldValueChangedByFormat

FSDK.ActionCallback.e_JSFieldValueChangedByFormat
static

Enumeration for javascript field value change type.

Values of this enumeration should be used alone.javascript field value changed type: format.

◆ e_JSMailResultFailed

FSDK.ActionCallback.e_JSMailResultFailed
static

Enumeration for result of the mail.

Values of this enumeration should be used alone.Mailed result: mail failed.

◆ e_JSMediaPlayerStateOpen

FSDK.ActionCallback.e_JSMediaPlayerStateOpen
static

Enumeration for media player state.

Values of this enumeration should be used alone.media player state: Open.

◆ e_LanguageUnknown

FSDK.ActionCallback.e_LanguageUnknown
static

Enumeration for language.

Values of this enumeration should be used alone.Unknown language.

◆ e_LayoutModeSinglePage

FSDK.ActionCallback.e_LayoutModeSinglePage
static

Enumeration for layout mode.

Values of this enumeration should be used alone.Layout mode: single page.

◆ e_MailTypeDoc

FSDK.ActionCallback.e_MailTypeDoc
static

Enumeration for data type to be mailed.

Values of this enumeration should be used alone.Mailed data type: document.

◆ e_SearchScopeActiveDoc

FSDK.ActionCallback.e_SearchScopeActiveDoc
static

Enumeration for search scope.

Values of this enumeration should be used alone.Search scope: active document.