Foxit PDF SDK
FoxitPDFSDKPython3.Convert Class Reference
Inheritance diagram for FoxitPDFSDKPython3.Convert:
FoxitPDFSDKPython3.Base

Static Public Attributes

 FromExcel = _fsdk.Convert_FromExcel
 Convert an Excel format file to a PDF file. More...
 
 FromHTML = _fsdk.Convert_FromHTML
 Convert a HTML format file or a URL of a Web page to a PDF file. More...
 
 FromPowerPoint = _fsdk.Convert_FromPowerPoint
 Convert a PowerPoint format file to a PDF file. More...
 
 FromTXT = _fsdk.Convert_FromTXT
 Convert a TXT format file to a PDF file. More...
 
 FromWord = _fsdk.Convert_FromWord
 Convert a Word format file to a PDF file. More...
 
 ToXML = _fsdk.Convert_ToXML
 Convert a PDF file to a XML format 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 FoxitPDFSDKPython3.Library.Initialize with a key including "Conversion" module.

See also
FoxitPDFSDKPython3.Library

Member Data Documentation

◆ FromExcel

FoxitPDFSDKPython3.Convert.FromExcel = _fsdk.Convert_FromExcel
static

Convert an 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

FoxitPDFSDKPython3.Convert.FromHTML = _fsdk.Convert_FromHTML
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.
[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 web pages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.
Returns
None.

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 FoxitPDFSDKPython3.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.
[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 web pages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.
Returns
None.

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 FoxitPDFSDKPython3.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.
[in]setting_dataSetting data used for converting.
[in]saved_pdf_filestreamA FoxitPDFSDKPython3.FileWriterCallback object for saving the converted PDF file. This should not be null.
[in]timeoutSeconds for timeout used for loading web pages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.
Returns
None.

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

Parameters
[in]src_htmlA FoxitPDFSDKPython3.FileReaderCallback object which is implemented by user to pass html data to Foxit PDF SDK. It must be vaild.
[in]html2pdf_related_resource_arrayThe HTML2PDFRelatedResourceArray which is related to source HTML.
[in]engine_pathThe directory path of "HTML to PDF" engine. This should not be an empty string.
[in]cookies_reader(Reserved;Not supported yet)A FoxitPDFSDKPython3.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.
[in]setting_dataSetting data used for converting.
[in]saved_pdf_filestreamA FoxitPDFSDKPython3.FileWriterCallback object for saving the converted PDF file. This should not be null.
[in]timeoutSeconds for timeout used for loading web pages. 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

FoxitPDFSDKPython3.Convert.FromPowerPoint = _fsdk.Convert_FromPowerPoint
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

FoxitPDFSDKPython3.Convert.FromTXT = _fsdk.Convert_FromTXT
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

FoxitPDFSDKPython3.Convert.FromWord = _fsdk.Convert_FromWord
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.

◆ ToXML

FoxitPDFSDKPython3.Convert.ToXML = _fsdk.Convert_ToXML
static

Convert a PDF file to a XML format file.

Parameters
[in]src_pdf_pathPath of a PDF file. This should not be an empty string.
[in]src_file_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_xml_pathPath of the saved XML format file as conversion result. This should not be an empty string.
[in]saved_image_folder_pathA path to specify a folder where image files will be generated during the converting. If this is an empty string, image files will be generated to a folder named "images" (if not exist, Foxit PDF SDK will generate such folder by default). Folder "images" would be in the same directory with saved XML format file (as parameter saved_xml_path).
[in]is_force_to_tagged_pdf(Only useful when input PDF file is not a tagged PDF file) A boolean value to decide whether input PDF file is allowed to be converted to a tagged PDF when input PDF file is not a tagged PDF:
  • true means input PDF file (which is not tagged PDF yet) will first be converted to a tagged PDF. Then the tagged PDF will be converted to a XML format file.

  • false means not allow to convert input PDF file (which is not tagged PDF yet) to a tagged PDF. In this case, input PDF file will not be converted to XML format file and this function will return false.

Returns
true means success, while false means failure.