pdf - navigating to a specific page with the mupdf android library -
how go navigating specific page mupdf library? or there way make library not remember page last on in pdf?
uri uri = uri.parse(path); intent intent = new intent(mainactivity.getcontext(), mupdfactivity.class) intent.setaction(intent.action_view); intent.setdata(uri); c.startactivity(intent); //c context
this how i'm opening pdfs.
you can add page index in bundle intent, load index in mupdfactivity thereafter , call mdocview.setdisplayedviewindex(your_index_from_bundle); should job.
something that:
uri uri = uri.parse(path); intent intent = new intent(mainactivity.getcontext(), mupdfactivity.class) intent.setaction(intent.action_view); intent.setdata(uri); bundle extras = intent.getextras(); extras.putint("key_page_index", 10); c.startactivity(intent);
then edit oncreate in mupdfactivity, add code @ end of oncreate:
intent intent = getintent(); if(intent!=null){ bundle extras = intent.getextras(); if(extras!=null){ int index = extras.getint("key_page_index"); mdocview.setdisplayedviewindex(index); } }
Comments
Post a Comment