Foxit PDF SDK
com.foxit.sdk.addon.conversion.Convert Class Reference
Inheritance diagram for com.foxit.sdk.addon.conversion.Convert:
com.foxit.sdk.common.Base

Public Member Functions

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

Static Public Member Functions

static void fromExcel (String src_excel_file_path, String src_file_password, String saved_pdf_path, Excel2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
 Convert a Excel format file to a PDF file. More...
 
static void fromHTML (String src_html, String engine_path, String cookies_path, HTML2PDFSettingData setting_data, String saved_pdf_path, int timeout) throws com.foxit.sdk.PDFException
 Convert a HTML format file or a URL of a Web page to a PDF file. More...
 
static void fromHTML (String src_html, String engine_path, FileReaderCallback cookies_reader, HTML2PDFSettingData setting_data, String saved_pdf_path, int timeout) throws com.foxit.sdk.PDFException
 Convert a HTML format file or a URL of a Web page to a PDF file. More...
 
static void fromPowerPoint (String src_ppt_file_path, String src_file_password, String saved_pdf_path, PowerPoint2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
 Convert a PowerPoint format file to a PDF file. More...
 
static void fromTXT (String src_txt, String saved_pdf_path, TXT2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
 Convert a TXT format file to a PDF file. More...
 
static void fromWord (String src_word_file_path, String src_file_password, String saved_pdf_path, Word2PDFSettingData setting_data) throws com.foxit.sdk.PDFException
 Convert a Word format file to a PDF file. More...
 

Detailed Description

Conversion add-on module can be used to do some conversion between PDF file and other file formats. Before using "Conversion" module, user should first prepare font resource folder as described in "Foxit PDF SDK Developer Guide.pdf" document. Before using any class or methods in this module, please ensure Foxit PDF SDK has been initialized successfully by function common.Library.initialize with a key including "Conversion" module.

See also
com.foxit.sdk.common.Library

Member Function Documentation

◆ delete()

synchronized void com.foxit.sdk.addon.conversion.Convert.delete ( )

Clean up related resources immediately.

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

◆ fromExcel()

static void com.foxit.sdk.addon.conversion.Convert.fromExcel ( String  src_excel_file_path,
String  src_file_password,
String  saved_pdf_path,
Excel2PDFSettingData  setting_data 
) throws com.foxit.sdk.PDFException
static

Convert a Excel format file to a PDF file.

Currently, this function can only be used for Windows.

Parameters
[in]src_excel_file_pathPath of a Excel format file. This should not be an empty string.
[in]src_file_passwordPassword for the input Excel format file. If no password is needed for the file, please pass an empty string.
[in]saved_pdf_pathPath of the saved PDF file as conversion result. This should not be an empty string.
[in]setting_dataSetting data used for converting.
Returns
None.

◆ fromHTML() [1/2]

static void com.foxit.sdk.addon.conversion.Convert.fromHTML ( String  src_html,
String  engine_path,
String  cookies_path,
HTML2PDFSettingData  setting_data,
String  saved_pdf_path,
int  timeout 
) throws com.foxit.sdk.PDFException
static

Convert a HTML format file or a URL of a Web page to a PDF file.

Currently, this function can only be used for desktop platforms; for other platform, this function will return directly without doing anything.

Parameters
[in]src_htmlA URL of Web page or a HTML format file path. This should not be an empty string.
[in]engine_pathThe directory path of "HTML to PDF" engine. This should not be an empty string.
[in]cookies_pathPath of cookies file. If this is an empty string, that means no cookie file is used. Data format is strongly recommended to use JSON format. Currently, this parameter is not supported to be used in MAC OS.
[in]setting_dataSetting data used for converting.
[in]saved_pdf_pathA path for saving the converted PDF file. This should not be an empty string.
[in]timeoutSeconds for timeout used for loading webpages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.
Returns
None.

◆ fromHTML() [2/2]

static void com.foxit.sdk.addon.conversion.Convert.fromHTML ( String  src_html,
String  engine_path,
FileReaderCallback  cookies_reader,
HTML2PDFSettingData  setting_data,
String  saved_pdf_path,
int  timeout 
) throws com.foxit.sdk.PDFException
static

Convert a HTML format file or a URL of a Web page to a PDF file.

Currently, this function can only be used for desktop platforms; for other platform, this function will return directly without doing anything.

Parameters
[in]src_htmlA URL of Web page or a HTML format file path. This should not be an empty string.
[in]engine_pathThe directory path of "HTML to PDF" engine. This should not be an empty string.
[in]cookies_readerA com.foxit.sdk.common.fxcrt.FileReaderCallback object which is implemented by user to pass cookies data to Foxit PDF SDK. If this is null, that means no cookie data is used. Data format is strongly recommended to use JSON format. Currently, this parameter is not supported to be used in MAC OS.
[in]setting_dataSetting data used for converting.
[in]saved_pdf_pathA path for saving the converted PDF file. This should not be an empty string.
[in]timeoutSeconds for timeout used for loading webpages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.
Returns
None.

◆ fromPowerPoint()

static void com.foxit.sdk.addon.conversion.Convert.fromPowerPoint ( String  src_ppt_file_path,
String  src_file_password,
String  saved_pdf_path,
PowerPoint2PDFSettingData  setting_data 
) throws com.foxit.sdk.PDFException
static

Convert a PowerPoint format file to a PDF file.

Currently, this function can only be used for Windows.

Parameters
[in]src_ppt_file_pathPath of a PowerPoint format file. This should not be an empty string.
[in]src_file_passwordPassword for the input Excel format file. If no password is needed for the file, please pass an empty string.
[in]saved_pdf_pathPath of the saved PDF file as conversion result. This should not be an empty string.
[in]setting_dataSetting data used for converting.
Returns
None.

◆ fromTXT()

static void com.foxit.sdk.addon.conversion.Convert.fromTXT ( String  src_txt,
String  saved_pdf_path,
TXT2PDFSettingData  setting_data 
) throws com.foxit.sdk.PDFException
static

Convert a TXT format file to a PDF file.

Parameters
[in]src_txtA TXT format file path. This should not be an empty string.
[in]saved_pdf_pathA path for saving the converted PDF file. This should not be an empty string.
[in]setting_dataSetting data used for converting.
Returns
None.

◆ fromWord()

static void com.foxit.sdk.addon.conversion.Convert.fromWord ( String  src_word_file_path,
String  src_file_password,
String  saved_pdf_path,
Word2PDFSettingData  setting_data 
) throws com.foxit.sdk.PDFException
static

Convert a Word format file to a PDF file.

Currently, this function can only be used for Windows.

Parameters
[in]src_word_file_pathPath of a Word format file. This should not be an empty string.
[in]src_file_passwordPassword for the input Word format file. If no password is needed for the file, please pass an empty string.
[in]saved_pdf_pathPath of the saved PDF file as conversion result. This should not be an empty string.
[in]setting_dataSetting data used for converting.
Returns
None.