Foxit PDF SDK
|
Public Types | |
enum | EventType { e_EventTypeUnknown = 0, e_EventTypePostPrint = 1, e_EventTypePrePrint = 2 } |
Enumeration for XFA event type. More... | |
enum | ExportDataType { e_ExportDataTypeXML = 0, e_ExportDataTypeStaticXDP = 1, e_ExportDataTypeXDP = 2 } |
Enumeration for the type of exported data. More... | |
enum | Type { e_Dynamic = 0, e_Static = 1, e_XDP = 2 } |
Enumeration for XFA document type. More... | |
Public Member Functions | |
XFADoc (const pdf::PDFDoc &document, DocProviderCallback *xfa_doc_provider_handler) | |
Constructor. More... | |
XFADoc (const foxit::pdf::PDFDoc &document) | |
Constructor. More... | |
XFADoc (const XFADoc &other) | |
Constructor, with another XFA document object. More... | |
~XFADoc () | |
Destructor. | |
bool | ExportData (const char *output_file_path, ExportDataType export_type) |
Export data to a file. More... | |
bool | ExportData (const wchar_t *output_file_path, ExportDataType export_type) |
Export data to a file. More... | |
void | FlattenTo (const char *output_file_path) |
Flatten current XFA document to a file. More... | |
void | FlattenTo (const wchar_t *output_file_path) |
Flatten current XFA document to a file. More... | |
void | FlattenTo (foxit::common::file::StreamCallback *stream) |
Flatten current XFA document to a file stream. More... | |
XFAPage | GetPage (int page_index) |
Get XFA page by index. More... | |
int | GetPageCount () const |
Get XFA page count. More... | |
Type | GetType () const |
Get the XFA document type. More... | |
XFAWidget | GetWidgetByFullName (const WString &full_name) |
Get the XFA widget which matches the specified full name. More... | |
bool | ImportData (const char *file_path) |
Import data from an XML or XDP file. More... | |
bool | ImportData (const wchar_t *file_path) |
Import data from an XML or XDP file. More... | |
bool | ImportData (foxit::common::file::ReaderCallback *file_reader) |
Import data from a common::file::ReaderCallback object. More... | |
bool | IsEmpty () const |
Check whether current object is empty or not. More... | |
void | KillFocus () |
Kill the focus of XFA widget. More... | |
bool | operator != (const XFADoc &other) const |
Not equal operator. More... | |
XFADoc & | operator= (const XFADoc &other) |
Assign operator. More... | |
bool | operator== (const XFADoc &other) const |
Equal operator. More... | |
void | ProcessEvent (EventType event_type) |
Process a kind of event for all the XFA widgets in current XFA document. More... | |
void | ResetForm () |
Reset form. More... | |
void | SetDocProviderCallback (foxit::addon::xfa::DocProviderCallback *doc_provider_callback) |
Set XFA document provider callback. More... | |
void | SetFocus (XFAWidget xfa_widget) |
Set the focus of XFA widget. More... | |
void | SetPDFPath (const char *pdf_file_path) |
Set the path of related PDF document. More... | |
void | SetPDFPath (const wchar_t *pdf_file_path) |
Set the path of related PDF document. More... | |
common::Progressive | StartLoad (common::PauseCallback *pause=0) |
Start to load content for current XFA document. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
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 an XFA document, please construct a pdf::TextSearch object with XFADoc object.
Enumeration for XFA event type.
Values of this enumeration should be used alone.
foxit::addon::xfa::XFADoc::XFADoc | ( | const pdf::PDFDoc & | document, |
DocProviderCallback * | xfa_doc_provider_handler | ||
) |
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. |
foxit::addon::xfa::XFADoc::XFADoc | ( | const foxit::pdf::PDFDoc & | document | ) |
Constructor.
When constructing an 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. |
foxit::addon::xfa::XFADoc::XFADoc | ( | const XFADoc & | other | ) |
Constructor, with another XFA document object.
[in] | other | Another XFA document object |
bool foxit::addon::xfa::XFADoc::ExportData | ( | const char * | output_file_path, |
ExportDataType | export_type | ||
) |
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 XFADoc::e_ExportDataTypeXML and this should be one of these values. |
bool foxit::addon::xfa::XFADoc::ExportData | ( | const wchar_t * | output_file_path, |
ExportDataType | export_type | ||
) |
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 XFADoc::e_ExportDataTypeXML and this should be one of these values. |
void foxit::addon::xfa::XFADoc::FlattenTo | ( | const char * | output_file_path | ) |
Flatten current XFA document to a file.
[in] | output_file_path | A file path, to which the flattening result will be saved. |
void foxit::addon::xfa::XFADoc::FlattenTo | ( | const wchar_t * | output_file_path | ) |
Flatten current XFA document to a file.
[in] | output_file_path | A file path, to which the flattening result will be saved. |
void foxit::addon::xfa::XFADoc::FlattenTo | ( | foxit::common::file::StreamCallback * | stream | ) |
Flatten current XFA document to a file stream.
[in] | stream | A foxit::common::file::StreamCallback object which is implemented by user to save the flattened result. |
XFAPage foxit::addon::xfa::XFADoc::GetPage | ( | int | page_index | ) |
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 foxit::addon::xfa::XFADoc::GetPageCount | ( | ) | const |
Get XFA page count.
Type foxit::addon::xfa::XFADoc::GetType | ( | ) | const |
Get the XFA document type.
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 XFAWidget::e_WidgetNameTypeFullName in previous process. |
bool foxit::addon::xfa::XFADoc::ImportData | ( | const char * | file_path | ) |
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". |
bool foxit::addon::xfa::XFADoc::ImportData | ( | const wchar_t * | file_path | ) |
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". |
bool foxit::addon::xfa::XFADoc::ImportData | ( | foxit::common::file::ReaderCallback * | file_reader | ) |
Import data from a common::file::ReaderCallback object.
[in] | file_reader | A common::file::ReaderCallback object, whose data will be imported to current XFA document. It should be XML or XDP file. |
bool foxit::addon::xfa::XFADoc::IsEmpty | ( | ) | const |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
void foxit::addon::xfa::XFADoc::KillFocus | ( | ) |
Kill the focus of XFA widget.
bool foxit::addon::xfa::XFADoc::operator != | ( | const XFADoc & | other | ) | const |
Not equal operator.
[in] | other | Another XFA document object. This function will check if current object is not equal to this one. |
Assign operator.
[in] | other | Another XFA document object, whose value would be assigned to current object. |
bool foxit::addon::xfa::XFADoc::operator== | ( | const XFADoc & | other | ) | const |
Equal operator.
[in] | other | Another XFA document object. This function will check if current object is equal to this one. |
void foxit::addon::xfa::XFADoc::ProcessEvent | ( | EventType | event_type | ) |
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 XFADoc::e_EventTypePostPrint and this should be one of these values except XFADoc::e_EventTypeUnknown. |
void foxit::addon::xfa::XFADoc::ResetForm | ( | ) |
Reset form.
void foxit::addon::xfa::XFADoc::SetDocProviderCallback | ( | foxit::addon::xfa::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 foxit::addon::xfa::XFADoc::SetFocus | ( | XFAWidget | xfa_widget | ) |
Set the focus of XFA widget.
[in] | xfa_widget | An XFA widget which would be focused. |
void foxit::addon::xfa::XFADoc::SetPDFPath | ( | const char * | pdf_file_path | ) |
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. |
void foxit::addon::xfa::XFADoc::SetPDFPath | ( | const wchar_t * | pdf_file_path | ) |
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. |
common::Progressive foxit::addon::xfa::XFADoc::StartLoad | ( | common::PauseCallback * | pause = 0 | ) |
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. Default value: NULL. |