Getting Started with WinUI PdfViewer
This guide provides the information you need to start using the Telerik UI for WinUI PdfViewer by adding the component to your project.
At the end, you will be able to achieve the following result.
Prerequisites
Before adding the PdfViewer, you need to:
-
Create your Telerik UI for WinUI application and install the Telerik UI for WinUI components depending on the required installation approach:
Add the Assembly References
To use the RadPdfViewer
component, add references to the following assemblies:
-
Telerik.WinUI.Controls.dll
Telerik.WinUI.Controls.PdfViewer.dll
Telerik.Documents.Fixed.dll
Telerik.Documents.Core
Telerik.Zip.dll
- Microsoft.Graphics.Win2D NuGet package (version 1.0.1 and later)
Define the Component
To render a PDF file using the RadPdfViewer
control, define it and set its DocumentSource
property. You can access the PdfViewer through the xmlns:telerik="using:Telerik.UI.Xaml.Controls"
alias that points to the Telerik.UI.Xaml.Controls
namespace.
Setting up the Pdf
<telerik:RadPdfViewer DocumentSource="ms-appx:///PdfFiles/Sample.pdf"/>
Define the Toolbar
The PdfViewer comes with a built-in toolbar component which has a set of predefined options. To use it, add the RadPdfViewerToolBar
control in the view and set its RadPdfViewer
property.
Setting up the toolbar
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<telerik:RadPdfViewerToolBar RadPdfViewer="{Binding ElementName=pdfViewer, Mode=OneTime}" />
<telerik:RadPdfViewer Grid.Row="1"
x:Name="pdfViewer"
DocumentSource="ms-appx:///PdfFiles/Sample.pdf" />
</Grid>
Telerik UI for WinUI Learning Resources
- Telerik UI for WinUI PdfViewer Component
- Getting Started with Telerik UI for WinUI Components
- Telerik UI for WinUI Installation
- Telerik UI for WinUI Examples
- Telerik UI for WinUI Accessibility
- Telerik UI for WinUI License Agreement