Android
ComPDFKit Conversion SDK
Guides

Guides

 

If you're interested in all of the features mentioned in the overview section, please go through our guides to quickly add PDF converting Word | Excel | PPT to your application. The following sections list some examples to show you how to add functionality to Android apps using our ComPDFKit Conversion SDK API in CPDFConvert.kt.

 

Related Callback Conversion Task for CPDFConverter Instance

 

val onHandleCal: ((objptr: Long) -> Unit) = { objptr ->
...
}
​
val onProgressCal: ((current: Int, total: Int) -> Unit) = { current: Int, total: Int ->
//Conversion task progress callback
val progress = ((current / total.toFloat()) * 1000).toInt() / 10
...
}
​
val onPostCal: ((code: ConvertError, outFilePath: String?) -> Unit) = { code: Int, outFilePath: String? ->
//Conversion task result callback
when (code) {
ConvertError.ERR_SUCCESS -> //The conversion is successful, and the document path is returned
ConvertError.ERR_ENCRYPTED -> //Document is encrypted
ConvertError.ERR_INTERRUPT -> //Task canceled
ConvertError.ERR_PERMISSION -> //Liscence not allowed
ConvertError.ERR_CONVERTING -> //Task is converting
ConvertError.ERR_ALLOC -> //alloc failed
else -> //Unkown Error
}
}