Skip to content
Guides

Conversion Guides

ComPDFKit Conversion SDK allows developers to use a simple API to convert PDF to the most commonly used file formats like Word, Excel, PPT, HTML, CSV, PNG, JPEG, RTF, CSV,etc. Provide a wealth of customized conversion options, such as whether to include images or annotations in PDF documents, whether to enable OCR or layout analysis, etc.

Get Conversion Progress

ComPDFKit Conversion SDK obtains the conversion progress through callback functions. The following example demonstrates how to get the conversion progress while performing a PDF to Word task:

python
# Define callback function.
def callback(current_progress: int, total_progress: int):
    print("Convert progress: " + str(current_progress / total_progress * 100) + "%")

error_code = LibraryManager.license_verify("", False, "", "")

if error_code == ErrorCode.Success:
    print("License verify success")

    LibraryManager.initialize("path/to/resource")

    options = ConvertOptions()
    # Set callback function in Conversion progress.
    error_code = PDFToOffice.start_pdf_to_word("sample.pdf", "", "path/to/output", options, callback)

    if error_code == ErrorCode.Success:
        print("Convert success")

    LibraryManager.release()