Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
FoxitPDFSDKPython2.DocProviderCallback Class Reference

Inherits FoxitPDFSDKPython2._object.

## Public Member Functions
def | DisplayCaret (page_index, is_visible, rect)
| A callback function used to display or hide caret. More...
def | ExportData (doc, file_path)
| A callback function used to export data to file. More...
def | GetCurrentPage (doc)
| A callback function used to get index of current page. More...
def | GetHighlightColor (doc)
| A callback function get the highlight color. More...
def | GetPopupPos (page_index, min_popup, max_popup, rect_widget, inout_rect_popup)
| A callback function used to get the pop-up position. More...
def | GetTitle (doc)
| A callback function used to get title of current XFA document. More...
def | GotoURL (doc, url)
| A callback function used to go to a specified URL. More...
def | ImportData (doc, file_path)
| A callback function used to import data from file. More...
def | InvalidateRect (page_index, rect, flag)
| A callback function used to invalidate rectangle according the flag. More...
def | NotifyWidgetChangeInfo (doc, change_info)
| A callback function to notify XFA widget change information. More...
def | PageViewEvent (page_index, page_view_event_type)
| A callback function to execute page view event. More...
def | PopupMenu (page_index, rect_popup)
| A callback function used to pop up the context menu. More...
def | Print (doc, start_page_index, end_page_index, options)
| A callback function used to print. More...
def | Release ()
| A callback function used to release current callback object itself. More...
def | SetChangeMark (doc)
| A callback function used to set change mark flag to current XFA document. More...
def | SetCurrentPage (doc, current_page_index)
| A callback function used to set index of current page. More...
def | SetFocus (xfa_widget, is_relayout)
| A callback function used to set focus widget. More...
def | SubmitData (doc, target, format, text_encoding, content)
| A callback function to submit data. More...
def | WidgetEvent (xfa_widget, widget_event_type)
| A callback function to execute XFA widget event. More...

## Static Public Attributes
| e_InvalidateFlagAllPages = _fsdk.DocProviderCallback_e_InvalidateFlagAllPages
| Invalidate all pages.
| e_InvalidateFlagCurrentPage = _fsdk.DocProviderCallback_e_InvalidateFlagCurrentPage
| Invalidate current page.
| e_PageViewEventTypeAdded = _fsdk.DocProviderCallback_e_PageViewEventTypeAdded
| Event type: after a page view is added.
| e_PageViewEventTypeAllRemoved = _fsdk.DocProviderCallback_e_PageViewEventTypeAllRemoved
| Event type: all page views are removed.
| e_PageViewEventTypeRemoved = _fsdk.DocProviderCallback_e_PageViewEventTypeRemoved
| Event type: after a page view is removed.
| e_PrintOptionAsImage = _fsdk.DocProviderCallback_e_PrintOptionAsImage
| If set, print page as image; otherwise, as text.
| e_PrintOptionCanCancel = _fsdk.DocProviderCallback_e_PrintOptionCanCancel
| If set, that means printing process can be canceled.
| e_PrintOptionPrintAnnot = _fsdk.DocProviderCallback_e_PrintOptionPrintAnnot
| If set, print annotations.
| e_PrintOptionReverseOrder = _fsdk.DocProviderCallback_e_PrintOptionReverseOrder
| If set, print page in reverse order; otherwise, in normal order.
| e_PrintOptionShowDialog = _fsdk.DocProviderCallback_e_PrintOptionShowDialog
| If set, show printing dialog box.
| e_PrintOptionShrinkPage = _fsdk.DocProviderCallback_e_PrintOptionShrinkPage
| If set, shrink page to fit within content area.
| e_SubmitInPDF = _fsdk.DocProviderCallback_e_SubmitInPDF
| The submit data is packaged in PDF format as described in the PDF Reference.
| e_SubmitInUrlEncoded = _fsdk.DocProviderCallback_e_SubmitInUrlEncoded
| The submit data is packaged in URL-encoded format as described in Uniform Resource Locator(URL).
| e_SubmitInXDP = _fsdk.DocProviderCallback_e_SubmitInXDP
| The submit data is packaged in XDP format, as described in XDP Specification.
| e_SubmitInXFD = _fsdk.DocProviderCallback_e_SubmitInXFD
| The submit data is packaged in XFD format, as described in XFDF.
| e_SubmitInXML = _fsdk.DocProviderCallback_e_SubmitInXML
| The submit data is translated and packaged into an URL-Encoded format.
| e_TextEncodingBig5 = _fsdk.DocProviderCallback_e_TextEncodingBig5
| Text encoding: Big5.
| e_TextEncodingFontSpecific = _fsdk.DocProviderCallback_e_TextEncodingFontSpecific
| Text encoding: font specific.
| e_TextEncodingGB18030 = _fsdk.DocProviderCallback_e_TextEncodingGB18030
| Text encoding: GB18030.
| e_TextEncodingGB2312 = _fsdk.DocProviderCallback_e_TextEncodingGB2312
| Text encoding: GB2312.
| e_TextEncodingGBK = _fsdk.DocProviderCallback_e_TextEncodingGBK
| Text encoding: GBK.
| e_TextEncodingISO8859NN = _fsdk.DocProviderCallback_e_TextEncodingISO8859NN
| Text encoding: ISO8859NN.
| e_TextEncodingKSC5601 = _fsdk.DocProviderCallback_e_TextEncodingKSC5601
| Text encoding: KSC5601.
| e_TextEncodingNone = _fsdk.DocProviderCallback_e_TextEncodingNone
| No text encoding.
| e_TextEncodingShiftJIS = _fsdk.DocProviderCallback_e_TextEncodingShiftJIS
| Text encoding: ShiftJIS.
| e_TextEncodingUCS2 = _fsdk.DocProviderCallback_e_TextEncodingUCS2
| Text encoding: UCS-2.
| e_TextEncodingUTF16 = _fsdk.DocProviderCallback_e_TextEncodingUTF16
| Text encoding: UTF-16.
| e_TextEncodingUTF8 = _fsdk.DocProviderCallback_e_TextEncodingUTF8
| Text encoding: UTF-8.
| e_WidgetEventTypeAdded = _fsdk.DocProviderCallback_e_WidgetEventTypeAdded
| Event type: after an XFA widget is added.
| e_WidgetEventTypeBeforeRemoved = _fsdk.DocProviderCallback_e_WidgetEventTypeBeforeRemoved
| Event type: before an XFA widget is removed.

