Foxit PDF Conversion SDK
fpdfconversionsdk Namespace Reference

fpdfconversionsdk namespace. More...

Classes

class  Base
 
class  ConvertCallback
 
class  ConvertCheckCallback
 
class  Excel2PDFSettingData
 
class  Library
 
class  Office2PDF
 
class  Office2PDFSettingData
 
class  PDF2ExcelSettingData
 
class  PDF2Office
 
class  PDF2OfficeSettingData
 
class  PDF2PowerPointSettingData
 
class  PDF2WordSettingData
 
class  Progressive
 
class  Range
 
class  Word2PDFSettingData
 
class  WStringArray
 

Functions

def LibraryEnableThreadSafety ()
 Enable thread safety. More...
 
def LibraryGetVersion ()
 Get the version of current Foxit PDF Conversion SDK library. More...
 
def LibraryInitialize ()
 Initialize Foxit PDF Conversion SDK Library, with valid license information. More...
 
def LibraryReinitialize ()
 Re-initialize Foxit PDF Conversion SDK Library. More...
 
def LibraryRelease ()
 Release all resource allocated by Foxit PDF Conversion SDK Library. More...
 
def LibrarySetConvertCheckCallback ()
 Set the callback object to check the PDF to Office conversion conditions. More...
 
def Office2PDFConvertFromExcel ()
 Convert an Excel format file to a PDF file. More...
 
def Office2PDFConvertFromPowerPoint ()
 Convert a PowerPoint format file to a PDF file. More...
 
def Office2PDFConvertFromWord ()
 Convert a Word format file to a PDF file. More...
 
def PDF2OfficeStartConvertToExcel ()
 Start to convert a PDF file to a Excel format file. More...
 
def PDF2OfficeStartConvertToPowerPoint ()
 Start to convert a PDF file to a PowerPoint format file. More...
 
def PDF2OfficeStartConvertToWord ()
 Start to convert a PDF file to a Word format file. More...
 

Variables

 E_ErrCertificate
 Certificate error: PDF document is encrypted by digital certificate but current user does not have the correct certificate.
 
 E_ErrDataNotReady
 Data is not ready. Usually this is used as an exception error code when loading document in asynchronous way.
 
 E_ErrFile
 File cannot be found or could not be opened.
 
 E_ErrFormat
 Format is invalid. For files, this may also mean that file is corrupted.
 
 E_ErrHandle
 Error handle.
 
 E_ErrInvalidLicense
 Invalid license is used to initialize Foxit PDF Conversion SDK library.
 
 E_ErrInvalidType
 The type of input object or current object is invalid.
 
 E_ErrNoDocumentPermission
 No document permission to operate.
 
 E_ErrNoOffice2PDFModuleRight
 No "Office2PDF" module right.
 
 E_ErrNoPDF2OfficeModuleRight
 No "PDF2Office" module right.
 
 E_ErrNotFound
 Expected data or object is not found.
 
 E_ErrNotLoaded
 Current object has not been loaded yet.
 
 E_ErrNotParsed
 Content has not been parsed yet. Usually, this represents PDF page has not been parsed yet.
 
 E_ErrOutOfMemory
 Out-of-memory error occurs.
 
 E_ErrParam
 Parameter error: value of any input parameter for a function is invalid.
 
 E_ErrPassword
 Invalid password. Usually, this error may occur when loading a PDF document with password. When meet this, user should load document again with correct password.
 
 E_ErrSecurityHandler
 PDF document is encrypted by some unsupported security handler.
 
 E_ErrSuccess
 Success, and no error occurs.
 
 E_ErrUnknown
 Any unknown error occurs.
 
 E_ErrUnknownState
 Any unknown state occurs.
 
 E_ErrUnsupported
 Some types are not supported.
 
 E_PermAnnotForm
 Operate text annotations and fill in interactive form fields. (Bit 6 in permission value) More...
 
 E_PermAssemble
 Assemble PDF document. (Bit 11 in permission value) More...
 
 E_PermExtract
 Extract PDF contents. (Bit 5 in permission value) More...
 
 E_PermExtractAccess
 Disabilities support. (Bit 10 in permission value) More...
 
 E_PermFillForm
 Fill PDF form. (Bit 9 in permission value) More...
 
 E_PermModify
 Modify PDF contents. (Bit 4 in permission value) More...
 
 E_PermPrint
 Print PDF document with normal mode. (Bit 3 in permission value) More...
 
 E_PermPrintHigh
 Print PDF document with higher qualities. (Bit 12 in permission value) More...
 
 PDF2ExcelSettingDataE_WorkbookSettingsDocument
 Create single worksheet for the document.
 
 PDF2ExcelSettingDataE_WorkbookSettingsEachPage
 Create worksheet for each page.
 
 PDF2ExcelSettingDataE_WorkbookSettingsEachTable
 Create worksheet for each table.
 
 ProgressiveE_Error
 Progress state: any error occurs.
 
 ProgressiveE_Finished
 Progress state: progress is finished.
 
 ProgressiveE_ToBeContinued
 Progress state: progress needs to be continued.
 
 RangeE_All
 All the indexes within a range will be used.
 
 RangeE_Even
 Only even numbers in a range will be used (discards odd numbers).
 
 RangeE_Odd
 Only odd numbers in a range will be used (discards even numbers).
 

