Scroll pdf in android programmatically - 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: Scroll pdf in android programmatically

Scroll pdf in android programmatically 4 years 3 months ago #6812

  • _dharashah_
  • _dharashah_'s Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
Hi,
Thank you for this library. I have an issue in android, where the scenario is this: I have two tablets of the same resolution, where by i scroll the pdf on one tablet and using this
xx = m_view.vGetX();
yy= m_view.vGetY();
i get the x and y coordinates, when i use the following on the second tablet in code:
PDFPos pos = m_view.vGetPos(Integer.parseInt(left),Integer.parseInt(top));
m_view.vSetPos(pos,  Integer.parseInt(left), Integer.parseInt(top));
I do not seem to scroll the pdf programmatically :( . could any one please assist on how to scroll the pdf. and what actual values to use in order to scroll it programmatically.
Please assist.
Thanking you

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

Scroll pdf in android programmatically 4 years 3 months ago #6819

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,

you can try this to scroll the pdf:

m_scroller = new Scroller(context);

...

m_scroller.setFinalX(newX);
m_scroller.setFinalY(newY);
m_scroller.computeScrollOffset();


and you have to take into account the scale!


Check this:
www.androidpdf.mobi/forum/Android-develo...ew-area-android#5007

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

Scroll pdf in android programmatically 4 years 3 months ago #6821

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

Thank you for this answer, but could you please guide me as to how to add this scroller to the pdfview ?

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

Scroll pdf in android programmatically 4 years 3 months ago #6824

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,

you can create a public void in PDFView class..

Something like this:

public void vScrollPDF(int newX, int newY){
	if(m_scroller != null){
		m_scroller.setFinalX(newX);
		m_scroller.setFinalY(newY);
		m_scroller.computeScrollOffset();
	}		
}

and call it in your PDFReader class where you want and with the values you want:

m_view.vScrollPDF(0, 1000);

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

Scroll pdf in android programmatically 4 years 3 months ago #6825

  • _dharashah_
  • _dharashah_'s Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
I am afraid i will not be able to access the PDFView class because its a jar :( and this version is the standard version that i am using. Is there a way i could access this class?

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

Scroll pdf in android programmatically 4 years 3 months ago #6827

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
You have to buy a Professional License or a Premium License to edit PDFView class!

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

  • Page:
  • 1
Powered by Kunena Forum