You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 suitedMatrix4
value. So my question is whether it would be possible to have methods that abstract the usage of thisMatrix4
. 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.: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.
The text was updated successfully, but these errors were encountered: