Customize the ViewerControl in UWP

ViewerControl is configurable and can be easily customized using it's internal properties which enables the UI components to be hidden and functionalities be disabled.

Configure ViewerControl

The control has a set of options to enable/disable features in the component.

For example:

C#

1var viewerCtrl = new ViewerControl();
2
3viewerCtrl.ShowAnnotationToolbarButton = true;
4viewerCtrl.ShowPrintOption = true;
5viewerCtrl.ShowSaveAsOption = true;
6viewerCtrl.ShowShareOption = true;
7viewerCtrl.ShowTextSearchOption = true;
8viewerCtrl.ShowThumbnailView = true;
9viewerCtrl.ShowPDFCompare = true;
10viewerCtrl.ShowExportXFDF = true;
11viewerCtrl.ShowActionsOption = true;
12viewerCtrl.ShowCropView = true;
13
14StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Resources/GettingStarted.pdf"));
15if (file != null)
16 await viewerCtrl.ActivateWithFileAsync(file);

A full list of settings for ViewerControl can be found in the API documentation

AnnotationCommandBar

You also have the ability to access and configure the internal ViewerControl's Annotation Toolbar.

C#

1var viewerCtrl = new ViewerControl();
2
3viewerCtrl.AnnotationToolbar.IsArrowToolButtonVisible = true;
4viewerCtrl.AnnotationToolbar.IsCloudToolButtonVisible = true;
5viewerCtrl.AnnotationToolbar.IsLassoToolButtonVisible = true;
6viewerCtrl.AnnotationToolbar.IsMarqueeZoomToolButtonVisible = true;
7
8StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Resources/GettingStarted.pdf"));
9if (file != null)
10 await ViewerControl.ActivateWithFileAsync(file);

A full list of settings for AnnotationCommandBar can be found in the API documentation

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales