Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intercept a corrupted pdf #98

Open
brwno opened this issue Jun 28, 2021 · 0 comments
Open

Intercept a corrupted pdf #98

brwno opened this issue Jun 28, 2021 · 0 comments

Comments

@brwno
Copy link

brwno commented Jun 28, 2021

Hello!

Have any method to intercept and show a alert when I receive a corrupted PDF?
Today the screen show a white empty space. I not find anyone parameter for considerate if the PDF is valid or not, just print this in console:

E/PDFView ( 6319): load pdf error
E/PDFView ( 6319): java.io.IOException: cannot create document: File not in PDF format or corrupted.
E/PDFView ( 6319): at com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(Native Method)
E/PDFView ( 6319): at com.shockwave.pdfium.PdfiumCore.newDocument(PdfiumCore.java:135)
E/PDFView ( 6319): at com.github.barteksc.pdfviewer.source.FileSource.createDocument(FileSource.java:38)
E/PDFView ( 6319): at com.github.barteksc.pdfviewer.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:49)
E/PDFView ( 6319): at com.github.barteksc.pdfviewer.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:25)
E/PDFView ( 6319): at android.os.AsyncTask$3.call(AsyncTask.java:394)
E/PDFView ( 6319): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/PDFView ( 6319): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/PDFView ( 6319): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/PDFView ( 6319): at java.lang.Thread.run(Thread.java:923)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant