On this page
Guides
Cancel Conversion Task
ComPDFKit Conversion SDK supports interrupting your ongoing conversion task at any time. The following example demonstrates how to interrupt your ongoing conversion task:
kotlin
val cPDFConvert = CPDFConverterWord(context, uri, "")
val params = CPDFConvertWordOptions().apply {
isContainImages = true
isContainAnnotations = true
layoutOptions = LayoutOptions.RetainFlowingText
}
val result: ConvertError = cPDFConvert.convert(outputDir, outputFilenameNoSuffix, params, pageArrays,
onHandle = onHandleCal,
onProgress = onProgressCal,
onPost = onPostCal)
cPDFConvert.cancel()