Foxit PDF SDK
foxit.pdf.actions.ActionCallback Class Reference

Inherits SystemIDisposable.

Public Types

enum  AppInfoType {
  AppInfoType.e_AppInfoTypeFormsVersion = 0x0, AppInfoType.e_AppInfoTypeViewerType = 0x01, AppInfoType.e_AppInfoTypeViewerVariation = 0x02, AppInfoType.e_AppInfoTypeViewerVersion = 0x03,
  AppInfoType.e_AppInfoTypeAppVersion = 0x04
}
 Enumeration for application's information type.
More...
 
enum  Language {
  Language.e_LanguageUnknown = 0, Language.e_LanguageCHS = 1, Language.e_LanguageCHT = 2, Language.e_LanguageDAN = 3,
  Language.e_LanguageDEU = 4, Language.e_LanguageENU = 5, Language.e_LanguageESP = 6, Language.e_LanguageFRA = 7,
  Language.e_LanguageITA = 8, Language.e_LanguageKOR = 9, Language.e_LanguageJPN = 10, Language.e_LanguageNLD = 11,
  Language.e_LanguageNOR = 12, Language.e_LanguagePTB = 13, Language.e_LanguageSUO = 14, Language.e_LanguageSVE = 15
}
 Enumeration for language.
More...
 
enum  MailType { MailType.e_MailTypeDoc = 0, MailType.e_MailTypeForm = 1, MailType.e_MailTypeMsg = 2 }
 Enumeration for data type to be mailed.
More...
 

Public Member Functions

virtual int Alert (string msg, string title, int type, int icon)
 A callback function used to pop up a dialog to show warnings or hints.
More...
 
virtual bool Beep (int type)
 A callback function to cause the system to play a sound.
More...
 
virtual string BrowseFile ()
 A callback function to show a file selection dialog, and the selected file path should be returned.
More...
 
virtual string BrowseFile (bool is_open_dialog, string file_format, string file_filter)
 A callback function to show a file selection dialog.
More...
 
virtual PDFDoc CreateBlankDoc ()
 A callback function to create a blank PDF document object.
More...
 
virtual bool ExecuteNamedAction (PDFDoc document, string named_action)
 A callback function to execute a named action.
More...
 
virtual string GetAppInfo (ActionCallback.AppInfoType type)
 A callback function to get application information.
More...
 
virtual PDFDoc GetCurrentDoc ()
 A callback function to receive current PDF document object.
More...
 
virtual int GetCurrentPage (PDFDoc document)
 A callback function used to receive current page index.
More...
 
virtual bool GetDocChangeMark (PDFDoc document)
 A callback function to receive the change mark which indicates whether the content of document is changed or not.
More...
 
virtual string GetFilePath (PDFDoc document)
 A callback function to get the file path of current PDF document.
More...
 
virtual IdentityProperties GetIdentityProperties ()
 A callback function used to get identity properties of current user.
More...
 
virtual ActionCallback.Language GetLanguage ()
 A callback function to get the language of the running viewer application.
More...
 
virtual PDFDoc GetOpenedDoc (int index)
 A callback function to receive an opened PDF document object by index.
More...
 
virtual int GetOpenedDocCount ()
 A callback function to receive the count of opened documents.
More...
 
virtual Rotation GetPageRotation (PDFDoc document, int page_index)
 A callback function used to receive current displaying rotation of a page on PDF viewer.
More...
 
virtual bool InvalidateRect (PDFDoc document, int page_index, RectF pdf_rect)
 A callback function to invalidate the client area within the specified rectangle.
More...
 
virtual bool LaunchURL (string url)
 A callback function to launch to a specified URL.
More...
 
virtual bool MailData (global::System.IntPtr data, ActionCallback.MailType data_type, bool is_ui, string to, string subject, string cc, string bcc, string message)
 A callback function to mail data or message, with or without user interaction.
More...
 
virtual bool OpenDoc (string file_path, string password)
 A callback function to open a PDF file.
More...
 
