How to save string to pdf?
Do you know how to save string to pdf. I use this code and it doesn't work or it saves somewhere else.
fun stringToPdf(data: String) {
// val extstoragedir = Environment.getExternalStorageDirectory().toString();
val path = applicationContext.filesDir.absolutePath
val extstoragedir = path
val fol = File(extstoragedir, "sample.pdf");
val folder = File(fol, "pdf");
if (!folder.exists()) {
val bool = folder.mkdir();
}
//...