Foxit PDF SDK

Static Public Member Functions | List of all members
FoxitPDFSDKPython3.PDF2Office Class Reference
Inheritance diagram for FoxitPDFSDKPython3.PDF2Office:

## Static Public Member Functions
def | GetVersion ()
| Get the version of Foxit PDF Conversion SDK. More...
def | Initialize (library_path, fx_engine_path)
| Initialize Foxit PDF Conversion. More...
def | Release ()
| Release all resource allocated by Foxit PDF Conversion. More...
def | SetConvertCheckCallback (convert_check_callback)
| Set the callback object to check the PDF to Office conversion conditions. More...
def | StartConvertToExcel (src_pdf_path, src_pdf_password, saved_excel_file_path, setting_data, convert_callback)
| Start to convert a PDF file to a Excel format file. Function FoxitPDFSDKPython3.PDF2Office.Initialize must be called before calling this function. More...
def | StartConvertToExcel (src_pdf_reader, src_pdf_password, saved_excel_file_stream, setting_data, convert_callback)
| Start to convert a PDF file to a Excel format file. Function FoxitPDFSDKPython3.PDF2Office.Initialize must be called before calling this function. More...
def | StartConvertToPowerPoint (src_pdf_path, src_pdf_password, saved_ppt_file_path, setting_data, convert_callback)
| Start to convert a PDF file to a PowerPoint format file. Function FoxitPDFSDKPython3.PDF2Office.Initialize must be called before calling this function. More...
def | StartConvertToPowerPoint (src_pdf_reader, src_pdf_password, saved_ppt_file_stream, setting_data, convert_callback)
| Start to convert a PDF file to a PowerPoint format file. Function FoxitPDFSDKPython3.PDF2Office.Initialize must be called before calling this function. More...
def | StartConvertToWord (src_pdf_path, src_pdf_password, saved_word_file_path, setting_data, convert_callback)
| Start to convert a PDF file to a Word format file. Function FoxitPDFSDKPython3.PDF2Office.Initialize must be called before calling this function. More...
def | StartConvertToWord (src_pdf_reader, src_pdf_password, saved_word_file_stream, setting_data, convert_callback)
| Start to convert a PDF file to a Word format file. Function FoxitPDFSDKPython3.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 folders named "res" and "lib" in the Foxit PDF Conversion SDK package is valid. Before using methods in this module, please ensure Foxit PDF SDK has been initialized successfully by function FoxitPDFSDKPython3.Library.Initialize with a key including "PDF2Office" module.

See also
  FoxitPDFSDKPython3.Library

## Member Function Documentation

## ◆ GetVersion()

FoxitPDFSDKPython3.PDF2Office.GetVersion | ( |  | ) |
| static

Get the version of Foxit PDF Conversion SDK.

This function should be called after the function FoxitPDFSDKPython3.PDF2Office.Initialize has been called successfully.

Returns
  A string which contains the version information of Foxit PDF Conversion SDK.

## ◆ Initialize()

FoxitPDFSDKPython3.PDF2Office.Initialize | ( |  | library_path,
|  |  | fx_engine_path
| ) |  |
| static

Initialize Foxit PDF Conversion.

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_path | Path of Foxit PDF Conversion SDK library. This should not be an empty string.
  [in] | fx_engine_path | Path of Foxit PDF Conversion engine. It can be an empty string. If the parameter is empty, PDF Conversion SDK library will be called directly for PDF to Office conversion, otherwise Foxit PDF Conversion SDK library will be called through the Foxit PDF Conversion engine for PDF to Office conversion.

Returns
  None.

Note
  If module "PDF2Office" is not defined in the license information which is used in function FoxitPDFSDKPython3.Library.Initialize , that means user has no right in using PDF2Office related functions and this function will throw exception FoxitPDFSDKPython3.e_ErrNoPDF2OfficeModuleRight .

## ◆ Release()

FoxitPDFSDKPython3.PDF2Office.Release | ( |  | ) |
| static

Release all resource allocated by Foxit PDF Conversion.

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

Returns
  None.

## ◆ SetConvertCheckCallback()

FoxitPDFSDKPython3.PDF2Office.SetConvertCheckCallback | ( |  | convert_check_callback | ) |
| static

