Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstraction methods of PdfViewerController.goTo #72

Closed
xaqtr opened this issue Jan 26, 2022 Discussed in #71 · 1 comment
Closed

Abstraction methods of PdfViewerController.goTo #72

xaqtr opened this issue Jan 26, 2022 Discussed in #71 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@xaqtr
Copy link

xaqtr commented Jan 26, 2022

Discussed in #71

Originally posted by xaqtr January 26, 2022
Hi,

first of all thanks for this library @espresso3389, it's really saving us for a work related project right now due to its flexiblity and features.

As I was trying to integrate this plugin into my App, I was kind of lost on how to programmatically scale into the PDF with the PdfViewerController (I wanted to implement a double tap zoom in /out functionality).

I digged into the plugin code and realized that you have the control about everything by using the PdfViewerController.goTo method. and passing a suited Matrix4 value. So my question is whether it would be possible to have methods that abstract the usage of this Matrix4. I think this would benefit many developers as in my opinion it requires some additional knowledge hurdle.

So my proposal would be some additional methods for PdfViewerController, e.g.:

// In this case, scale would be the destination scale 
// (so calling this method more than once with the same parameter will not change the scaling / position)
Future<void> scaleTo({ required double scale, Duration duration })

// Pan to a relative point of the specified page
// x and y would be relative values of the page, where the destination origin will be
// e.g.: pageNumber = 1, x = 0.5, y = 0.5 will put the origin into the center of the first page
Future<void> panTo({ required int pageNumber, required double x, required double y, Duration duration })

I dont' have the best understand about the usage of Matrix4 yet, so I'm not sure whether it's even possible to have such methods, but I would like to hear some opinions on that.
In the meantime I will try to implement the above mentioned methods.

@espresso3389 espresso3389 added the enhancement New feature or request label Jan 27, 2022
@espresso3389 espresso3389 self-assigned this Jan 27, 2022
@espresso3389
Copy link
Owner

1.0.22 that contains the dhanges is released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants