Skip to content
ComPDF
DemoFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

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);