Set the callback object to check the PDF to Office conversion conditions.

This method allows you to specify a custom convert check callback that will be called to evaluate whether the conversion from PDF to Office should proceed, based on user-defined logic , when the required permissions for converting the PDF documents are not met.

Parameters

  [in] | convert_check_callback | A customized convert check callback which is implemented based on callback class ConvertCheckCallback . If this is null, customized convert check callback will be removed and default convert check will be used instead.

Note
  When Foxit PDF Conversion engine is set by function FoxitPDFSDKPython3.PDF2Office.Initialize , the ConvertCheckCallback will be not work, and it will use the internal ConvertCheckcallbacks to allow conversion.

Returns
  true means success, while false means failure.

## ◆ StartConvertToExcel() [1/2]

FoxitPDFSDKPython3.PDF2Office.StartConvertToExcel | ( |  | src_pdf_path,
|  |  | src_pdf_password,
|  |  | saved_excel_file_path,
|  |  | setting_data,
|  |  | convert_callback
| ) |  |
| static

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

Currently only support converting to XLSX format file.

Parameters

  [in] | src_pdf_path | Path of a PDF file. This should not be an empty string.
  [in] | src_pdf_password | Password for the input PDF file. If no password is needed for the file, please pass an empty string.
  [in] | saved_excel_file_path | Path 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_data | Setting data used for converting.If the parameter page_range of PDF2OfficeSettingData object is empty, that means convert each page of the PDF file to Excel format file.
  [in] | convert_callback | A FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.ConvertCallback object implemented by user. Default value: null.

Returns
  A progressive object. Please check the rate of current progress by function FoxitPDFSDKPython3.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function FoxitPDFSDKPython3.Progressive.Continue to continue the progress until the progress is finished.

Note
  When Foxit PDF Conversion engine is set by function FoxitPDFSDKPython3.PDF2Office.Initialize , the ConvertCallback will be not work.

## ◆ StartConvertToExcel() [2/2]

FoxitPDFSDKPython3.PDF2Office.StartConvertToExcel | ( |  | src_pdf_reader,
|  |  | src_pdf_password,
|  |  | saved_excel_file_stream,
|  |  | setting_data,
|  |  | convert_callback
| ) |  |
| static

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

Currently only support converting to XLSX format file.

Parameters

  [in] | src_pdf_reader | A FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
  [in] | src_pdf_password | Password for the input PDF file. If no password is needed for the file, please pass an empty string.
  [in] | saved_excel_file_stream | A FoxitPDFSDKPython3.StreamCallback object which is implemented by user to read the contents of the converted Excel format file. It should not be null.
  [in] | setting_data | Setting data used for converting.If the parameter page_range of PDF2OfficeSettingData object is empty, that means convert each page of the PDF file to Excel format file.
  [in] | convert_callback | A FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.ConvertCallback object implemented by user. Default value: null.

Returns
  A progressive object. Please check the rate of current progress by function FoxitPDFSDKPython3.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function FoxitPDFSDKPython3.Progressive.Continue to continue the progress until the progress is finished.

Note
  When Foxit PDF Conversion engine is set by function FoxitPDFSDKPython3.PDF2Office.Initialize , the ConvertCallback will be not work.

## ◆ StartConvertToPowerPoint() [1/2]

FoxitPDFSDKPython3.PDF2Office.StartConvertToPowerPoint | ( |  | src_pdf_path,
|  |  | src_pdf_password,
|  |  | saved_ppt_file_path,
|  |  | setting_data,
|  |  | convert_callback
| ) |  |
| static

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

Currently only support converting to PPTX format file.

Parameters

  [in] | src_pdf_path | Path of a PDF file. This should not be an empty string.
  [in] | src_pdf_password | Password for the input PDF file. If no password is needed for the file, please pass an empty string.
  [in] | saved_ppt_file_path | Path 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_data | Setting data used for converting.If the parameter page_range of PDF2OfficeSettingData object is empty, that means convert each page of the PDF file to Power Point format file.
  [in] | convert_callback | A FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.ConvertCallback object implemented by user. Default value: null.

