RadaeePDF.com :: Topic: Scroll pdf in android programmatically (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: Scroll pdf in android programmatically

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

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
The administrator has disabled public write access.

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

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 699
  • Thank you received: 53
  • Karma: 15
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
The administrator has disabled public write access.

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

Hi,

Thank you for this answer, but could you please guide me as to how to add this scroller to the pdfview ?
The administrator has disabled public write access.

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

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 699
  • Thank you received: 53
  • Karma: 15
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);
The administrator has disabled public write access.

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

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?
The administrator has disabled public write access.

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

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 699
  • Thank you received: 53
  • Karma: 15
You have to buy a Professional License or a Premium License to edit PDFView class!
The administrator has disabled public write access.
Powered by Kunena Forum