virtual string PopupMenu (MenuListArray menus)
 A callback function to pop up a menu window.
More...
 
virtual bool Print (PDFDoc document, bool is_ui, Range page_range, bool is_silent, bool is_shrunk_to_fit, bool is_printed_as_image, bool is_reversed, bool is_to_print_annots)
 A callback function to print pages within a specified index range.
More...
 
virtual void Release ()
 A callback function used to release current callback object itself.
More...
 
virtual string Response (string question, string title, string default_value, string label, bool 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...
 
virtual void SetCurrentPage (PDFDoc document, int page_index)
 A callback function used to set the current page by index.
More...
 
virtual bool SetDocChangeMark (PDFDoc document, bool change_mark)
 A callback function to set the change mark which indicates whether the content of document is changed or not.
More...
 
virtual bool SetPageRotation (PDFDoc document, int page_index, Rotation rotation)
 A callback function used to set the rotation value of a page on PDF viewer.
More...
 
virtual bool SubmitForm (PDFDoc document, global::System.IntPtr form_data, int length, string url)
 A callback function to submit the form data to a specified URL.
More...
 
virtual uint VerifySignature (PDFDoc document, Signature pdf_signature)
 A callback function to verify specified signature..
More...
 

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 Enumeration Documentation

◆ AppInfoType

Enumeration for application's information type.

Values of this enumeration should be used alone.

Enumerator
e_AppInfoTypeFormsVersion 

Application's forms version information.

e_AppInfoTypeViewerType 

Application's viewer type information.

e_AppInfoTypeViewerVariation 

Application's viewer variation information.

e_AppInfoTypeViewerVersion 

Application's viewer version information.

e_AppInfoTypeAppVersion 

Application's app version information.

◆ Language

Enumeration for language.

Values of this enumeration should be used alone.

Enumerator
e_LanguageUnknown 

Unknown language.

e_LanguageCHS 

Chinese Simplified.

e_LanguageCHT 

Chinese Traditional.

e_LanguageDAN 

Danish.

e_LanguageDEU 

German.

e_LanguageENU 

English.

e_LanguageESP 

Spanish.

e_LanguageFRA 

French.

e_LanguageITA 

Italian.

e_LanguageKOR 

Korean.

e_LanguageJPN 

Japanese.

e_LanguageNLD 

Dutch.

e_LanguageNOR 

Norwegian.

e_LanguagePTB 

Brazilian Portuguese.

e_LanguageSUO 

Finnish.

e_LanguageSVE 

Swedish.

◆ MailType

Enumeration for data type to be mailed.

Values of this enumeration should be used alone.

Enumerator
e_MailTypeDoc 

Mailed data type: document.

e_MailTypeForm 

Mailed data type: form.

e_MailTypeMsg 

Mailed data type: string message.

Member Function Documentation

◆ Alert()

int foxit.pdf.actions.ActionCallback.Alert ( string  msg,
string  title,
int  type,
int  icon 
)
inlinevirtual

A callback function used to pop up a dialog to show warnings or hints.

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

Parameters
[in]msgThe message string to be displayed in the dialog.
[in]titleThe title of the dialog.
[in]typeType of button group. It would be one of following values:
  • 0: OK;(default value.)
  • 1: OK, Cancel;
  • 2: Yes, NO;
  • 3: Yes, NO, Cancel.

[in]iconIcon type. It would be one of following values:
  • 0: Error;(default value.)
  • 1: Warning;
  • 2: Question;
  • 3: Status.

Returns
The return value should be one of following values:
  • 1: OK;
  • 2: Cancel;
  • 3: NO;
  • 4: Yes;

◆ Beep()

bool foxit.pdf.actions.ActionCallback.Beep ( int  type)
inlinevirtual

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.

◆ BrowseFile() [1/2]

string foxit.pdf.actions.ActionCallback.BrowseFile ( )
inlinevirtual

A callback function to show a file selection dialog, and the selected file path should be returned.

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

Returns
The file path. It can be an empty string.

◆ BrowseFile() [2/2]

string foxit.pdf.actions.ActionCallback.BrowseFile ( bool  is_open_dialog,
string  file_format,
string  file_filter 
)
inlinevirtual

A callback function to show a file selection dialog.

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

Parameters
[in]is_open_dialogA boolean value to specify whether the dialog is for opening file or saving file. true means the dialog should be used to open file, while false means the dialog should be used to save file.
[in]file_formatThe file format string.
[in]file_filterThe file filter string.
Returns
The file path. It can be an empty string.

◆ CreateBlankDoc()

PDFDoc foxit.pdf.actions.ActionCallback.CreateBlankDoc ( )
inlinevirtual

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()

bool foxit.pdf.actions.ActionCallback.ExecuteNamedAction ( PDFDoc  document,
string  named_action 
)
inlinevirtual

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.

◆ GetAppInfo()

string foxit.pdf.actions.ActionCallback.GetAppInfo ( ActionCallback.AppInfoType  type)
inlinevirtual

A callback function to get application information.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.
For the digital information like foxit.pdf.actions.ActionCallback.AppInfoType.e_AppInfoTypeViewerVersion , foxit.pdf.actions.ActionCallback.AppInfoType.e_AppInfoTypeAppVersion and foxit.pdf.actions.ActionCallback.AppInfoType.e_AppInfoTypeFormsVersion , please use string to represent it.

Parameters
[in]typeType of information. Please refer to values starting from foxit.pdf.actions.ActionCallback.AppInfoType.e_AppInfoTypeFormsVersion and this would be one of these values.
Returns
The application information.

◆ GetCurrentDoc()

PDFDoc foxit.pdf.actions.ActionCallback.GetCurrentDoc ( )
inlinevirtual

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()

int foxit.pdf.actions.ActionCallback.GetCurrentPage ( PDFDoc  document)
inlinevirtual

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()

bool foxit.pdf.actions.ActionCallback.GetDocChangeMark ( PDFDoc  document)
inlinevirtual

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.

◆ GetFilePath()

string foxit.pdf.actions.ActionCallback.GetFilePath ( PDFDoc  document)
inlinevirtual

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.

◆ GetIdentityProperties()

IdentityProperties foxit.pdf.actions.ActionCallback.GetIdentityProperties ( )
inlinevirtual

A callback function used to get identity properties of current user.

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

Returns
An identity properties object that specifies the identity properties of current user.

◆ GetLanguage()

ActionCallback.Language foxit.pdf.actions.ActionCallback.GetLanguage ( )
inlinevirtual

A callback function to get the language of the running viewer application.

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

Returns
The language type. Please refer to values starting from foxit.pdf.actions.ActionCallback.Language.e_LanguageUnknown and this should be one of these values.

◆ GetOpenedDoc()

PDFDoc foxit.pdf.actions.ActionCallback.GetOpenedDoc ( int  index)
inlinevirtual

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 ActionCallback.GetOpenedDocCount ;
Returns
A opened PDF document object.

◆ GetOpenedDocCount()

int foxit.pdf.actions.ActionCallback.GetOpenedDocCount ( )
inlinevirtual

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.

◆ GetPageRotation()

Rotation foxit.pdf.actions.ActionCallback.GetPageRotation ( PDFDoc  document,
int  page_index 
)
inlinevirtual

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 foxit.common.Rotation.e_Rotation0 and this should be one of these values.

◆ InvalidateRect()

bool foxit.pdf.actions.ActionCallback.InvalidateRect ( PDFDoc  document,
int  page_index,
RectF  pdf_rect 
)
inlinevirtual

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

All positions are measured in PDF "user space". Implementation should call function common.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.

◆ LaunchURL()

bool foxit.pdf.actions.ActionCallback.LaunchURL ( string  url)
inlinevirtual

A callback function to launch 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]urlA URL.
Returns
true means success, while false means failure.

