zoom, PDFSetPos & pages - 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: zoom, PDFSetPos & pages

zoom, PDFSetPos & pages 1 year 7 months ago #12374

  • davred
  • davred's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
I opened a document with
PDFOpen(m_doc, this)
next I zoom in with
PDFZoom(..)
now, with OnTouch event I want to "move" inside the document:
....
 switch (event.getAction()) {
                        case MotionEvent.ACTION_DOWN:
                            pp = pdfView.PDFGetPos((int) event.getX(), (int) event.getY());
                            break;
                        case MotionEvent.ACTION_MOVE:
                            pdfView.PDFSetPos(pp, (int) event.getX(), (int) event.getY());
                            break;
      }
.......

I'm able to moving inside the document but if I go to right the reader show me the next page.

Is there a method to block the view only to the current page?

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

zoom, PDFSetPos & pages 1 year 7 months ago #12377

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
You can check the below articles, one for the PDFLayoutDual and one for the deprecated PDFViewDual
  1. Avoid page change during navigation while zoomed (Android)
  2. How to avoid page change during navigation if page is zoomed? (Deprecated)

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

zoom, PDFSetPos & pages 1 year 7 months ago #12378

  • davred
  • davred's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Thank you.
But to use ExtendedDualLayout i need to Override PDFSetView.
What is the best way to mantain unthached the libray?
To Override the method I need that some var are declared protected and not private

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

zoom, PDFSetPos & pages 1 year 7 months ago #12379

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
You can create a class that extends PDFLayoutView and overrides PDFSetView
For the private variables, you can override the methods that set these variables to save an instance of their values, or you can use your own values based on the variables and your requirements.

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

Last edit: by nermeen.

zoom, PDFSetPos & pages 1 year 7 months ago #12380

  • davred
  • davred's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
If i override PDFSetView i need access to
  • m_rtol
  • m_goto_pos
  • m_bmp_format
  • m_doc
For m_doc i can override PDFOpen when it is set and get its value.
But for the others vars?

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

zoom, PDFSetPos & pages 1 year 7 months ago #12381

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
The same idea:
  • m_rtol -> currently it's always false, from the next version it will be moved to Globlal class, so you can set it based on your configuration parameter
  • m_goto_pos -> override PDFGotoPage to save an instance
  • m_bmp_format -> override PDFSetBmpFormat

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

  • Page:
  • 1
Powered by Kunena Forum