My app code is below.
pdfView.fromFile(File(pdfPath))
.pages(0)
.enableSwipe(false)
.swipeHorizontal(false)
.enableDoubletap(false)
.defaultPage(0)
.enableAnnotationRendering(true)
.password(null)
.scrollHandle(null)
.enableAntialiasing(false)
.onError(OnErrorListener {
// error handling
})
.load()
It seems like there is some problem with the annotation because it doesn’t crash when enableAnnotationRendering(false).
Also, some PDFs crash and some don’t.
PDFs edited on Windows or Android do not crash, but PDFs edited on Mac or iPhone do crash.
I suspect that rendering is failing due to missing fonts, but is there a possibility that the app will crash if there are no fonts?
Also, even if rendering fails, it cannot be caught with onError().
What can I do to prevent the app from crashing?
Thing you want to do
- Catch rendering failures with onError() or another method to avoid crashing the app.
- 1 is completed, and I want to change it to the device’s default font if the font does not exist.
user25198750 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.