◆ MailData()

bool foxit.pdf.actions.ActionCallback.MailData ( global::System.IntPtr  data,
ActionCallback.MailType  data_type,
bool  is_ui,
string  to,
string  subject,
string  cc,
string  bcc,
string  message 
)
inlinevirtual

A callback function to mail data or message, with or without user interaction.

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

Parameters
[in]dataA data which is to be mailed. The value and type of the data depends on parameter data_type:
[in]data_typeMail type. Please refer to values starting from foxit.pdf.actions.ActionCallback.MailType.e_MailTypeDoc and this would be one of these values.
[in]is_uitrue means that the remaining parameters are used to seed the compose-new-message window which is displayed to the user.
false means that the parameter to is required and all other parameters are optional.
[in]toA string that specifies a semicolon-delimited list of recipients for the message.
[in]subjectA string that specifies the subject of the message. The limit of this string's length is 64 KB.
[in]ccA string that specifies a semicolon-delimited list of CC recipients for the message.
[in]bccA string that specifies a semicolon-delimited list of BCC recipients for the message.
[in]messageA string that specifies the content of the message. The limit of this string's length is 64 KB.
Returns
true means success, while false means failure.

◆ OpenDoc()

bool foxit.pdf.actions.ActionCallback.OpenDoc ( string  file_path,
string  password 
)
inlinevirtual

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
true means success, while false means failure.

