Some Viewer config options are not working

Product: Android SDK

Product Version: 9.0.1

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

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)

    mPdfViewCtrlTabHostFragment = ViewerBuilder2.withUri(fileUri)
            // Specify a custom toolbar
            .usingCustomToolbar(new int[]{})
            // Specify a custom navigation component

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:



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.

Best Regards,

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.

Class Name: SamplePDFViewer

CustomUI.7z (2.2 MB)

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.

Please find the updated class the only change I have made is making showBookmarksView as true and showOutlineList(true) (11.3 KB)

Hi, using your sample, how do I get to the state shown in your second image?

Also, what is you expected behaviour? Do you want to just hide that entire bar instead?

I would like to hide the entire bar, the bar can be seen randomly you can see that when document is getting loaded

You can hide the AnnotationToolbar by adding the following:

        ViewerConfig.Builder builder = new ViewerConfig.Builder()

Thanks for the solution, it worked.