RadPdfViewer
A comprehensive PDF document viewer control for .NET MAUI applications that provides rich document display, navigation, zooming, text search, text selection, and interactive features. The RadPdfViewer offers professional-grade PDF viewing capabilities with extensive customization options and seamless integration with complementary controls.
The RadPdfViewer is designed to handle PDF documents efficiently while providing a complete set of features for document viewing, navigation, and user interaction. It supports various document sources and offers flexible layout modes and viewing options for different application requirements.
Core Features:
- Document Loading: Support for multiple document sources including files, streams, and URIs
- Layout Modes: Single page and continuous scroll viewing modes with optimal performance
- Navigation: Built-in page navigation with programmatic and user-driven controls
- Zoom Controls: Comprehensive zooming capabilities with fit-to-width and custom zoom levels
- Interactive Elements: Support for hyperlinks, annotations, and interactive PDF content
Text Operations:
- Text Selection: Advanced text selection with customizable appearance and behavior
- Text Search: Full-text search with highlighting and navigation between results
- Copy Operations: Extract and copy selected text to clipboard
- Selection Menu: Contextual menu for text operations with extensible commands
User Interface:
- Viewport Management: Precise viewport control with programmatic scrolling and positioning
- Touch Gestures: Native touch support for panning, zooming, and text selection
- Command Architecture: Extensive built-in commands for all major operations
- Event Model: Comprehensive event system for monitoring and customizing behavior
Customization and Integration:
- Appearance Options: Customizable background colors, page spacing, and visual presentation
- Templates: Custom templates for busy indicators and error states
- Hardware Acceleration: Optional GPU rendering for enhanced performance
- Toolbar Integration: Seamless integration with RadPdfViewerToolbar for complete UI solutions
Ideal for document management applications, digital publishing platforms, report viewers, and any scenario requiring professional PDF viewing capabilities. The control provides enterprise-grade functionality while maintaining ease of use and integration flexibility.
Dedicated controls: RadPdfViewerToolbar.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class RadPdfViewer : RadLayout
Inheritance: objectRadLayoutRadPdfViewer
Inherited Members
Constructors
Initializes a new instance of the RadPdfViewer class.
public RadPdfViewer()
Fields
BackgroundColorProperty
BindableProperty
Identifies the BackgroundColor property.
public static readonly BindableProperty BackgroundColorProperty
BusyIndicatorTemplateProperty
BindableProperty
Identifies the BusyIndicatorTemplate property.
public static readonly BindableProperty BusyIndicatorTemplateProperty
CloseSearchViewCommandProperty
BindableProperty
Identifies the CloseSearchViewCommand property.
public static readonly BindableProperty CloseSearchViewCommandProperty
DocumentProperty
BindableProperty
Identifies the Document property.
public static readonly BindableProperty DocumentProperty
DoubleTappedCommandProperty
BindableProperty
Identifies the DoubleTappedCommand property.
public static readonly BindableProperty DoubleTappedCommandProperty
FitToWidthCommandProperty
BindableProperty
Identifies the FitToWidthCommand property.
public static readonly BindableProperty FitToWidthCommandProperty
LayoutModeProperty
BindableProperty
Identifies the LayoutMode property.
public static readonly BindableProperty LayoutModeProperty
MaxZoomLevelProperty
BindableProperty
Identifies the MaxZoomLevel property.
public static readonly BindableProperty MaxZoomLevelProperty
MinZoomLevelProperty
BindableProperty
Identifies the MinZoomLevel property.
public static readonly BindableProperty MinZoomLevelProperty
NavigateToNextPageCommandProperty
BindableProperty
Identifies the NavigateToNextPageCommand property.
public static readonly BindableProperty NavigateToNextPageCommandProperty
NavigateToNextSearchResultCommandProperty
BindableProperty
Identifies the NavigateToNextSearchResultCommand property.
public static readonly BindableProperty NavigateToNextSearchResultCommandProperty
NavigateToPageCommandProperty
BindableProperty
Identifies the NavigateToPageCommand property.
public static readonly BindableProperty NavigateToPageCommandProperty
NavigateToPreviousPageCommandProperty
BindableProperty
Identifies the NavigateToPreviousPageCommand property.
public static readonly BindableProperty NavigateToPreviousPageCommandProperty
NavigateToPreviousSearchResultCommandProperty
BindableProperty
Identifies the NavigateToPreviousSearchResultCommand property.
public static readonly BindableProperty NavigateToPreviousSearchResultCommandProperty
OpenSearchViewCommandProperty
BindableProperty
Identifies the OpenSearchViewCommand property.
public static readonly BindableProperty OpenSearchViewCommandProperty
PageSpacingProperty
BindableProperty
Identifies the PageSpacing property.
public static readonly BindableProperty PageSpacingProperty
SearchSettingsProperty
BindableProperty
Identifies the SearchSettings property.
public static readonly BindableProperty SearchSettingsProperty
SelectionSettingsProperty
BindableProperty
Identifies the SelectionSettings property.
public static readonly BindableProperty SelectionSettingsProperty
SourceExceptionTemplateProperty
BindableProperty
Identifies the SourceExceptionTemplate property.
public static readonly BindableProperty SourceExceptionTemplateProperty
SourceProperty
BindableProperty
Identifies the Source property.
public static readonly BindableProperty SourceProperty
ToggleLayoutModeCommandProperty
BindableProperty
Identifies the ToggleLayoutModeCommand property.
public static readonly BindableProperty ToggleLayoutModeCommandProperty
ViewportProperty
BindableProperty
Identifies the Viewport property.
public static readonly BindableProperty ViewportProperty
VisiblePagesCountProperty
BindableProperty
Identifies the VisiblePagesCount property.
public static readonly BindableProperty VisiblePagesCountProperty
VisiblePagesStartIndexProperty
BindableProperty
Identifies the VisiblePagesStartIndex property.
public static readonly BindableProperty VisiblePagesStartIndexProperty
ZoomInCommandProperty
BindableProperty
Identifies the ZoomInCommand property.
public static readonly BindableProperty ZoomInCommandProperty
ZoomLevelProperty
BindableProperty
Identifies the ZoomLevel property.
public static readonly BindableProperty ZoomLevelProperty
ZoomOutCommandProperty
BindableProperty
Identifies the ZoomOutCommand property.
public static readonly BindableProperty ZoomOutCommandProperty
Properties
BackgroundColor
Color
Gets or sets the background color of the PDF viewer.
public Color BackgroundColor { get; set; }
BusyIndicatorTemplate
DataTemplate
Gets or sets the template for the busy indicator displayed during document loading.
public DataTemplate BusyIndicatorTemplate { get; set; }
Gets or sets the ICommand which closes the PdfViewerSearchContentView.
public ICommand CloseSearchViewCommand { get; set; }
Document
RadFixedDocument
Gets the currently loaded PDF document.
public RadFixedDocument Document { get; }
Gets or sets the command executed when the viewer is double-tapped. The parameter of this command is of type Point and it represents the relative position of the tap, i.e. values between 0 and 1 in the scope of the PdfViewer.
public ICommand DoubleTappedCommand { get; set; }
Gets a value indicating whether the GPU should be used for rendering.
When set to true, is used and rendering is performed using the GPU.
When set to false, is used and rendering is performed using the CPU.
public bool EnableHardwareAcceleration { get; set; }
Gets or sets the command to fit the document to width.
public ICommand FitToWidthCommand { get; set; }
Gets or sets the layout mode for displaying PDF pages.
public LayoutMode LayoutMode { get; set; }
Gets or sets the maximum zoom level allowed.
public double MaxZoomLevel { get; set; }
Gets or sets the minimum zoom level allowed.
public double MinZoomLevel { get; set; }
Gets or sets the command to navigate to the next page.
public ICommand NavigateToNextPageCommand { get; set; }
Gets the ICommand executed when navigating to the next search result.
public ICommand NavigateToNextSearchResultCommand { get; }
Gets or sets the command to navigate to a specific page. The parameter of this command is of type int and it represents the page index.
public ICommand NavigateToPageCommand { get; set; }
Gets or sets the command to navigate to the previous page.
public ICommand NavigateToPreviousPageCommand { get; set; }
Gets the ICommand executed when navigating to the previous search result.
public ICommand NavigateToPreviousSearchResultCommand { get; }
Gets or sets the ICommand which opens the PdfViewerSearchContentView.
public ICommand OpenSearchViewCommand { get; set; }
Gets or sets the spacing between pages in continuous layout mode.
public double PageSpacing { get; set; }
Gets the search content view for the PDF viewer.
public PdfViewerSearchContentView SearchContentView { get; }
Gets or sets the settings for search functionality in the PDF viewer.
public PdfViewerSearchSettings SearchSettings { get; set; }
Gets or sets the settings for text selection in the PDF viewer.
public PdfViewerSelectionSettings SelectionSettings { get; set; }
Gets or sets the document source for the PDF viewer.
public DocumentSource Source { get; set; }
SourceExceptionTemplate
DataTemplate
Gets or sets the template for displaying source exceptions.
public DataTemplate SourceExceptionTemplate { get; set; }
Gets or sets the command to toggle the layout mode.
public ICommand ToggleLayoutModeCommand { get; set; }
Viewport
Rect
Gets the current viewport rectangle of the document.
public Rect Viewport { get; }
Gets the number of visible pages.
public int VisiblePagesCount { get; }
Gets the index of the first visible page.
public int VisiblePagesStartIndex { get; }
Gets or sets the command to zoom in the document.
public ICommand ZoomInCommand { get; set; }
Gets or sets the command to zoom out the document.
public ICommand ZoomOutCommand { get; set; }
Methods
Navigates to the specified page index.
public void NavigateToPage(int index)
The zero-based index of the page to navigate to.
Called when a child element is added to the PDF viewer.
protected override void OnChildAdded(Element child)
The child element that was added.
Called when a child element is removed from the PDF viewer.
protected override void OnChildRemoved(Element child, int oldLogicalIndex)
The child element that was removed.
oldLogicalIndexintThe old logical index of the child element.
Called when a property value changes.
protected override void OnPropertyChanged(string propertyName = null)
The name of the property that changed.
Scrolls the control, so that the Rect parameter appears into the viewport. Zoom is performed if necessary. No change is performed if the Rect parameter is already into view.
public void ScrollIntoView(Rect rect)
The Rect to scroll to.
Scrolls the control, so that the TextRange parameter appears into the viewport. Zoom is performed if necessary. No change is performed if the TextRange parameter is already into view.
public void ScrollIntoView(TextRange range)
The TextRange to scroll to.
Zooms the document to the specified zoom level.
Events
Occurs when a link annotation is tapped within the PDF document.
public event EventHandler<LinkAnnotationTappedEventArgs> LinkAnnotationTapped
An event that is raised after the model elements of a page were loaded. Use this event to alter the page content before it is rendered. This event is raised on a background thread.
public event EventHandler<PageElementsLoadedEventArgs> PageElementsLoaded
Occurs when an exception is raised during document loading or processing.
public event EventHandler<SourceExceptionEventArgs> SourceException
SourcePasswordNeeded
EventHandler<PasswordNeededEventArgs>
An event that is raised during document import if a password is needed. This event may be raised on a non-UI thread. The password can be provided in the event args.
public event EventHandler<PasswordNeededEventArgs> SourcePasswordNeeded