Detailed Description

fpdfconversionsdk namespace.

Function Documentation

◆ LibraryEnableThreadSafety()

def fpdfconversionsdk.LibraryEnableThreadSafety ( )

Enable thread safety.

Parameters
[in]is_enable_thread_safetyEnable thread safety.true means to enable thread safety, while false means to disable thread safety.
Returns
None.

◆ LibraryGetVersion()

def fpdfconversionsdk.LibraryGetVersion ( )

Get the version of current Foxit PDF Conversion SDK library.

Returns
Version string.

◆ LibraryInitialize()

def fpdfconversionsdk.LibraryInitialize ( )

Initialize Foxit PDF Conversion SDK Library, with valid license information.

During the life-cycle of an application, this function can only be called once and should be called first before any other functions in Foxit PDF Conversion SDK can be called.
Once function fpdfconversionsdk.LibraryRelease is called, Foxit PDF Conversion SDK library cannot be initialized any more in the life-cycle of the application.

Parameters
[in]snString of sn information, which can be retrieved from "SN=" part in key file "gsdk_sn.txt" or "rdk_sn.txt".
[in]keyString of key information, which can be retrieved from "Sign=" part in key file "gsdk_key.txt" or "rdk_key.txt".
Returns
fpdfconversionsdk.E_ErrSuccess means success.
fpdfconversionsdk.E_ErrInvalidLicense means input license information is invalid.
fpdfconversionsdk.E_ErrParam means parameter sn or key is an empty string.
For more information about error code values, please refer to values starting from fpdfconversionsdk.E_ErrSuccess .

◆ LibraryReinitialize()

def fpdfconversionsdk.LibraryReinitialize ( )

Re-initialize Foxit PDF Conversion SDK Library.

When user meets out-of-memory error or user wants to re-initialize Foxit PDF Conversion SDK library before function fpdfconversionsdk.LibraryRelease is called, user can call this function to re-initialize Foxit PDF Conversion SDK Library.
Once function fpdfconversionsdk.LibraryRelease is called, Foxit PDF Conversion SDK library cannot be initialized any more in the life-cycle of the application.

Returns
fpdfconversionsdk.E_ErrSuccess means success. For more information about error code values, please refer to values starting from fpdfconversionsdk.E_ErrSuccess .

◆ LibraryRelease()

def fpdfconversionsdk.LibraryRelease ( )

Release all resource allocated by Foxit PDF Conversion SDK Library.

User should call this function to release all memory blocks allocated by the library.
Once this fucntion is called, Foxit PDF Conversion SDK library cannot be initialized any more in the life-cycle of the application.

Returns
None.

◆ LibrarySetConvertCheckCallback()

def fpdfconversionsdk.LibrarySetConvertCheckCallback ( )

Set the callback object to check the PDF to Office conversion conditions.

This method allows you to specify a custom convert check callback that will be called to evaluate whether the conversion from PDF to Office should proceed, based on user-defined logic , when the required permissions for converting the PDF documents are not met.

