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 the ConvertCallback structure. When the cancel callback returns true, the current conversion task will stop as soon as possible.

c#
void GetCancel()
{
  return false;
}
OnCancel getCancel += GetCancel;

ConvertCallback callback = new ConvertCallback();
callback.cancel = Marshal.GetFunctionPointerForDelegate(getCancel);

WordOptions wordOptions = new WordOptions();
CPDFConversion.StartPDFToWord("input.pdf", "password", "path/output.docx", wordOptions, callback);