Skip to content
ComPDF
DemoFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Cancel Conversion Task

ComPDF Conversion SDK supports interrupting your ongoing conversion task at any time through the cancel callback in CConvertCallback. When the cancel callback returns true, the current conversion task stops as soon as possible.

c++
bool Cancel()
{
  return false;
}

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

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

If you need to cancel the conversion at a specific time, you can return true from Cancel based on external state.