◆ PopupMenu()

string foxit.pdf.actions.ActionCallback.PopupMenu ( MenuListArray  menus)
inlinevirtual

A callback function to pop up a menu window.

The position of menu window is same as cursor's. This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]menusAn array of menu list objects.
Returns
The name of the menu item that was selected.

◆ Print()

bool foxit.pdf.actions.ActionCallback.Print ( PDFDoc  document,
bool  is_ui,
Range  page_range,
bool  is_silent,
bool  is_shrunk_to_fit,
bool  is_printed_as_image,
bool  is_reversed,
bool  is_to_print_annots 
)
inlinevirtual

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.

◆ Release()

void foxit.pdf.actions.ActionCallback.Release ( )
inlinevirtual

A callback function used to release current callback object itself.

Returns
None.

◆ Response()

string foxit.pdf.actions.ActionCallback.Response ( string  question,
string  title,
string  default_value,
string  label,
bool  is_password 
)
inlinevirtual

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()

void foxit.pdf.actions.ActionCallback.SetCurrentPage ( PDFDoc  document,
int  page_index 
)
inlinevirtual

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.

◆ SetDocChangeMark()

bool foxit.pdf.actions.ActionCallback.SetDocChangeMark ( PDFDoc  document,
bool  change_mark 
)
inlinevirtual

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()

bool foxit.pdf.actions.ActionCallback.SetPageRotation ( PDFDoc  document,
int  page_index,
Rotation  rotation 
)
inlinevirtual

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 foxit.common.Rotation.e_Rotation0 and this should be one of these values except foxit.common.Rotation.e_RotationUnknown .
Returns
true means success, while false means failure.

◆ SubmitForm()

bool foxit.pdf.actions.ActionCallback.SubmitForm ( PDFDoc  document,
global::System.IntPtr  form_data,
int  length,
string  url 
)
inlinevirtual

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 submit.
[in]lengthThe size (in bytes) of the buffer parameterform_data.
[in]urlA URL, to which the form data will be submit.
Returns
true means success, while false means failure.

◆ VerifySignature()

uint foxit.pdf.actions.ActionCallback.VerifySignature ( PDFDoc  document,
Signature  pdf_signature 
)
inlinevirtual

A callback function to verify specified signature..

This callback function will be triggered when a signature is to be verified by an action. If user does not want to verify the signature, just implement this function to do nothing and just return foxit.pdf.Signature.States.e_StateUnknown . User is recommended to use class foxit.pdf.LTVVerifier to verify if a signed signature is valid or not.

Parameters
[in]documentA PDF document object. It would be valid.
[in]pdf_signatureA PDF signature which is signed. This signature belongs to input parameter document.
Returns
The signature verified state. Please refer to values starting from foxit.pdf.Signature.States.e_StateUnknown and this would be one or combination of them.