RadaeePDF.com :: Topic: def_view setting has no effect? (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: def_view setting has no effect?

def_view setting has no effect? 3 years 3 months ago #7018

  • arlomedia
  • arlomedia's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
I've added the PDF viewer to my app by copying code from ReaderActivity into my activity. The PDF is displaying, but it always displays with two pages side by side, and scrolls to additional pages horizontally. I want it to show one page at a time and scroll vertically.

I tried setting Global.def_view = 0 in my activity, after Global.Init(), and I also tried editing the Global class to change def_view directly there, but neither change has any effect on the display. I think I want view mode 0, which is the default anyway, but the viewer seems to be using view mode 1 or 6. What am I missing?

I'm able to change dark_mode in both places, so I don't know why I can't change def_view.
The administrator has disabled public write access.

def_view setting has no effect? 3 years 3 months ago #7020

  • arlomedia
  • arlomedia's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
I think I figured out the problem here. I added code from ReaderActivity into my activity, and ReaderActivity creates an instance of ReaderController, which only creates an instance of PDFViewDual to render the PDF file.

I tried creating an instance of PDFReader instead of ReaderController, and that creates an instance of various kinds of PDFView classes depending on the def_view setting.

I thought def_view would take affect at any level of the library, but apparently it doesn't go that deep and I need to implement a wrapper class that uses it or implement that functionality myself.

Creating an instance of PDFReader in my activity seems like it will work. It has just taken a while to figure out what the difference is between all the files in the demo app and which ones I want to base my work on.
The administrator has disabled public write access.

def_view setting has no effect? 3 years 2 months ago #7028

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
see PDFReader.PDFSetView()
this method allow you to set view style at runtime.
The administrator has disabled public write access.
Powered by Kunena Forum