I am trying to extract a bitmap image from pdf. I am following this post from stack overflow Generate Thumbnail of Pdf in Android
My Pdf file is located in the assets folder
private var quaranPdfUri = "quran.pdf"
I tried the following ways to open the pdf from assets folder
1.val parcelFileDescriptor = contentResolver.openFileDescriptor(Uri.parse("file:///android_asset/$quaranPdfUri"),"r")
2. val parcelFileDescriptor = contentResolver.openAssetFileDescriptor(Uri.parse("file:///android_asset/$quaranPdfUri"),"r")?.parcelFileDescriptor
3. val parcelFileDescriptor = contentResolver.openInputStream(Uri.parse("file:///android_asset/$quaranPdfUri"))
But in all the above cases i am getting file not found exception.
I went through a bunch of post on stack overflow to obtain uri of file present in assets folder, but i keep getting file not found exception
How to get URI from an asset File? Get Uri from file in either assets or res/raw How to pass a file path which is in assets folder to File(String path)?