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

Scroll pdf in android programmatically

More
IP: 192.168.0.71 11 years 8 months ago #6812 by _dharashah_
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
Code:
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:
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
More
IP: 192.168.0.156 11 years 8 months ago #6819 by Davide
Hi,

you can try this to scroll the pdf:

Code:
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
More
IP: 192.168.0.71 11 years 8 months ago #6821 by _dharashah_
Hi,

Thank you for this answer, but could you please guide me as to how to add this scroller to the pdfview ?
More
IP: 192.168.0.156 11 years 8 months ago #6824 by Davide
Hi,

you can create a public void in PDFView class..

Something like this:

Code:
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:

Code:
m_view.vScrollPDF(0, 1000);
More
IP: 192.168.0.71 11 years 8 months ago #6825 by _dharashah_
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?
More
IP: 192.168.0.156 11 years 8 months ago #6827 by Davide
You have to buy a Professional License or a Premium License to edit PDFView class!
Time to create page: 0.443 seconds
Powered by Kunena Forum