I'm trying to save this PDf file in external storage but it only works for android 9 and below since something was removed for Android 10+. How can i save the file for android 10+.Kinda new with app dev so didn't understand the documentation.
myPdfDocument.finishPage(myPage1);
File file = new File(Environment.getExternalStorageDirectory(),"Client.pdf");
try {
myPdfDocument.writeTo(new FileOutputStream(file));
} catch (IOException e) {
e.printStackTrace();
}
finally {
Snackbar.make(view, "PDF Created at" + Environment.getExternalStorageDirectory()+"Client.pdf", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
myPdfDocument.close();