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 an ongoing conversion task. Return true from isCancelled() to cancel the current task, or false to continue.

js
let cancelRequested = false;

const callback = {
  isCancelled() {
    return cancelRequested;
  }
};

The current addon calls JavaScript callbacks synchronously from the conversion call thread. If the native SDK triggers callbacks from internal worker threads in the future, the addon must use napi_threadsafe_function instead of direct napi_call_function().