How to use pdftron controls on my app's actionbar

Product: PDFTron Android SDK

Product Version: 9.0.1

Please give a brief summary of your issue:
How to include PDFTron UI controls like print, search, save in my apps action bar instead of PDFTron’s action bar
Please describe your issue and provide steps to reproduce it:

How can I add PDFTron viewer controls to my action bar (i.e., action bar with my app specific menu along with PDFTron controls)

  • Tried with DocumentActivity and PdfViewCtrlTabHostFragment2 but these didn’t allow me to have my own action bar.
  • Tried to use PDFViewCtrl to display PDF’s in my sample activity but I was getting blank screen(Observed SDK Initialization errors, so followed https://www.pdftron.com/documentation/android/faq/add-license/ still I see the blank page itself)

Please provide a link to a minimal sample where the issue is reproducible:

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:

Guides:APIs:Forums:

Hi,

We have an option to add a custom toolbar, please follow this link for more information: customize-the-options-toolbar
If this does not work for you, please include a runnable sample project with screenshot showing what is not working.

Hi Mallon,

Thanks for the response, I tried with the link provided in earlier conversation and I could see my custom actionbar, but not sure how to add pdftron specific tools to my action bar.

For reference i’m adding my activity here. It would be grateful if you can provide a sample to extension of my sample activity.
CustomToolbarActivity.java (2.7 KB)

Thanks in andvance

Hi, we have an out of box sample here that shows how you can customize the toolbar: pdftron-android-samples/CustomUI at master · PDFTron/pdftron-android-samples · GitHub. In this sample, you’ll see that the toolbar is completely different than the default.

how to add pdftron specific tools to my action bar
Could you elaborate on this? What exactly you are looking for?
Thanks.

Hi, Thanks for the quick response
I tried with the sample provided, but still my question was not answered. In that sample I could see the custom action bar, but when I tried add PDFTron config options like “showPrintOption”, “showSaveCopyOption” ,“showViewLayersToolbarOption” etc. I didn’t see them in that custom action bar.

following is the modified code from the sample.

ViewerConfig viewerConfig = new ViewerConfig.Builder()
.addToolbarBuilder(buildNotesToolbar())
.addToolbarBuilder(buildShapesToolbar())
.toolbarTitle(“٩(◕‿◕。)۶”)
.showSaveCopyOption(true)
.showPrintOption(true)
.showViewLayersToolbarOption(true)
.build();

Please let me know how I can proceed further.

Since you are using a custom toolbar, you will need to add any options by yourself. This can be done by modifying the menu file as you would normally do in regular android project. See pdftron-android-samples/my_custom_options_toolbar.xml at master · PDFTron/pdftron-android-samples · GitHub. You can download the source code of PDFTron from our website and see what the default is and move over items you want. The builder is only if you are building from our default version. Thanks.