android icon indicating copy to clipboard operation
android copied to clipboard

Preview for PDF files

Open shashvat-kedia opened this issue 6 years ago • 11 comments

Actual behaviour

On opening a PDF file the file is downloaded automatically.

Expected behaviour

Instead the file should be opened for preview and and option should be provided to the user to download the file.

Steps to reproduce

  1. Open any PDF file

Can this problem be reproduced with the official owncloud server? (url: https://demo.owncloud.org, user: test, password: test) Yes

shashvat-kedia avatar Mar 16 '19 04:03 shashvat-kedia

you need to download the file to show it in the device, afaik

jesmrec avatar Mar 18 '19 16:03 jesmrec

@jesmrec Google drive supports this. They have a seperate option for downloading the pdf. I am researching more about how they do this.

shashvat-kedia avatar Mar 18 '19 17:03 shashvat-kedia

ok, thanks for your effort!

jesmrec avatar Mar 19 '19 07:03 jesmrec

@jesmrec @davigonz The PDF file has to be downloaded on to the device. To support this functionality what we can do is instead of showing the a progress bar of the pdf download(current case) we can instead show the user a PDFView(this can be obtained using 3rd party libraries like AndroidPDFViewer) and load the PDF in that view hence allowing the user to view the PDF in the app itself. Then additional option can be provided to the user to download the file( the data corresponding to the file would already have been fetch to display it on the PDF View hence no extra bandwith would be required we will just have to create a File in the local storage and save the contents in it). If the user does not want to download the file it wont be an issue as the File for the PDF would not be created unless the user explicitly clicks the download button. What do you think?

shashvat-kedia avatar Mar 22 '19 06:03 shashvat-kedia

the data corresponding to the file would already have been fetch to display it on the PDF View hence no extra bandwith would be required we will just have to create a File in the local storage and save the contents in it

Does AndroidPDFViewer take care of this or should we do it manually?

davigonz avatar Mar 22 '19 09:03 davigonz

@davigonz The part of saving the PDF by creating a File will have to be done manually everything else is handled by the AndroidPDFViewer library.

shashvat-kedia avatar Mar 22 '19 09:03 shashvat-kedia

@jesmrec @davigonz Should I start with this then?

shashvat-kedia avatar Mar 26 '19 07:03 shashvat-kedia

Should I start with this then?

@sd1998 It would be better to finish https://github.com/owncloud/android/issues/2276 before

davigonz avatar Mar 26 '19 12:03 davigonz

@davigonz Shall I start working on this?

shashvat-kedia avatar Jun 05 '19 06:06 shashvat-kedia

@michaelstingl @hosy , is this interesting to include in 2.12?

jesmrec avatar Jun 05 '19 07:06 jesmrec

@michaelstingl @hosy , is this interesting to include in 2.12?

2.12 is already pretty full, but if you @sd1998 would like to help here, it would be cool! 👍

michaelstingl avatar Jun 12 '19 12:06 michaelstingl