Foxit PDF SDK

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

## Static Public Member Functions
static bool | ConvertFromExcel (const wchar_t *src_excel_file_path, const wchar_t *src_file_password, const wchar_t *saved_pdf_path, const Office2PDFSettingData &setting_data)
| Convert an Excel format file to a PDF file. More...
static bool | ConvertFromExcel (common::file::ReaderCallback *src_excel_reader, const wchar_t *src_file_password, common::file::StreamCallback *saved_pdf_file_stream, const Office2PDFSettingData &setting_data)
| Convert an Excel format file to a PDF file. More...
static bool | ConvertFromPowerPoint (const wchar_t *src_ppt_file_path, const wchar_t *src_file_password, const wchar_t *saved_pdf_path, const Office2PDFSettingData &setting_data)
| Convert a PowerPoint format file to a PDF file. More...
static bool | ConvertFromPowerPoint (common::file::ReaderCallback *src_ppt_reader, const wchar_t *src_file_password, common::file::StreamCallback *saved_pdf_file_stream, const Office2PDFSettingData &setting_data)
| Convert a PowerPoint format file to a PDF file. More...
static bool | ConvertFromWord (const wchar_t *src_word_file_path, const wchar_t *src_file_password, const wchar_t *saved_pdf_path, const Office2PDFSettingData &setting_data)
| Convert a Word format file to a PDF file. More...
static bool | ConvertFromWord (common::file::ReaderCallback *src_word_reader, const wchar_t *src_file_password, common::file::StreamCallback *saved_pdf_file_stream, const Office2PDFSettingData &setting_data)
| Convert a Word format file to a PDF file. More...
static String | GetVersion ()
| Get the version of Foxit PDF Conversion SDK. More...
static void | Initialize (const wchar_t *library_path)
| Initialize Foxit PDF Conversion. More...
static void | Release ()
| Release all resource allocated by Foxit PDF Conversion. More...

## Additional Inherited Members
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. More...

## Detailed Description

This class can be used to convert Office(Word, Excel or PowerPoint) format files to PDF files. This feature is a self-developed product by Foxit and does not rely on other third-party engines. 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 common::Library::Initialize with a key including "Office2PDF" module.

See also
  common::Library

## Member Function Documentation

## ◆ ConvertFromExcel() [1/2]

static bool foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromExcel | ( | const wchar_t * | src_excel_file_path,
|  | const wchar_t * | src_file_password,
|  | const wchar_t * | saved_pdf_path,
|  | const Office2PDFSettingData & | setting_data
| ) |  |
| static

Convert an Excel format file to a PDF file.

Currently,this function is only available for Windows and Linux (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 conversion::office2pdf::Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

## ◆ ConvertFromExcel() [2/2]

static bool foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromExcel | ( | common::file::ReaderCallback * | src_excel_reader,
|  | const wchar_t * | src_file_password,
|  | common::file::StreamCallback * | saved_pdf_file_stream,
|  | const Office2PDFSettingData & | setting_data
| ) |  |
| static

Convert an Excel format file to a PDF file.

Currently,this function is only available for Windows and Linux (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 ReaderCallback 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 Excel format file. If no password is needed for the file, please pass an empty string.
  [in] | saved_pdf_file_stream | A foxit::common::file::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 conversion::office2pdf::Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

## ◆ ConvertFromPowerPoint() [1/2]

static bool foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromPowerPoint | ( | const wchar_t * | src_ppt_file_path,
|  | const wchar_t * | src_file_password,
|  | const wchar_t * | saved_pdf_path,
|  | const Office2PDFSettingData & | setting_data
| ) |  |
| static

Convert a PowerPoint format file to a PDF file.

Currently,this function is only available for Windows and Linux (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 PowerPoint 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 conversion::office2pdf::Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

## ◆ ConvertFromPowerPoint() [2/2]

static bool foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromPowerPoint | ( | common::file::ReaderCallback * | src_ppt_reader,
|  | const wchar_t * | src_file_password,
|  | common::file::StreamCallback * | saved_pdf_file_stream,
|  | const Office2PDFSettingData & | setting_data
| ) |  |
| static

Convert a PowerPoint format file to a PDF file.

Currently,this function is only available for Windows and Linux (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 ReaderCallback object which is implemented by user to load a PowerPoint document. It should not be NULL.
  [in] | src_file_password | (Reserved,encrypted files are unsupported yet)Password for the input PowerPoint format file. If no password is needed for the file, please pass an empty string.
  [in] | saved_pdf_file_stream | A foxit::common::file::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 conversion::office2pdf::Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

## ◆ ConvertFromWord() [1/2]

static bool foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromWord | ( | const wchar_t * | src_word_file_path,
|  | const wchar_t * | src_file_password,
|  | const wchar_t * | saved_pdf_path,
|  | const Office2PDFSettingData & | setting_data
| ) |  |
| static

Convert a Word format file to a PDF file.

Currently,this function is only available for Windows and Linux (32 bit and 64 bit), and it supports conversion from DOCX/DOC 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 conversion::office2pdf::Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

## ◆ ConvertFromWord() [2/2]

static bool foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromWord | ( | common::file::ReaderCallback * | src_word_reader,
|  | const wchar_t * | src_file_password,
|  | common::file::StreamCallback * | saved_pdf_file_stream,
|  | const Office2PDFSettingData & | setting_data
| ) |  |
| static

Convert a Word format file to a PDF file.

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

Parameters

  [in] | src_word_reader | A ReaderCallback 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 foxit::common::file::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 conversion::office2pdf::Office2PDFSettingData object which is used for converting.

Returns
  true means success, while false means failure.

## ◆ GetVersion()

static String foxit::addon::conversion::office2pdf::Office2PDF::GetVersion | ( |  | ) |
| static

Get the version of Foxit PDF Conversion SDK.

This function should be called after the function Office2PDF::Initialize has been called successfully.

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

## ◆ Initialize()

static void foxit::addon::conversion::office2pdf::Office2PDF::Initialize | ( | const wchar_t * | library_path | ) |
| static

Initialize Foxit PDF Conversion.

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

Parameters

  [in] | library_path | Path of Foxit PDF Conversion SDK library. This should not be an empty string.

Returns
  None.

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 Office2PDF related functions and this function will throw exception foxit::e_ErrNoOffice2PDFModuleRight.

## ◆ Release()

static void foxit::addon::conversion::office2pdf::Office2PDF::Release | ( |  | ) |
| static

Release all resource allocated by Foxit PDF Conversion.

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

Returns
  None.