Closed MBahramiGitMit closed 1 year ago
Actually i'm not sure, now i don't have free time to try but i can add support for local assets in future release. I think you can try somethings like this
val assetName = "pdfname"
val inFile = context.assets.open(assetName)
val outFile = File(context.cacheDir,"newPdfFileName.pdf")
inFile.readBytes().let {
outFile.outputStream().apply {
write(it)
flush()
close()
}
}
inFile.close()
val uri = Uri.fromFile(outFile)
ResourceType.Local(uri = uri)
Asset support added in 1.1.1
Hi,
Asset support added in 1.1.1
So how was the support for Assets added and where?
In v1.1.2
, there are 4 ResourceType
s: Local
, Remote
, Base64
and Asset
;
however the last one should be better named Resource
rather than Asset
, since it requires @RawRes
and not String
/ URI
.
Hi How can I open a file from the assets folder by this library? thanks