Foxit PDF Conversion SDK

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

## 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 boolean | convertFromExcel (String src_excel_file_path, String src_file_password, String saved_pdf_path, Office2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
| Convert an Excel format file to a PDF file. More...
static boolean | convertFromExcel (FileReaderCallback src_excel_reader, String src_file_password, StreamCallback saved_pdf_file_stream, Office2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
| Convert an Excel format file to a PDF file. More...
static boolean | convertFromPowerPoint (String src_ppt_file_path, String src_file_password, String saved_pdf_path, Office2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
| Convert a PowerPoint format file to a PDF file. More...
static boolean | convertFromPowerPoint (FileReaderCallback src_ppt_reader, String src_file_password, StreamCallback saved_pdf_file_stream, Office2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
| Convert a PowerPoint format file to a PDF file. More...
static boolean | convertFromWord (String src_word_file_path, String src_file_password, String saved_pdf_path, Office2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
| Convert a Word format file to a PDF file. More...
static boolean | convertFromWord (FileReaderCallback src_word_reader, String src_file_password, StreamCallback saved_pdf_file_stream, Office2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
| Convert a Word format file to a PDF file. More...

## Detailed Description

This class can be used to convert Office(Word, Excel or PowerPoint) format files to PDF files. 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 "Office2PDF" module.

See also
  com.foxit.sdk.common.Library

## Member Function Documentation

## ◆ convertFromExcel() [1/2]

static boolean com.foxit.sdk.conversion.office2pdf.Office2PDF.convertFromExcel | ( | String | src_excel_file_path,
|  | String | src_file_password,
|  | String | saved_pdf_path,
|  | Office2PDFSettingData | setting_data
| ) |  | throws com.foxit.sdk.PDFException
| static

Convert an Excel format file to a PDF file.

Currently,this function is only available for Windows and Linux Desktop (32-bit and 64-bit), and it supports conversion only from XLSX format files.

Parameters

  [in] | src_excel_file_path | Path of an Excel format file. This should not be an empty string.
  [in] | src_file_password | (Reserved,encrypted files are unsupported yet)Password for the input Excel format file. If no password is needed for the file, please pass an empty string.
  [in] | saved_pdf_path | Path of the saved PDF file as conversion result. This should not be an empty string.
  [in] | setting_data | A com.foxit.sdk.conversion.office2pdf.Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

Note
  If module "Office2PDF" 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_ErrNoOffice2PDFModuleRight .

## ◆ convertFromExcel() [2/2]

static boolean com.foxit.sdk.conversion.office2pdf.Office2PDF.convertFromExcel | ( | FileReaderCallback | src_excel_reader,
|  | String | src_file_password,
|  | StreamCallback | saved_pdf_file_stream,
|  | Office2PDFSettingData | setting_data
| ) |  | throws com.foxit.sdk.PDFException
| static

Convert an Excel format file to a PDF file.

Currently,this function is only available for Windows and Linux Desktop (32-bit and 64-bit), and it supports conversion only from XLSX format files. The file is read all at once, rather than progressively.

Parameters

  [in] | src_excel_reader | A FileReaderCallback object which is implemented by user to load an excel document. It should not be null.
  [in] | src_file_password | (Reserved,encrypted files are unsupported yet)Password for the input Word format file. If no password is needed for the file, please pass an empty string.
  [in] | saved_pdf_file_stream | A com.foxit.sdk.common.fxcrt.StreamCallback object which is implemented by user to read the contents of the converted PDF file. It should not be null.
  [in] | setting_data | A com.foxit.sdk.conversion.office2pdf.Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

Note
  If module "Office2PDF" 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_ErrNoOffice2PDFModuleRight .

## ◆ convertFromPowerPoint() [1/2]

static boolean com.foxit.sdk.conversion.office2pdf.Office2PDF.convertFromPowerPoint | ( | String | src_ppt_file_path,
|  | String | src_file_password,
|  | String | saved_pdf_path,
|  | Office2PDFSettingData | setting_data
| ) |  | throws com.foxit.sdk.PDFException
| static

Convert a PowerPoint format file to a PDF file.

Currently,this function is only available for Windows and Linux Desktop (32-bit and 64-bit), and it supports conversion only from PPTX format files.

Parameters

  [in] | src_ppt_file_path | Path of a PowerPoint format file. This should not be an empty string.
  [in] | src_file_password | (Reserved,encrypted files are unsupported yet)Password for the input Excel format file. If no password is needed for the file, please pass an empty string.
  [in] | saved_pdf_path | Path of the saved PDF file as conversion result. This should not be an empty string.
  [in] | setting_data | A com.foxit.sdk.conversion.office2pdf.Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

Note
  If module "Office2PDF" 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_ErrNoOffice2PDFModuleRight .

## ◆ convertFromPowerPoint() [2/2]

static boolean com.foxit.sdk.conversion.office2pdf.Office2PDF.convertFromPowerPoint | ( | FileReaderCallback | src_ppt_reader,
|  | String | src_file_password,
|  | StreamCallback | saved_pdf_file_stream,
|  | Office2PDFSettingData | setting_data
| ) |  | throws com.foxit.sdk.PDFException
| static

Convert a PowerPoint format file to a PDF file.

Currently,this function is only available for Windows and Linux Desktop (32-bit and 64-bit), and it supports conversion only from PPTX format files. The file is read all at once, rather than progressively.

Parameters

  [in] | src_ppt_reader | A FileReaderCallback object which is implemented by user to load a ppt document. It should not be null.
  [in] | src_file_password | (Reserved,encrypted files are unsupported yet)Password for the input Word format file. If no password is needed for the file, please pass an empty string.
  [in] | saved_pdf_file_stream | A com.foxit.sdk.common.fxcrt.StreamCallback object which is implemented by user to read the contents of the converted PDF file. It should not be null.
  [in] | setting_data | A com.foxit.sdk.conversion.office2pdf.Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

Note
  If module "Office2PDF" 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_ErrNoOffice2PDFModuleRight .

## ◆ convertFromWord() [1/2]

static boolean com.foxit.sdk.conversion.office2pdf.Office2PDF.convertFromWord | ( | String | src_word_file_path,
|  | String | src_file_password,
|  | String | saved_pdf_path,
|  | Office2PDFSettingData | setting_data
| ) |  | throws com.foxit.sdk.PDFException
| static

Convert a Word format file to a PDF file.

Currently,this function is only available for Windows and Linux Desktop (32-bit and 64-bit), and it supports conversion only from DOC and DOCX format files.

Parameters

  [in] | src_word_file_path | Path of a Word format file. This should not be an empty string.
  [in] | src_file_password | (Reserved,encrypted files are unsupported yet)Password for the input Word format file. If no password is needed for the file, please pass an empty string.
  [in] | saved_pdf_path | Path of the saved PDF file as conversion result. This should not be an empty string.
  [in] | setting_data | A com.foxit.sdk.conversion.office2pdf.Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

Note
  If module "Office2PDF" 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_ErrNoOffice2PDFModuleRight .

## ◆ convertFromWord() [2/2]

static boolean com.foxit.sdk.conversion.office2pdf.Office2PDF.convertFromWord | ( | FileReaderCallback | src_word_reader,
|  | String | src_file_password,
|  | StreamCallback | saved_pdf_file_stream,
|  | Office2PDFSettingData | setting_data
| ) |  | throws com.foxit.sdk.PDFException
| static

Convert a Word format file to a PDF file.

Currently,this function is only available for Windows and Linux Desktop (32-bit and 64-bit), and it supports conversion only from DOC and DOCX format files. The file is read all at once, rather than progressively.

Parameters

  [in] | src_word_reader | A FileReaderCallback object which is implemented by user to load a word document. It should not be null.
  [in] | src_file_password | (Reserved,encrypted files are unsupported yet)Password for the input Word format file. If no password is needed for the file, please pass an empty string.
  [in] | saved_pdf_file_stream | A com.foxit.sdk.common.fxcrt.StreamCallback object which is implemented by user to read the contents of the converted PDF file. It should not be null.
  [in] | setting_data | A com.foxit.sdk.conversion.office2pdf.Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

Note
  If module "Office2PDF" 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_ErrNoOffice2PDFModuleRight .

## ◆ delete()

synchronized void com.foxit.sdk.conversion.office2pdf.Office2PDF.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

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