Please give a brief summary of your issue: Viewer Config options are not working
Please describe your issue and provide steps to reproduce it: In my Viewer below options are not working
showThumbnailView(false)
showReflowOption(false)
showToolbarSwitcher(false)
showAnnotationToolbarOption(false)
Please provide a link to a minimal sample where the issue is reproducible: find sample code below
ThumbnailsViewFragment.FilterModes[] filterModes =new ThumbnailsViewFragment.FilterModes[2];
filterModes[0] = ThumbnailsViewFragment.FilterModes.BOOKMARKED;
filterModes[1] = ThumbnailsViewFragment.FilterModes.ANNOTATED;
ViewerConfig viewerConfig = new ViewerConfig.Builder()
// .showSaveCopyOption(true)
// .showPrintOption(true)
.toolbarTitle(docTitle!=null?docTitle:"")
.maximumTabCount(1)
.multiTabEnabled(false)
.documentEditingEnabled(false)
.longPressQuickMenuEnabled(false)
.thumbnailViewEditingEnabled(false)
.showEditPagesOption(false)
.showEditMenuOption(false)
.showThumbnailView(false)
.showAnnotationToolbarOption(false)
.showAnnotationsList(false)
.showToolbarSwitcher(false)
.showReflowOption(false)
.showBottomToolbar(true)
.showUserBookmarksList(false)
.userBookmarkCreationEnabled(false)
.showBookmarksView(false)
.hideThumbnailFilterModes(filterModes)
.build();
On my end, showThumbnailView(false), showReflowOption(false), showToolbarSwitcher(false) is working for me. For example here is what I see on my end (note thumbnail, reflow, and toolbar switcher are hidden):
As for showAnnotationToolbarOption(false), this config is only applicable to the old viewer and id deprecated in PdfViewCtrlTabHostFragment2. Could you describe what you would expect this setting to do? Some screenshots would also be very helpful.
Hi,
As I mentioned earlier, nothing works on my sample. I’m attaching my sample project here. Please check the sample and let me know what needs to be changed.
The issue is because you are calling “return super.onCreateOptionsMenu(menu);” in function “onToolbarCreateOptionsMenu”. If you look at your class, your base class is Activity. So here you are basically skipping over all PDFTron logic… you need to return false here which will resolve the problem:
Thanks for the solution it worked but still I can see some annotation options like Edit and annotation list. I’m attaching 2 screenshots for reference where issue is highlighted in red
Hi, as shown in my previous reply, what I see in your sample is different than what you showed in your screenshot, please kindly supply the latest version of your project so we can take another look. Thanks.