Accessing a pdf from internal storage throws file not found exception
See original GitHub issueAm trying a populate a pdf which is stored in internal storage is throwing FileNotFoundException.
File file1 = new File(Environment.getExternalStorageDirectory()+"/pdf/Read.pdf");
pdfView.fromFile(file1)
.defaultPage(1)
.onPageChange(this)
.swipeVertical(true)
.showMinimap(false)
.load();
But when I manually check the directory, I could see that file exist. Or some times its giving me com.shockwave.pdfium.PdfOpenException: Open document failed in my log
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
How to Fix the FileNotFoundException in Java.io - Rollbar
The FileNotFoundException is a checked exception in Java that occurs when an attempt to open a file denoted by a specified pathname fails....
Read more >java - FileNotFoundException when importing file from storage ...
The file does not exist on Internal Storage. Use below code to solve the issue. public static String getPath(Context context, ...
Read more >Fix FileNotFoundException in Android 10 Q | by Rommer Cañete
One of which is the scoped storage or scoped access to external ... FileNotFoundException: /storage/myfolder/image.png: open failed: ENOENT.
Read more >FileNotFoundException - Android Developers
It will also be thrown by these constructors if the file does exist but for some reason is inaccessible, for example when an...
Read more >How to fix java.io.FileNotFoundException: (Access is denied ...
2. See if some other process is using that file ... This could be another possible reason for "java.io.FileNotFoundException: (Access is denied)". in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@barteksc thanks for you reply,
am still facing the same issue as @ENOZA has mentioned in earlier comments. I have given the permission in the manifest.
Am downloading the file from a remote server to a folder in phone storage. If I go to that particular directory I could see that file exists there and am able to open that file with other pdf viewers. The error an getting is when an populating the pdf. The log is shown below:
Pdf is not working in Kitkat version.When I Click on link,It Displaying Blank Page in My Emulator,Can u help me Please