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

File is not in PDF Format #45

Open
azhan3211 opened this issue Oct 28, 2021 · 3 comments
Open

File is not in PDF Format #45

azhan3211 opened this issue Oct 28, 2021 · 3 comments

Comments

@azhan3211
Copy link

Log tells that my PDF file is not PDF format when i build it on release
but it work fine on debug

java.io.IOException: file not in PDF format or corrupted
        at android.graphics.pdf.PdfRenderer.nativeCreate(Native Method)
        at android.graphics.pdf.PdfRenderer.<init>(PdfRenderer.java:171)
        at com.myapp.d.a(SourceFile:31)
        at com.pdfview.subsamplincscaleimageview.SubsamplingScaleImageView$l.a(SourceFile:1658)
        at com.pdfview.subsamplincscaleimageview.SubsamplingScaleImageView$l.doInBackground(SourceFile:1633)
        at android.os.AsyncTask$3.call(AsyncTask.java:394)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
@Dmitry-Borodin
Copy link
Owner

Are you sure it's the same file?
I see exception is coming from android framework pdf renderer, It should be the same as it's not part of the app.

@azhan3211
Copy link
Author

azhan3211 commented Oct 28, 2021

yeah, i am using online file, same file and link, it works on debug but not on release.

@yess-wee
Copy link

I think you have to add permission for the files which are located in external storage.

Add READ_EXTERNAL_STORAGE permission in app's manifest file.

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

3 participants