How to get pdfrenderer instance via uri in jetpack compose
Basically I'd like to get the pagecount of the pdf whose uri that i'm inputting in the function but it seems to keep failing and I am struggling to figure out why.
I've been trying to wrap my hand around how to get it working reliably but the app just keeps crashing. My last attempt is commented below.
fun getPdfPageCount(context: Context, uri: Uri): Int {
// val contentResolver = context.contentResolver
val uri_string:String = uri.toString()
var pageCount = 0
Toast.makeText(...