Skip to content

取消转换任务

ComPDFKit Conversion SDK 支持随时中断您正在进行的转档任务,以下示例演示了如何中断您正在进行的转档任务:

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