Dmitry-Borodin / pdfview-android

Small Android library to show PDF files
Apache License 2.0
294 stars 48 forks source link

Reopen pdf on page it was closed. #24

Open rajvijay0902 opened 3 years ago

rajvijay0902 commented 3 years ago

How can I open a pdf to a particular page .

rajvijay0902 commented 3 years ago

when i use scroll to (x,y) .....i get what i want but the part before (x,y) is removed from pdfview.Pls help.

Dmitry-Borodin commented 3 years ago

Good usecase, this need to be fixed (scroll to x,y should allow us to scroll back to beginning). I didn't reproduce it.

rajvijay0902 commented 3 years ago

currently is there a way to reopen pdf to a position at which it was closed?

Dmitry-Borodin commented 3 years ago

currently is there a way to reopen pdf to a position at which it was closed?

No, this functionality is not implemented at the moment. If you want to implement it - we can discuss of how to do it better.

Dmitry-Borodin commented 3 years ago

Fixing scroll to would be the best solution I think.

KnIfER commented 3 years ago

Two strategy of page navigation, one for jumping to page, and one for restoring.

Jumping to page : refer to the ezpdfreader, caclulate the offset of current page and replace the current page with the target page, the page offset remains unchanged.

Saving & Restoring : just save the scale of the viewer, the current page index and it's offset.

Better to save to database and use the file name as the retrival key.