Foxit PDF SDK
foxit.addon.conversion.pdf2office.PDF2Office Class Reference
Inheritance diagram for foxit.addon.conversion.pdf2office.PDF2Office:
foxit.common.Base

Static Public Member Functions

static void Initialize (string library_path)
 Initialize Foxit PDF Conversion SDK Library. More...
 
static void Release ()
 Release all resource allocated by Foxit PDF Conversion SDK Library. More...
 
static Progressive StartConvertToExcel (string src_pdf_path, string src_pdf_password, string saved_excel_file_path, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback)
 Start to convert a PDF file to a Excel format file. Function PDF2Office.Initialize must be called before calling this function. More...
 
static Progressive StartConvertToExcel (FileReaderCallback src_pdf_reader, string src_pdf_password, StreamCallback saved_excel_file_stream, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback)
 Start to convert a PDF file to a Excel format file. Function PDF2Office.Initialize must be called before calling this function. More...
 
static Progressive StartConvertToPowerPoint (string src_pdf_path, string src_pdf_password, string saved_ppt_file_path, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback)
 Start to convert a PDF file to a PowerPoint format file. Function PDF2Office.Initialize must be called before calling this function. More...
 
static Progressive StartConvertToPowerPoint (FileReaderCallback src_pdf_reader, string src_pdf_password, StreamCallback saved_ppt_file_stream, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback)
 Start to convert a PDF file to a PowerPoint format file. Function PDF2Office.Initialize must be called before calling this function. More...
 
static Progressive StartConvertToWord (string src_pdf_path, string src_pdf_password, string saved_word_file_path, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback)
 Start to convert a PDF file to a Word format file. Function PDF2Office.Initialize must be called before calling this function. More...
 
static Progressive StartConvertToWord (FileReaderCallback src_pdf_reader, string src_pdf_password, StreamCallback saved_word_file_stream, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback)
 Start to convert a PDF file to a Word format file. Function PDF2Office.Initialize must be called before calling this function. More...
 

Detailed Description

This class can be used to convert PDF files to Office(Word, Excel or PowerPoint) format files. Before using "Conversion" module, please ensure the resource folder named "res" in the PDF Conversion SDK package is valid. Before using methods in this module, please ensure Foxit PDF Conversion SDK has been initialized successfully by function common.Library.Initialize with a key including "PDF2Office" module.

See also
foxit.common.Library

Member Function Documentation

◆ Initialize()

static void foxit.addon.conversion.pdf2office.PDF2Office.Initialize ( string  library_path)
inlinestatic

Initialize Foxit PDF Conversion SDK Library.

During the life-cycle of "pdf2office" module, this function can only be called once and should be called first before any other functions in "pdf2office" module can be called.

Parameters
[in]library_pathPath of PDF Conversion SDK library. This should not be an empty string.
Returns
None.

◆ Release()

static void foxit.addon.conversion.pdf2office.PDF2Office.Release ( )
inlinestatic

Release all resource allocated by Foxit PDF Conversion SDK Library.

When the user does not use "pdf2office" module, this function should be called to release all memory blocks allocated by the library.

Returns
None.

◆ StartConvertToExcel() [1/2]

static Progressive foxit.addon.conversion.pdf2office.PDF2Office.StartConvertToExcel ( string  src_pdf_path,
string  src_pdf_password,
string  saved_excel_file_path,
PDF2OfficeSettingData  setting_data,
ConvertCallback  convert_callback 
)
inlinestatic

Start to convert a PDF file to a Excel format file. Function PDF2Office.Initialize must be called before calling this function.

Currently only support converting to XLSX format file.

Parameters
[in]src_pdf_pathPath of a PDF file. This should not be an empty string.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_excel_file_pathPath of the saved Excel format file as conversion result. This should not be an empty string. If the suffix name of the saved Excel format file is not "xlsx", a new suffix named "xlsx" will be added to the original file name.
[in]setting_dataSetting data used for converting.
[in]convert_callbackA foxit.addon.conversion.pdf2office.ConvertCallback object which is implemented by user to pause and notify the conversion progress during the converting process. This can be null which means not to pause and notify the conversion progress. If this is not null, it should be a valid foxit.addon.conversion.pdf2office.ConvertCallback object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function common.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function common.Progressive.Continue to continue the progress until the progress is finished.

◆ StartConvertToExcel() [2/2]

static Progressive foxit.addon.conversion.pdf2office.PDF2Office.StartConvertToExcel ( FileReaderCallback  src_pdf_reader,
string  src_pdf_password,
StreamCallback  saved_excel_file_stream,
PDF2OfficeSettingData  setting_data,
ConvertCallback  convert_callback 
)
inlinestatic

Start to convert a PDF file to a Excel format file. Function PDF2Office.Initialize must be called before calling this function.

Currently only support converting to XLSX format file.

