APIs to customize the toolbar in UWP viewer

This is a quick guide on re-ordering and customizing the toolbar when using the PDF Viewer in the UWP Tools SDK.

The code snippet below will setup the AnnotationToolbarOptions class, which stores a list of buttons to add to the toolbar. Adding buttons to the list during initialization will adjust what is available on the toolbar.

C#

1pdftron.PDF.Tools.Controls.AnnotationToolbarOptions annotationToolbarOptions = new pdftron.PDF.Tools.Controls.AnnotationToolbarOptions();
2 List<ToolbarButtonType> mainToolBarItems = new List<ToolbarButtonType>();
3 mainToolBarItems.Add(ToolbarButtonType.Pan);
4 // Add buttons to toolbar....
5
6 annotationToolbarOptions.MainToolbarItems = mainToolBarItems;
7 mAnnotationToolbar = new pdftron.PDF.Tools.Controls.AnnotationCommandBar(mToolManager, annotationToolbarOptions);
8 //mAnnotationToolbar.IsInkToolButtonVisible = false;
9 //mAnnotationToolbar.IsSignatureToolButtonVisible = false;

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales