Move pdf page to particular position with zoom - 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
  • 2

TOPIC: Move pdf page to particular position with zoom

Move pdf page to particular position with zoom 4 years 10 months ago #4895

  • vym
  • vym's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Hi,

I require to move pdf to specified position (page, zoom, viewable area).

I need to scroll to Page number 10 PDFPos x= 204.57294 PDFPos y =453.0561 PDFPos vx = -171 PDFPos vy -323

I tried to achieve by following :

PDFPos pos = m_view.vGetPos((int)204.57294, (int)453.0561);
m_view.vSetPos(pos, -171, -323);
invalidate();

But it doesnt work. Please direct me how to achieve this.

As my application requirement is to show pdf to student as teacher move her pdf i need to move student pdf from background. Any help is appreciated.

Thanks.

Please Log in or Create an account to join the conversation.

Move pdf page to particular position with zoom 4 years 10 months ago #4896

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 846
  • Karma: 43
  • Thank you received: 12
these codes not changed position:
PDFPos pos = m_view.vGetPos((int)204.57294, (int)453.0561);
m_view.vSetPos(pos, (int)204.57294, (int)453.0561);
invalidate();
these codes move down 100 pixels:
PDFPos pos = m_view.vGetPos((int)204.57294, (int)453.0561);
m_view.vSetPos(pos, (int)204.57294, (int)453.0561 + 100 );
invalidate();

Please Log in or Create an account to join the conversation.

Move pdf page to particular position with zoom 4 years 9 months ago #4962

  • vym
  • vym's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Hi,

Its not working, doesnt move page to specified location.

I need to scroll pdf to fixed x,y and vx,vy when opened.

My Queries:
1. Does vSetPos sets pdf view part to specified position.
2. In vSetPos how to set x,y,vx,vy 4 values.

Its urgent any direction is appriciated.

Thanks.

Please Log in or Create an account to join the conversation.

Move pdf page to particular position with zoom 4 years 9 months ago #4963

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 846
  • Karma: 43
  • Thank you received: 12
public class PDFPos
{
public int pageno;//pageno to be jump
public float x;//x in PDF coordinate
public float y;//y in PDF coordinate
};

vx, vy: PDFPos shall be at the point of screen, and this may adjust by max width and max height of Document.


vSetPos works after first PDFView.vResize() called.
and width, height can't be 0 for PDFView.vResize().

Please Log in or Create an account to join the conversation.

Last edit: by .

Move pdf page to particular position with zoom 4 years 9 months ago #4964

  • vym
  • vym's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Hi,

As you suggested i have put resize and it changes the page to random place as i set vresize(100,100)
but then values of vSetPos doesnt changes to x,y specified.

Can u share any working code demo.

Also need to confirm vSetPos shows parameter vx,vy [vSetPos(PDFPos pos, int vx, int vy)
)] according to document but we are passing x,y. However i tried both but pdf doesnt move to show as attached image.

Thanks.
Attachments:

Please Log in or Create an account to join the conversation.

Move pdf page to particular position with zoom 4 years 9 months ago #4965

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 846
  • Karma: 43
  • Thank you received: 12
PDFReader.onSizeChanged()
has some codes, to record position at screen (w/2,h2) (center of the View)
and after screen changed, put the position back to screen (w/2,h2)

if you want jump to a page, and show [top-left of page] at [top-left of screen].
codes like:
  PDFPos pos = new PDFPos();
  pos.x = 0;
  pos.y = Document.GetPageHeight( pageno );//PDF using Math coordinate, which (0,0) is placed bottom)
  pos.pageno = pageno;
  PDFView.vSetPos( pos, 0, 0);
  invalidate();

Please Log in or Create an account to join the conversation.

Last edit: by .
  • Page:
  • 1
  • 2
Powered by Kunena Forum