Returns
  A progressive object. Please check the rate of current progress by function FoxitPDFSDKPython3.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function FoxitPDFSDKPython3.Progressive.Continue to continue the progress until the progress is finished.

Note
  When Foxit PDF Conversion engine is set by function FoxitPDFSDKPython3.PDF2Office.Initialize , the ConvertCallback will be not work.

## ◆ StartConvertToPowerPoint() [2/2]

FoxitPDFSDKPython3.PDF2Office.StartConvertToPowerPoint | ( |  | src_pdf_reader,
|  |  | src_pdf_password,
|  |  | saved_ppt_file_stream,
|  |  | setting_data,
|  |  | convert_callback
| ) |  |
| static

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

Currently only support converting to PPTX format file.

Parameters

  [in] | src_pdf_reader | A FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
  [in] | src_pdf_password | Password for the input PDF file. If no password is needed for the file, please pass an empty string.
  [in] | saved_ppt_file_stream | A FoxitPDFSDKPython3.StreamCallback object which is implemented by user to read the contents of the converted PowerPoint format file. It should not be null.
  [in] | setting_data | Setting data used for converting.If the parameter page_range of PDF2OfficeSettingData object is empty, that means convert each page of the PDF file to Power Point format file.
  [in] | convert_callback | A FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.ConvertCallback object implemented by user. Default value: null.

Returns
  A progressive object. Please check the rate of current progress by function FoxitPDFSDKPython3.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function FoxitPDFSDKPython3.Progressive.Continue to continue the progress until the progress is finished.

Note
  When Foxit PDF Conversion engine is set by function FoxitPDFSDKPython3.PDF2Office.Initialize , the ConvertCallback will be not work.

## ◆ StartConvertToWord() [1/2]

FoxitPDFSDKPython3.PDF2Office.StartConvertToWord | ( |  | src_pdf_path,
|  |  | src_pdf_password,
|  |  | saved_word_file_path,
|  |  | setting_data,
|  |  | convert_callback
| ) |  |
| static

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

Currently only support converting to DOCX format file.

Parameters

  [in] | src_pdf_path | Path of a PDF file. This should not be an empty string.
  [in] | src_pdf_password | Password for the input PDF file. If no password is needed for the file, please pass an empty string.
  [in] | saved_word_file_path | Path 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_data | Setting data used for converting.If the parameter page_range of PDF2OfficeSettingData object is empty, that means convert each page of the PDF file to Word format file.
  [in] | convert_callback | A FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.ConvertCallback object implemented by user. Default value: null.

Returns
  A progressive object. Please check the rate of current progress by function FoxitPDFSDKPython3.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function FoxitPDFSDKPython3.Progressive.Continue to continue the progress until the progress is finished.

Note
  When Foxit PDF Conversion engine is set by function FoxitPDFSDKPython3.PDF2Office.Initialize , the ConvertCallback will be not work.

## ◆ StartConvertToWord() [2/2]

FoxitPDFSDKPython3.PDF2Office.StartConvertToWord | ( |  | src_pdf_reader,
|  |  | src_pdf_password,
|  |  | saved_word_file_stream,
|  |  | setting_data,
|  |  | convert_callback
| ) |  |
| static

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

Currently only support converting to DOCX format file.

Parameters

  [in] | src_pdf_reader | A FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
  [in] | src_pdf_password | Password for the input PDF file. If no password is needed for the file, please pass an empty string.
  [in] | saved_word_file_stream | A FoxitPDFSDKPython3.StreamCallback object which is implemented by user to read the contents of the converted Word format file. It should not be null.
  [in] | setting_data | Setting data used for converting.If the parameter page_range of PDF2OfficeSettingData object is empty, that means convert each page of the PDF file to Word format file.
  [in] | convert_callback | A FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.ConvertCallback object implemented by user. Default value: null.

Returns
  A progressive object. Please check the rate of current progress by function FoxitPDFSDKPython3.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function FoxitPDFSDKPython3.Progressive.Continue to continue the progress until the progress is finished.

Note
  When Foxit PDF Conversion engine is set by function FoxitPDFSDKPython3.PDF2Office.Initialize , the ConvertCallback will be not work.