Dmitry-Borodin / pdfview-android

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

Support gestures #8

Closed mlecoq closed 4 years ago

mlecoq commented 4 years ago

Hi, do you think it would be possible to handle gestures like onTap ? I would like to use your lib to draw on pdf, but I need to get tap events with their positions (x,y) in the file

Dmitry-Borodin commented 4 years ago

Could you clarify your usecase? To show drawing you'll need another layer(custom view) above pdf view to show drawed lines. This view can react on touch, but not intersect touch events. What actions do you expect from pdf view?

mlecoq commented 4 years ago

I would like to be able to import construction plans (in PDF format) and add pins on it. I would like to display added pins and store their position (x,y). When there are several pages, I need to know on which page pins are added. I have no experience in android development. Let's image that I add a custom view on top of pdfview, I guess that I will have to know which page is displayed, am I right ?

Dmitry-Borodin commented 4 years ago

This library will only show single pdf files, no custom data in pdf format is planned - this will make it unnecessary complicated. If you will add transparent scrollable drawing layer on top - you won't need to know which page is shown, as long as content paddings are in sync - you are fine. I don't see wide usecase of callbacks when new page is shown, since you don't know about content in the page.

And this lib will not be able to export pdf (with extra layer, for example) - android doesn't have this functionality, you need big custom binaries for that, some other (much bigger) libraries can do that.

mlecoq commented 4 years ago

Ok, thanks a lot for your answer ! I will try what you suggest