pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 584 forks source link

Opened PDF has wrong path #221

Closed Langstra closed 1 year ago

Langstra commented 5 years ago

I want to edit/annotate the PDF and then save this PDF again at the same location, overwriting the original PDF.adb

I am opening a PDF which is stored at /storage/emulated/0/Android/data/nl.fellow_it.kakesapp/files/635630582058/Aantekeningen/1445979171915y.pdf The PDF opens, with Foxit PDF, which is great. However, when I check the properties of the opened PDF I see that it actually opened /data/user/0/com.foxit.mobile.pdf.lite/cache/contentfile/1445979171915y.pdf. This is not great.

So problem is not that it does not open the PDF. Problem is that it opens some sort of cached version.

Config.xml:

<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
<platform name="android">
    <config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
        <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
    </config-file>
    <config-file parent="/*" target="AndroidManifest.xml">
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    </config-file>
</platform>

Device info:

Oneplus 5T
Android 8.1.0
Patch level July 1, 2018

UPDATE On a device with the following specs I can annotate and save the PDF. Here foxit gives the correct path to the PDF.

Samsung Note 10.1
Android 5.1.1
Path level 2017-02-01
Langstra commented 5 years ago

Got it fixed over here.

https://github.com/Evolution-36/cordova-plugin-file-opener2

shnist commented 5 years ago

hi @Langstra, thank you for raising this issue. Would you be willing to create a PR with the fixes?

shnist commented 1 year ago

I'm pretty sure this is a duplicate of #164