move to point on pdf where click occured - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: move to point on pdf where click occured

move to point on pdf where click occured 3 years 11 months ago #6289

  • apait
  • apait's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Karma: 1
  • Thank you received: 0
hi,

i have a pdf, on doubletap i want to zoom into the pdf and center it on the coordinate where the doubletap was.

In ReaderController you have following code, which i extended:

public boolean OnPDFDoubleTapped(float x, float y)
{
this.m_pdv.vSetScale(this.m_pdv.vGetScale() +1, (int)x, (int)y);
return false;
}

zoom works, but the pdf only jumps to the top/left corner.

i tried following, but without any luck:
this.m_pdv.vSetPos(pos, (int)x, (int)y)

so, how can i just move to a point on the pdf, where i detected a click?
The topic has been locked.

move to point on pdf where click occured 3 years 11 months ago #6298

  • apait
  • apait's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Karma: 1
  • Thank you received: 0
okay, my bad, i just forgot to return true for the gesturelistener...

works:

public boolean OnPDFDoubleTapped(float x, float y){
m_pdv.vSetScale(m_pdv.vGetScale() + Global.zoomStep, x, y);
return true;
}

but is it possible to "center" the point where i the click occured?

now i'm zooming in and the point on the pdf where i clicked stays... i would like to move the pdf, so the point where i clicked is centered...
The topic has been locked.

move to point on pdf where click occured 3 years 10 months ago #6319

  • apait
  • apait's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Karma: 1
  • Thank you received: 0
any answer?
The topic has been locked.

move to point on pdf where click occured 3 years 10 months ago #6329

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 830
  • Karma: 43
  • Thank you received: 10
like this:
m_pdv.vSetScale(m_pdv.vGetScale() + Global.zoomStep, m_pdv.GetWidth()/2, m_pdv.GetHeight()/2);
The topic has been locked.

move to point on pdf where click occured 3 years 10 months ago #6435

  • apait
  • apait's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Karma: 1
  • Thank you received: 0
no, thats not working...
with m_pdv.GetWidth()/2, m_pdv.GetHeight()/2 it just centers the zoomed in page, regardless where the click occured.

any other ideas? ;)
The topic has been locked.
  • Page:
  • 1
Powered by Kunena Forum