- Posts: 1
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
zoom controled by external buttons
IP: 192.168.0.71
9 years 2 months ago #12585
by biadeo
zoom controled by external buttons was created by biadeo
Hello,
Could you please let me know if there is any possibility of controlling the zoom by pressing a zoom-in/ zoom-out button? We want to add these buttons, but we couldn't find any way to control the zoom using the library.
Thank you,
Bianca.
Could you please let me know if there is any possibility of controlling the zoom by pressing a zoom-in/ zoom-out button? We want to add these buttons, but we couldn't find any way to control the zoom using the library.
Thank you,
Bianca.
IP: 192.168.0.71
9 years 2 months ago #12586
by Davide
Replied by Davide on topic zoom controled by external buttons
Hi,
I suggest you to look at this method to handle zoom level :
You can see how to use it in OnPDFDoubleTapped method of PDFViewAct.
I suggest you to look at this method to handle zoom level :
Code:
vZoomSet(int, int, PDFLayout.PDFPos, float)
IP: 93.34.225.185
8 years 4 months ago #13794
by mfranc28
Replied by mfranc28 on topic zoom controled by external buttons
Same problem here.
How I can subscribe to the event?
I have
var btnZoomLevel = FindViewById(Resource.Id.btnZoomCustom);
AttachLabel(btnZoomLevel, LocalizedMessages.ViewerZoomLevel, Resource.Drawable.ZoomCustom);
btnZoomLevel.Click += (sender, e) =>
{ ??????? }
then in my OnPDFDoubleTapped I have
float mCurZoomLevel = p0.VGetZoom();
if (p0.VGetScale() <= p0.VGetMinScale())
Global.ZoomStep = 1;
if ((mCurZoomLevel > Global.ZoomLevel && Global.ZoomStep > 0) ||
(mCurZoomLevel == 1 && Global.ZoomStep < 0)) //reverse zoom step
Global.ZoomStep *= -1;
p0.VZoomSet((int)p1, (int)p2, p0.VGetPos((int)p1, (int)p2), mCurZoomLevel + Global.ZoomStep);
return true;
How I can subscribe to the event?
I have
var btnZoomLevel = FindViewById(Resource.Id.btnZoomCustom);
AttachLabel(btnZoomLevel, LocalizedMessages.ViewerZoomLevel, Resource.Drawable.ZoomCustom);
btnZoomLevel.Click += (sender, e) =>
{ ??????? }
then in my OnPDFDoubleTapped I have
float mCurZoomLevel = p0.VGetZoom();
if (p0.VGetScale() <= p0.VGetMinScale())
Global.ZoomStep = 1;
if ((mCurZoomLevel > Global.ZoomLevel && Global.ZoomStep > 0) ||
(mCurZoomLevel == 1 && Global.ZoomStep < 0)) //reverse zoom step
Global.ZoomStep *= -1;
p0.VZoomSet((int)p1, (int)p2, p0.VGetPos((int)p1, (int)p2), mCurZoomLevel + Global.ZoomStep);
return true;
IP: 37.183.44.177
8 years 4 months ago #13798
by nermeen
Replied by nermeen on topic zoom controled by external buttons
Currently the method vZoomSet is not accessible from PDFLayoutView.
You need to modify the java demo project , add the following method to PDFLayoutView, regenerate the aar and replace it into the Xamarin project.
Note: we will include this method in the next releases.
You need to modify the java demo project , add the following method to PDFLayoutView, regenerate the aar and replace it into the Xamarin project.
Code:
public void PDFSetZoom(int vx, int vy, PDFPos pos, float zoom) {
if(m_layout != null) m_layout.vZoomSet(vx, vy, pos, zoom);
}
Note: we will include this method in the next releases.
IP: 93.34.225.185
8 years 4 months ago #13799
by mfranc28
Replied by mfranc28 on topic zoom controled by external buttons
Ok, when did you plan next release? In this release there is only this feature or something else?
IP: 37.183.44.177
8 years 4 months ago #13804
by nermeen
Replied by nermeen on topic zoom controled by external buttons
We doesn't have an exact date now, but maybe it will be by the end of the month.
We are working on other fixes/enhancements.
We are working on other fixes/enhancements.
Time to create page: 0.451 seconds