Parameters
[in]convert_check_callbackA customized convert check callback which is implemented based on callback class fpdfconversionsdk.ConvertCheckCallback . If this is null, customized convert check callback will be removed and default convert check will be used instead.
Returns
true means success, while false means failure.

◆ Office2PDFConvertFromExcel()

def fpdfconversionsdk.Office2PDFConvertFromExcel ( )

Convert an Excel format file to a PDF file.

Currently,this function is only available for Windows, and it supports conversion only from XLSX format files.

Parameters
[in]src_excel_file_pathPath 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_pathPath of the saved PDF file as conversion result. This should not be an empty string.
[in]setting_dataA fpdfconversionsdk.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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoOffice2PDFModuleRight .

Currently,this function is only available for Windows, and it supports conversion only from XLSX format files. The file is read all at once, rather than progressively.

Parameters
[in]src_excel_readerA 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_streamA fsdk.StreamCallback object which is implemented by user to read the contents of the converted PDF file. It should not be null.
[in]setting_dataA fpdfconversionsdk.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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoOffice2PDFModuleRight .

◆ Office2PDFConvertFromPowerPoint()

def fpdfconversionsdk.Office2PDFConvertFromPowerPoint ( )

Convert a PowerPoint format file to a PDF file.

Currently,this function is only available for Windows, and it supports conversion only from PPTX format files.

Parameters
[in]src_ppt_file_pathPath 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_pathPath of the saved PDF file as conversion result. This should not be an empty string.
[in]setting_dataA fpdfconversionsdk.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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoOffice2PDFModuleRight .

Currently,this function is only available for Windows, and it supports conversion only from PPTX format files. The file is read all at once, rather than progressively.

Parameters
[in]src_ppt_readerA 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_streamA fsdk.StreamCallback object which is implemented by user to read the contents of the converted PDF file. It should not be null.
[in]setting_dataA fpdfconversionsdk.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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoOffice2PDFModuleRight .

◆ Office2PDFConvertFromWord()

def fpdfconversionsdk.Office2PDFConvertFromWord ( )

Convert a Word format file to a PDF file.

Currently,this function is only available for Windows, and it supports conversion only from DOCX format files.

Parameters
[in]src_word_file_pathPath 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_pathPath of the saved PDF file as conversion result. This should not be an empty string.
[in]setting_dataA fpdfconversionsdk.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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoOffice2PDFModuleRight .

Currently,this function is only available for Windows, and it supports conversion only from DOCX format files. The file is read all at once, rather than progressively.

Parameters
[in]src_word_readerA 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_streamA fsdk.StreamCallback object which is implemented by user to read the contents of the converted PDF file. It should not be null.
[in]setting_dataA fpdfconversionsdk.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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoOffice2PDFModuleRight .

◆ PDF2OfficeStartConvertToExcel()

def fpdfconversionsdk.PDF2OfficeStartConvertToExcel ( )

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

Currently only support converting to XLSX format file.

Parameters
[in]src_pdf_pathPath of a PDF file. This should not be an empty string.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_excel_file_pathPath 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_dataSetting 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_callbackA fpdfconversionsdk.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 fpdfconversionsdk.ConvertCallback object implemented by user.
Default value: null.
Returns
A progressive object. Please check the rate of current progress by function fpdfconversionsdk.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function fpdfconversionsdk.Progressive.Continue 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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoPDF2OfficeModuleRight .

Currently only support converting to XLSX format file.

Parameters
[in]src_pdf_readerA FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_excel_file_streamA fsdk.StreamCallback object which is implemented by user to read the contents of the converted Excel format file. It should not be null.
[in]setting_dataSetting 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_callbackA fpdfconversionsdk.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 fpdfconversionsdk.ConvertCallback object implemented by user.
Default value: null.
Returns
A progressive object. Please check the rate of current progress by function fpdfconversionsdk.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function fpdfconversionsdk.Progressive.Continue 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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoPDF2OfficeModuleRight .

◆ PDF2OfficeStartConvertToPowerPoint()

def fpdfconversionsdk.PDF2OfficeStartConvertToPowerPoint ( )

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

Currently only support converting to PPTX format file.

Parameters
[in]src_pdf_pathPath of a PDF file. This should not be an empty string.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_ppt_file_pathPath 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_dataSetting 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_callbackA fpdfconversionsdk.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 fpdfconversionsdk.ConvertCallback object implemented by user.
Default value: null.
Returns
A progressive object. Please check the rate of current progress by function fpdfconversionsdk.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function fpdfconversionsdk.Progressive.Continue 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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoPDF2OfficeModuleRight .

Currently only support converting to PPTX format file.

Parameters
[in]src_pdf_readerA FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_ppt_file_streamA fsdk.StreamCallback object which is implemented by user to read the contents of the converted PowerPoint format file. It should not be null.
[in]setting_dataSetting 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_callbackA fpdfconversionsdk.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 fpdfconversionsdk.ConvertCallback object implemented by user.
Default value: null.
Returns
A progressive object. Please check the rate of current progress by function fpdfconversionsdk.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function fpdfconversionsdk.Progressive.Continue 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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoPDF2OfficeModuleRight .

◆ PDF2OfficeStartConvertToWord()

def fpdfconversionsdk.PDF2OfficeStartConvertToWord ( )

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_pathPath of a PDF file. This should not be an empty string.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_word_file_pathPath 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_dataSetting 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_callbackA fpdfconversionsdk.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 fpdfconversionsdk.ConvertCallback object implemented by user.
Default value: null.
Returns
A progressive object. Please check the rate of current progress by function fpdfconversionsdk.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function fpdfconversionsdk.Progressive.Continue 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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoPDF2OfficeModuleRight .

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_readerA FileReaderCallback object which is implemented by user to load a PDF document. It should not be null.
[in]src_pdf_passwordPassword for the input PDF file. If no password is needed for the file, please pass an empty string.
[in]saved_word_file_streamA fsdk.StreamCallback object which is implemented by user to read the contents of the converted Word format file. It should not be null.
[in]setting_dataSetting 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_callbackA fpdfconversionsdk.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 fpdfconversionsdk.ConvertCallback object implemented by user.
Default value: null.
Returns
A progressive object. Please check the rate of current progress by function fpdfconversionsdk.Progressive.GetRateOfProgress . If the rate is not 100 yet, call function fpdfconversionsdk.Progressive.Continue 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 fpdfconversionsdk.LibraryInitialize , that means user has no right in using this function and this function will throw exception fpdfconversionsdk.E_ErrNoPDF2OfficeModuleRight .

Variable Documentation

◆ E_PermAnnotForm

fpdfconversionsdk.E_PermAnnotForm

Operate text annotations and fill in interactive form fields. (Bit 6 in permission value)

If value is also set, user can create or modify interactive form fields (including signature fields).

◆ E_PermAssemble

fpdfconversionsdk.E_PermAssemble

Assemble PDF document. (Bit 11 in permission value)

If this value is set, it enables to assemble the document (Insert, rotate, or delete pages and create bookmarks or thumbnail images), regardless if value is set or not.

◆ E_PermExtract

fpdfconversionsdk.E_PermExtract

Extract PDF contents. (Bit 5 in permission value)

If this value is set, user can copy or otherwise extract text and graphics from the document by operations other than that controlled by value .

◆ E_PermExtractAccess

fpdfconversionsdk.E_PermExtractAccess

Disabilities support. (Bit 10 in permission value)

If this value is set, user can extract text and graphics in support of accessibility to users with disabilities or for other purposes.

◆ E_PermFillForm

fpdfconversionsdk.E_PermFillForm

Fill PDF form. (Bit 9 in permission value)

If this value is set, user can fill in interactive form fields (including signature fields), even if value is not used.

◆ E_PermModify

fpdfconversionsdk.E_PermModify

Modify PDF contents. (Bit 4 in permission value)

If this value is set, user can modify contents of PDF document by operations other than those controlled by values , and .

◆ E_PermPrint

fpdfconversionsdk.E_PermPrint

Print PDF document with normal mode. (Bit 3 in permission value)

If user wants to print a higher quality level of PDF document, please set current value with value together.

◆ E_PermPrintHigh

fpdfconversionsdk.E_PermPrintHigh

Print PDF document with higher qualities. (Bit 12 in permission value)

If this value is not set (and value is set), printing is limited to a low-level representation of the appearance, possibly of degraded quality.