Parameters
[in]src_pdf_readerA FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_excel_file_streamA foxit.common.fxcrt.StreamCallback object which is implemented by user to read the contents of the converted Excel format file. It should not be null.
[in]setting_dataSetting data used for converting.
[in]convert_callbackA foxit.addon.conversion.pdf2office.ConvertCallback object which is implemented by user to pause and notify the conversion progress during the converting process. This can be null which means not to pause and notify the conversion progress. If this is not null, it should be a valid foxit.addon.conversion.pdf2office.ConvertCallback object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function common.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function common.Progressive.Continue to continue the progress until the progress is finished.

◆ StartConvertToPowerPoint() [1/2]

static Progressive foxit.addon.conversion.pdf2office.PDF2Office.StartConvertToPowerPoint ( string  src_pdf_path,
string  src_pdf_password,
string  saved_ppt_file_path,
PDF2OfficeSettingData  setting_data,
ConvertCallback  convert_callback 
)
inlinestatic

Start to convert a PDF file to a PowerPoint format file. Function PDF2Office.Initialize must be called before calling this function.

Currently only support converting to PPTX format file.

Parameters
[in]src_pdf_pathPath of a PDF file. This should not be an empty string.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_ppt_file_pathPath of the saved PowerPoint format file as conversion result. This should not be an empty string. If the suffix name of the saved PowerPoint format file is not "pptx", a new suffix named "pptx" will be added to the original file name.
[in]setting_dataSetting data used for converting.
[in]convert_callbackA foxit.addon.conversion.pdf2office.ConvertCallback object which is implemented by user to pause and notify the conversion progress during the converting process. This can be null which means not to pause and notify the conversion progress. If this is not null, it should be a valid foxit.addon.conversion.pdf2office.ConvertCallback object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function common.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function common.Progressive.Continue to continue the progress until the progress is finished.

◆ StartConvertToPowerPoint() [2/2]

static Progressive foxit.addon.conversion.pdf2office.PDF2Office.StartConvertToPowerPoint ( FileReaderCallback  src_pdf_reader,
string  src_pdf_password,
StreamCallback  saved_ppt_file_stream,
PDF2OfficeSettingData  setting_data,
ConvertCallback  convert_callback 
)
inlinestatic

Start to convert a PDF file to a PowerPoint format file. Function PDF2Office.Initialize must be called before calling this function.

Currently only support converting to PPTX format file.

Parameters
[in]src_pdf_readerA FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_ppt_file_streamA foxit.common.fxcrt.StreamCallback object which is implemented by user to read the contents of the converted PowerPoint format file. It should not be null.
[in]setting_dataSetting data used for converting.
[in]convert_callbackA foxit.addon.conversion.pdf2office.ConvertCallback object which is implemented by user to pause and notify the conversion progress during the converting process. This can be null which means not to pause and notify the conversion progress. If this is not null, it should be a valid foxit.addon.conversion.pdf2office.ConvertCallback object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function common.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function common.Progressive.Continue to continue the progress until the progress is finished.

◆ StartConvertToWord() [1/2]

static Progressive foxit.addon.conversion.pdf2office.PDF2Office.StartConvertToWord ( string  src_pdf_path,
string  src_pdf_password,
string  saved_word_file_path,
PDF2OfficeSettingData  setting_data,
ConvertCallback  convert_callback 
)
inlinestatic

Start to convert a PDF file to a Word format file. Function PDF2Office.Initialize must be called before calling this function.

Currently only support converting to DOCX format file.

Parameters
[in]src_pdf_pathPath of a PDF file. This should not be an empty string.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_word_file_pathPath of the saved Word format file as conversion result. This should not be an empty string. If the suffix name of the saved Word format file is not "docx", a new suffix named "docx" will be added to the original file name.
[in]setting_dataSetting data used for converting.
[in]convert_callbackA foxit.addon.conversion.pdf2office.ConvertCallback object which is implemented by user to pause and notify the conversion progress during the converting process. This can be null which means not to pause and notify the conversion progress. If this is not null, it should be a valid foxit.addon.conversion.pdf2office.ConvertCallback object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function common.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function common.Progressive.Continue to continue the progress until the progress is finished.

◆ StartConvertToWord() [2/2]

static Progressive foxit.addon.conversion.pdf2office.PDF2Office.StartConvertToWord ( FileReaderCallback  src_pdf_reader,
string  src_pdf_password,
StreamCallback  saved_word_file_stream,
PDF2OfficeSettingData  setting_data,
ConvertCallback  convert_callback 
)
inlinestatic

Start to convert a PDF file to a Word format file. Function PDF2Office.Initialize must be called before calling this function.

Currently only support converting to DOCX format file.

Parameters
[in]src_pdf_readerA FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_word_file_streamA foxit.common.fxcrt.StreamCallback object which is implemented by user to read the contents of the converted Word format file. It should not be null.
[in]setting_dataSetting data used for converting.
[in]convert_callbackA foxit.addon.conversion.pdf2office.ConvertCallback object which is implemented by user to pause and notify the conversion progress during the converting process. This can be null which means not to pause and notify the conversion progress. If this is not null, it should be a valid foxit.addon.conversion.pdf2office.ConvertCallback object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function common.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function common.Progressive.Continue to continue the progress until the progress is finished..