Foxit PDF Conversion SDK

Public Member Functions | Static Public Member Functions | List of all members
com.foxit.sdk.conversion.pdf2office.PDF2Office Class Reference
Inheritance diagram for com.foxit.sdk.conversion.pdf2office.PDF2Office:

## Public Member Functions
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
Public Member Functions inherited from com.foxit.sdk.common.Base
synchronized void | delete ()
| Clean up related C++ resources immediately. More...

## Static Public Member Functions
static Progressive | startConvertToExcel (String src_pdf_path, String src_pdf_password, String saved_excel_file_path, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback) throws com.foxit.sdk.PDFException
| Start to convert a PDF file to a Excel format file. More...
static Progressive | startConvertToExcel (FileReaderCallback src_pdf_reader, String src_pdf_password, StreamCallback saved_excel_file_stream, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback) throws com.foxit.sdk.PDFException
| Start to convert a PDF file to a Excel format file. More...
static Progressive | startConvertToPowerPoint (String src_pdf_path, String src_pdf_password, String saved_ppt_file_path, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback) throws com.foxit.sdk.PDFException
| Start to convert a PDF file to a PowerPoint format file. More...
static Progressive | startConvertToPowerPoint (FileReaderCallback src_pdf_reader, String src_pdf_password, StreamCallback saved_ppt_file_stream, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback) throws com.foxit.sdk.PDFException
| Start to convert a PDF file to a PowerPoint format file. More...
static Progressive | startConvertToWord (String src_pdf_path, String src_pdf_password, String saved_word_file_path, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback) throws com.foxit.sdk.PDFException
| Start to convert a PDF file to a Word format file. More...
static Progressive | startConvertToWord (FileReaderCallback src_pdf_reader, String src_pdf_password, StreamCallback saved_word_file_stream, PDF2OfficeSettingData setting_data, ConvertCallback convert_callback) throws com.foxit.sdk.PDFException
| Start to convert a PDF file to a Word format file. 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
  com.foxit.sdk.common.Library

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.conversion.pdf2office.PDF2Office.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ startConvertToExcel() [1/2]

static Progressive com.foxit.sdk.conversion.pdf2office.PDF2Office.startConvertToExcel | ( | String | src_pdf_path,
|  | String | src_pdf_password,
|  | String | saved_excel_file_path,
|  | PDF2OfficeSettingData | setting_data,
|  | ConvertCallback | convert_callback
| ) |  | throws com.foxit.sdk.PDFException
| static

Start to convert a PDF file to a Excel format file.

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 Word format file.
  [in] | convert_callback | A com.foxit.sdk.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 com.foxit.sdk.conversion.pdf2office.ConvertCallback object implemented by user. Default value: null.

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.resume to continue the progress until the progress is finished.

Note
  If module "PDF2Office" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using this function and this function will throw exception com.foxit.sdk.common.Constants.e_ErrNoPDF2OfficeModuleRight .

## ◆ startConvertToExcel() [2/2]

static Progressive com.foxit.sdk.conversion.pdf2office.PDF2Office.startConvertToExcel | ( | FileReaderCallback | src_pdf_reader,
|  | String | src_pdf_password,
|  | StreamCallback | saved_excel_file_stream,
|  | PDF2OfficeSettingData | setting_data,
|  | ConvertCallback | convert_callback
| ) |  | throws com.foxit.sdk.PDFException
| static

Start to convert a PDF file to a Excel format file.

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 com.foxit.sdk.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_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 com.foxit.sdk.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 com.foxit.sdk.conversion.pdf2office.ConvertCallback object implemented by user. Default value: null.

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.resume to continue the progress until the progress is finished.

Note
  If module "PDF2Office" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using this function and this function will throw exception com.foxit.sdk.common.Constants.e_ErrNoPDF2OfficeModuleRight .

## ◆ startConvertToPowerPoint() [1/2]

static Progressive com.foxit.sdk.conversion.pdf2office.PDF2Office.startConvertToPowerPoint | ( | String | src_pdf_path,
|  | String | src_pdf_password,
|  | String | saved_ppt_file_path,
|  | PDF2OfficeSettingData | setting_data,
|  | ConvertCallback | convert_callback
| ) |  | throws com.foxit.sdk.PDFException
| static

Start to convert a PDF file to a PowerPoint format file.

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 Word format file.
  [in] | convert_callback | A com.foxit.sdk.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 com.foxit.sdk.conversion.pdf2office.ConvertCallback object implemented by user. Default value: null.

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.resume to continue the progress until the progress is finished.

Note
  If module "PDF2Office" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using this function and this function will throw exception com.foxit.sdk.common.Constants.e_ErrNoPDF2OfficeModuleRight .

## ◆ startConvertToPowerPoint() [2/2]

static Progressive com.foxit.sdk.conversion.pdf2office.PDF2Office.startConvertToPowerPoint | ( | FileReaderCallback | src_pdf_reader,
|  | String | src_pdf_password,
|  | StreamCallback | saved_ppt_file_stream,
|  | PDF2OfficeSettingData | setting_data,
|  | ConvertCallback | convert_callback
| ) |  | throws com.foxit.sdk.PDFException
| static

Start to convert a PDF file to a PowerPoint format file.

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 com.foxit.sdk.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_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 com.foxit.sdk.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 com.foxit.sdk.conversion.pdf2office.ConvertCallback object implemented by user. Default value: null.

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.resume to continue the progress until the progress is finished.

Note
  If module "PDF2Office" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using this function and this function will throw exception com.foxit.sdk.common.Constants.e_ErrNoPDF2OfficeModuleRight .

## ◆ startConvertToWord() [1/2]

static Progressive com.foxit.sdk.conversion.pdf2office.PDF2Office.startConvertToWord | ( | String | src_pdf_path,
|  | String | src_pdf_password,
|  | String | saved_word_file_path,
|  | PDF2OfficeSettingData | setting_data,
|  | ConvertCallback | convert_callback
| ) |  | throws com.foxit.sdk.PDFException
| static

Start to convert a PDF file to a Word format file.

Currently only support converting to DOCX format file. This function supports the identification of headings in PDF documents and converts them into Word documents. Currently, the headings conversion is still in beta and will be further improved in subsequent versions.

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 com.foxit.sdk.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 com.foxit.sdk.conversion.pdf2office.ConvertCallback object implemented by user. Default value: null.

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.resume to continue the progress until the progress is finished.

Note
  If module "PDF2Office" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using this function and this function will throw exception com.foxit.sdk.common.Constants.e_ErrNoPDF2OfficeModuleRight .

## ◆ startConvertToWord() [2/2]

static Progressive com.foxit.sdk.conversion.pdf2office.PDF2Office.startConvertToWord | ( | FileReaderCallback | src_pdf_reader,
|  | String | src_pdf_password,
|  | StreamCallback | saved_word_file_stream,
|  | PDF2OfficeSettingData | setting_data,
|  | ConvertCallback | convert_callback
| ) |  | throws com.foxit.sdk.PDFException
| static

Start to convert a PDF file to a Word format file.

Currently only support converting to DOCX format file. This function supports the identification of headings in PDF documents and converts them into Word documents. Currently, the headings conversion is still in beta and will be further improved in subsequent versions.

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 com.foxit.sdk.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_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 com.foxit.sdk.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 com.foxit.sdk.conversion.pdf2office.ConvertCallback object implemented by user. Default value: null.

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.resume to continue the progress until the progress is finished..

Note
  If module "PDF2Office" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using this function and this function will throw exception com.foxit.sdk.common.Constants.e_ErrNoPDF2OfficeModuleRight .