Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

def_view setting has no effect? 9 years 7 months ago #7018

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 56
  • Thank you received: 1
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.

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

def_view setting has no effect? 9 years 7 months ago #7020

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 56
  • Thank you received: 1
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.

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

def_view setting has no effect? 9 years 7 months ago #7028

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
see PDFReader.PDFSetView()
this method allow you to set view style at runtime.

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

  • Page:
  • 1
Powered by Kunena Forum