## Detailed Description

This class represents a callback object as an XFA document provider. All the functions in this class are used as callback functions. Pure virtual functions should be implemented by user.

## Member Function Documentation

## ◆ DisplayCaret()

def FoxitPDFSDKPython2.DocProviderCallback.DisplayCaret | ( |  | page_index,
|  |  | is_visible,
|  |  | rect
| ) |  |

A callback function used to display or hide caret.

Parameters

  [in] | page_index | The index of page.
  [in] | is_visible | Used to decide whether the caret is visible or not: true means visible, while false means invisible.
  [in] | rect | A rectangle.

Returns
  None.

## ◆ ExportData()

def FoxitPDFSDKPython2.DocProviderCallback.ExportData | ( |  | doc,
|  |  | file_path
| ) |  |

A callback function used to export data to file.

Parameters

  [in] | doc | Current XFA document.
  [in] | file_path | A file path, to which the data should be exported. If this is an empty string, user should specify a path as the exported file path. In this case, application can show a dialog to user to let user select the file manually.

Returns
  None.

## ◆ GetCurrentPage()

def FoxitPDFSDKPython2.DocProviderCallback.GetCurrentPage | ( |  | doc | ) |

A callback function used to get index of current page.

Parameters

  [in] | doc | Current XFA document.

Returns
  The index of current page.

## ◆ GetHighlightColor()

def FoxitPDFSDKPython2.DocProviderCallback.GetHighlightColor | ( |  | doc | ) |

A callback function get the highlight color.

Parameters

  [in] | doc | Current XFA document.

Returns
  The highlight color.

## ◆ GetPopupPos()

def FoxitPDFSDKPython2.DocProviderCallback.GetPopupPos | ( |  | page_index,
|  |  | min_popup,
|  |  | max_popup,
|  |  | rect_widget,
|  |  | inout_rect_popup
| ) |  |

A callback function used to get the pop-up position.

Parameters

  [in] | page_index | The index of page.
  [in] | min_popup | The minimum height of drop-down box.
  [in] | max_popup | The maximum height of drop-down box.
  [in] | rect_widget | The rectangle of current widget.
  [in,out] | inout_rect_popup | A rectangle. When this function calls, this is used as an input parameter that specifies the width of drop-down box. When this function returns, this is used as an output parameter that receives the height of drop-down box.

Returns
  true means success, while false means failure.

## ◆ GetTitle()

def FoxitPDFSDKPython2.DocProviderCallback.GetTitle | ( |  | doc | ) |

A callback function used to get title of current XFA document.

Parameters

  [in] | doc | Current XFA document.

Returns
  The title.

## ◆ GotoURL()

def FoxitPDFSDKPython2.DocProviderCallback.GotoURL | ( |  | doc,
|  |  | url
| ) |  |

A callback function used to go to a specified URL.

Parameters

  [in] | doc | Current XFA document.
  [in] | url | A URL string.

Returns
  None.

## ◆ ImportData()

def FoxitPDFSDKPython2.DocProviderCallback.ImportData | ( |  | doc,
|  |  | file_path
| ) |  |

A callback function used to import data from file.

Parameters

  [in] | doc | Current XFA document.
  [in] | file_path | A file path, from which the data would be imported. If this is an empty string, user should specify a path as the imported file path. In this case, application can show a dialog to user to let user select the file manually.

Returns
  None.

