Foxit PDF SDK
|
Public Member Functions | |
XFADoc (PDFDoc document, DocProviderCallback xfa_doc_provider_handler) throws com.foxit.sdk.PDFException | |
Constructor. More... | |
XFADoc (PDFDoc document) throws com.foxit.sdk.PDFException | |
Constructor. More... | |
XFADoc (XFADoc other) | |
Constructor, with another XFA document object. More... | |
boolean | exportData (String output_file_path, int export_type) throws com.foxit.sdk.PDFException |
Export data to a file. More... | |
void | flattenTo (String output_file_path) throws com.foxit.sdk.PDFException |
Flatten current XFA document to a file. More... | |
void | flattenTo (StreamCallback stream) throws com.foxit.sdk.PDFException |
Flatten current XFA document to a file stream. More... | |
XFAPage | getPage (int page_index) throws com.foxit.sdk.PDFException |
Get XFA page by index. More... | |
int | getPageCount () throws com.foxit.sdk.PDFException |
Get XFA page count. More... | |
int | getType () throws com.foxit.sdk.PDFException |
Get the XFA document type. More... | |
XFAWidget | getWidgetByFullName (String full_name) throws com.foxit.sdk.PDFException |
Get the XFA widget which matches the specified full name. More... | |
boolean | importData (String file_path) throws com.foxit.sdk.PDFException |
Import data from an XML or XDP file. More... | |
boolean | isEmpty () |
Check whether current object is empty or not. More... | |
void | killFocus () throws com.foxit.sdk.PDFException |
Kill the focus of XFA widget. More... | |
void | processEvent (int event_type) throws com.foxit.sdk.PDFException |
Process a kind of event for all the XFA widgets in current XFA document. More... | |
void | resetForm () throws com.foxit.sdk.PDFException |
Reset form. More... | |
void | setDocProviderCallback (DocProviderCallback doc_provider_callback) |
Set XFA document provider callback. More... | |
void | setFocus (XFAWidget xfa_widget) throws com.foxit.sdk.PDFException |
Set the focus of XFA widget. More... | |
void | setPDFPath (String pdf_file_path) throws com.foxit.sdk.PDFException |
Set the path of related PDF document. More... | |
Progressive | startLoad (PauseCallback pause) throws com.foxit.sdk.PDFException |
Start to load content for current XFA document. More... | |
Static Public Attributes | |
static final int | e_Dynamic = 0 |
XFA document type: Dynamic. | |
static final int | e_EventTypePostPrint = 1 |
This kind of event is triggered just after the rendered form has been sent to the printer, spooler, or output destination. | |
static final int | e_EventTypePrePrint = 2 |
This kind of event is triggered just before the rendering for printing begins. | |
static final int | e_EventTypeUnknown = 0 |
Event type: Unknown. | |
static final int | e_ExportDataTypeStaticXDP = 1 |
Type of exported data: Static XDP. | |
static final int | e_ExportDataTypeXDP = 2 |
Type of exported data: XDP. | |
static final int | e_ExportDataTypeXML = 0 |
Type of exported data: XML. | |
static final int | e_Static = 1 |
XFA document type: Static. | |
static final int | e_XDP = 2 |
XFA document type: XDP, as Raw XML data. | |
Class XFADoc is constructed from a loaded PDF document object, in order to access XFA content more clearly. User must call common.Library.registerXFAAppProviderCallback before using XFA moudle. For a newly constructed XFA object, please remember to call function XFADoc.startLoad before using other functions in class XFA.
To search among a XFA document, please construct a com.foxit.sdk.pdf.TextSearch object with XFADoc object.
com.foxit.sdk.addon.xfa.XFADoc.XFADoc | ( | PDFDoc | document, |
DocProviderCallback | xfa_doc_provider_handler | ||
) | throws com.foxit.sdk.PDFException |
Constructor.
[in] | document | A valid PDF document. It should has been loaded successfully. |
[in] | xfa_doc_provider_handler | An XFA document provider callback object which is implemented by user and based on callback class DocProviderCallback . It should not be null. User should ensure this callback object is kept valid until related PDF document is released. |
com.foxit.sdk.addon.xfa.XFADoc.XFADoc | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
Constructor.
When constructing a XFADoc by this constructor successfully, user must set XFA document provider callback by function XFADoc.setDocProviderCallback .
[in] | document | A valid PDF document. It should has been loaded successfully. |
com.foxit.sdk.addon.xfa.XFADoc.XFADoc | ( | XFADoc | other | ) |
Constructor, with another XFA document object.
[in] | other | Another XFA document object |
bool com.foxit.sdk.addon.xfa.XFADoc.exportData | ( | String | output_file_path, |
int | export_type | ||
) | throws com.foxit.sdk.PDFException |
Export data to a file.
[in] | output_file_path | A file path, to which data will be exported to. |
[in] | export_type | Export type. Please refer to values starting from com.foxit.sdk.addon.xfa.XFADoc.e_ExportDataTypeXML and this should be one of these values. |
void com.foxit.sdk.addon.xfa.XFADoc.flattenTo | ( | String | output_file_path | ) | throws com.foxit.sdk.PDFException |
Flatten current XFA document to a file.
[in] | output_file_path | A file path, to which the flattening result will be saved. |
void com.foxit.sdk.addon.xfa.XFADoc.flattenTo | ( | StreamCallback | stream | ) | throws com.foxit.sdk.PDFException |
Flatten current XFA document to a file stream.
[in] | stream | A com.foxit.sdk.common.fxcrt.StreamCallback object which is implemented by user to save the flattened result. |
XFAPage com.foxit.sdk.addon.xfa.XFADoc.getPage | ( | int | page_index | ) | throws com.foxit.sdk.PDFException |
Get XFA page by index.
[in] | page_index | The page index. Valid range: from 0 to (count-1). count is returned by function XFADoc.getPageCount . |
int com.foxit.sdk.addon.xfa.XFADoc.getPageCount | ( | ) | throws com.foxit.sdk.PDFException |
Get XFA page count.
int com.foxit.sdk.addon.xfa.XFADoc.getType | ( | ) | throws com.foxit.sdk.PDFException |
Get the XFA document type.
XFAWidget com.foxit.sdk.addon.xfa.XFADoc.getWidgetByFullName | ( | String | full_name | ) | throws com.foxit.sdk.PDFException |
Get the XFA widget which matches the specified full name.
Some XFA widgets may cover serveral XFA pages. In this case, this function can only be used to get the first matched XFA widget in XFA document. User can also use function XFAPage.getWidgetByFullName to get the matched XFA widget in an XFA page.
[in] | full_name | An XFA widget's full name. It should not be an empty string. XFA widget's full name can be retrieved by function XFAWidget.getName with type com.foxit.sdk.addon.xfa.XFAWidget.e_WidgetNameTypeFullName in previous process. |
bool com.foxit.sdk.addon.xfa.XFADoc.importData | ( | String | file_path | ) | throws com.foxit.sdk.PDFException |
Import data from an XML or XDP file.
[in] | file_path | A path of a source file, whose data will be imported to current XFA document. It should be XML or XDP file and the file extension should be ".xml" or ".xdp". |
boolean com.foxit.sdk.addon.xfa.XFADoc.isEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
void com.foxit.sdk.addon.xfa.XFADoc.killFocus | ( | ) | throws com.foxit.sdk.PDFException |
Kill the focus of XFA widget.
void com.foxit.sdk.addon.xfa.XFADoc.processEvent | ( | int | event_type | ) | throws com.foxit.sdk.PDFException |
Process a kind of event for all the XFA widgets in current XFA document.
[in] | event_type | An event type. Please refer to values starting from com.foxit.sdk.addon.xfa.XFADoc.e_EventTypePostPrint and this should be one of these values except com.foxit.sdk.addon.xfa.XFADoc.e_EventTypeUnknown . |
void com.foxit.sdk.addon.xfa.XFADoc.resetForm | ( | ) | throws com.foxit.sdk.PDFException |
Reset form.
void com.foxit.sdk.addon.xfa.XFADoc.setDocProviderCallback | ( | DocProviderCallback | doc_provider_callback | ) |
Set XFA document provider callback.
[in] | doc_provider_callback | An XFA document provider callback object which is implemented by user and based on callback class DocProviderCallback . It should not be null. User should ensure this callback object is kept valid until related PDF document is released. |
void com.foxit.sdk.addon.xfa.XFADoc.setFocus | ( | XFAWidget | xfa_widget | ) | throws com.foxit.sdk.PDFException |
Set the focus of XFA widget.
[in] | xfa_widget | A XFA widget which would be focused. |
void com.foxit.sdk.addon.xfa.XFADoc.setPDFPath | ( | String | pdf_file_path | ) | throws com.foxit.sdk.PDFException |
Set the path of related PDF document.
The PDF path will be used in function XFADoc.exportData , to be a part of exported data.
[in] | pdf_file_path | The file path of related PDF document. It can be either an absolute path or a relative path. It should not be an empty string. |
Progressive com.foxit.sdk.addon.xfa.XFADoc.startLoad | ( | PauseCallback | pause | ) | throws com.foxit.sdk.PDFException |
Start to load content for current XFA document.
It may take a long time to loading XFA content, so this function uses a progressive process to do this.
The related PDF document object has been loaded, but only PDF related contents have been loaded. So, in order to access XFA content, this function should be called to load XFA content.
[in] | pause | Pause object which decides if the importing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user. |