Skip to content
ComPDF

Get Conversion Progress

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

c++
void Progress(int current_page_count, int total_page_count)
{
  std::cout << "progress: " << current_page_count << " / " << total_page_count << std::endl;
}

ConvertOptions opt;
CConvertCallback callback = {};
callback.handle = nullptr;
callback.progress = Progress;
callback.cancel = nullptr;

CPDFConversion::StartPDFToWord("input.pdf", "password", "path/output.docx", opt, &callback);

The handle field is maintained internally by the SDK during conversion, so it should be initialized to nullptr when passed in.