## ◆ InvalidateRect()

def FoxitPDFSDKPython2.DocProviderCallback.InvalidateRect | ( |  | page_index,
|  |  | rect,
|  |  | flag
| ) |  |

A callback function used to invalidate rectangle according the flag.

This callback function would be used in dynamic XFA document.

Parameters

  [in] | page_index | The index of page.
  [in] | rect | A rectangle to be invalidate.
  [in] | flag | Invalidate flag. Please refer to values starting from FoxitPDFSDKPython2.DocProviderCallback.e_InvalidateFlagAllPages and this would be one of these values.

Returns
  None.

## ◆ NotifyWidgetChangeInfo()

def FoxitPDFSDKPython2.DocProviderCallback.NotifyWidgetChangeInfo | ( |  | doc,
|  |  | change_info
| ) |  |

A callback function to notify XFA widget change information.

Parameters

  [in] | doc | Current XFA document.
  [in] | change_info | The xfa widget change information.

Returns
  None.

## ◆ PageViewEvent()

def FoxitPDFSDKPython2.DocProviderCallback.PageViewEvent | ( |  | page_index,
|  |  | page_view_event_type
| ) |  |

A callback function to execute page view event.

Parameters

  [in] | page_index | The page index.
  [in] | page_view_event_type | Page view event type. Please refer to values starting from FoxitPDFSDKPython2.DocProviderCallback.e_PageViewEventTypeAdded and this would be one of these values.

Returns
  None.

## ◆ PopupMenu()

def FoxitPDFSDKPython2.DocProviderCallback.PopupMenu | ( |  | page_index,
|  |  | rect_popup
| ) |  |

A callback function used to pop up the context menu.

Parameters

  [in] | page_index | The index of page.
  [in] | rect_popup | The rectangle where to pop up menu.

Returns
  true means success, otherwise means failure.

## ◆ Print()

def FoxitPDFSDKPython2.DocProviderCallback.Print | ( |  | doc,
|  |  | start_page_index,
|  |  | end_page_index,
|  |  | options
| ) |  |

A callback function used to print.

Parameters

  [in] | doc | Current XFA document.
  [in] | start_page_index | The index of start page.
  [in] | end_page_index | The index of end page.
  [in] | options | Print options. Please refer to values starting from FoxitPDFSDKPython2.DocProviderCallback.e_PrintOptionShowDialog and this would be one or a combination of these values.

Returns
  None.

## ◆ Release()

def FoxitPDFSDKPython2.DocProviderCallback.Release | ( |  | ) |

A callback function used to release current callback object itself.

Returns
  None.

## ◆ SetChangeMark()

def FoxitPDFSDKPython2.DocProviderCallback.SetChangeMark | ( |  | doc | ) |

A callback function used to set change mark flag to current XFA document.

Parameters

  [in] | doc | Current XFA document.

Returns
  None.

## ◆ SetCurrentPage()

def FoxitPDFSDKPython2.DocProviderCallback.SetCurrentPage | ( |  | doc,
|  |  | current_page_index
| ) |  |

A callback function used to set index of current page.

Parameters

  [in] | doc | Current XFA document.
  [in] | current_page_index | The index would be set.

Returns
  None.

## ◆ SetFocus()

def FoxitPDFSDKPython2.DocProviderCallback.SetFocus | ( |  | xfa_widget,
|  |  | is_relayout
| ) |  |

A callback function used to set focus widget.

Parameters

  [in] | xfa_widget | An XFA widget to be set focus on.
  [in] | is_relayout | true means the layout has changed, while false means the layout has not changed.

Returns
  None.

## ◆ SubmitData()

def FoxitPDFSDKPython2.DocProviderCallback.SubmitData | ( |  | doc,
|  |  | target,
|  |  | format,
|  |  | text_encoding,
|  |  | content
| ) |  |

A callback function to submit data.

Parameters

  [in] | doc | Current XFA document.
  [in] | target | A string that represents the target of data to be submit.
  [in] | format | The format of data to be submit. Please refer to values starting from FoxitPDFSDKPython2.DocProviderCallback.e_SubmitInXDP and this would be one of these values.
  [in] | text_encoding | The text encoding of data to be submit. Please refer to values starting from FoxitPDFSDKPython2.DocProviderCallback.e_TextEncodingNone and this would be one of these values.
  [in] | content | The content of data to be submit.

Returns
  true means success, otherwise means failure.

## ◆ WidgetEvent()

def FoxitPDFSDKPython2.DocProviderCallback.WidgetEvent | ( |  | xfa_widget,
|  |  | widget_event_type
| ) |  |

A callback function to execute XFA widget event.

Parameters

  [in] | xfa_widget | An XFA widget which sends the event.
  [in] | widget_event_type | Widget event type. Please refer to values starting from FoxitPDFSDKPython2.DocProviderCallback.e_WidgetEventTypeAdded and this would be one of these values.

Returns
  None.