Getting Started

This article will guide you through the steps needed to add a basic RadPdfViewer control in your application.

1. Setting up the app

Take a look at these articles and follow the instructions to setup your app:

2. Adding the required Telerik references

You have two options:

  • Add the Telerik UI for Xamarin Nuget packages following the instructions in Telerik NuGet package server topic.

  • Add the references to Telerik assemblies manually, check the list below with the required assemblies for RadPdfViewer component:

Platform Assemblies
Portable Telerik.Documents.Core.dll
Telerik.Documents.Fixed.dll
Telerik.XamarinForms.PdfViewer.dll
Telerik.XamarinForms.Common.dll
Telerik.XamarinForms.Primitives.dll
Telerik.XamarinForms.SkiaSharp.dll
Android Telerik.Xamarin.Android.Primitives.dll
Telerik.Xamarin.Android.Common.dll
Telerik.XamarinForms.PdfViewer.dll
Telerik.XamarinForms.Common.dll
Telerik.XamarinForms.Primitives.dll
Telerik.XamarinForms.SkiaSharp.dll
iOS Telerik.Documents.Core.dll
Telerik.Documents.Fixed.dll
Telerik.Xamarin.iOS.dll
Telerik.XamarinForms.PdfViewer.dll
Telerik.XamarinForms.Common.dll
Telerik.XamarinForms.Primitives.dll
Telerik.XamarinForms.SkiaSharp.dll
UWP Telerik.Core.dll
Telerik.Documents.Core.dll
Telerik.Documents.Fixed
Telerik.UI.Xaml.Primitives.UWP.dll
Telerik.XamarinForms.PdfViewer.dll
Telerik.XamarinForms.Common.dll
Telerik.XamarinForms.Primitives
Telerik.XamarinForms.SkiaSharp.dll

3. Adding RadPdfViewer control

You could use one of the following approaches:

Drag the control from the Toolbox.

Take a look at the following topics on how to use the toolbox:

Create the control definition in XAML.

<telerikPdfViewer:RadPdfViewer x:Name="pdfViewer" />

In addition to this, you need to add the following namespace:

xmlns:telerikPdfViewer="clr-namespace:Telerik.XamarinForms.PdfViewer;assembly=Telerik.XamarinForms.PdfViewer"

4. Visualize a Pdf Document

To visualize the pdf document you will need to set the Source property of the control.

  • Source (DocumentSource): Defines the source of the document.

The example below shows a pdf document visualized as an EmbeddedResource. This is one of the options for loading a pdf inside PdfViewer control, you could check the others in the Key Features topic.

Assembly assembly = typeof(PdfViewerGettingStartedXaml).Assembly;
string fileName = assembly.GetManifestResourceNames().FirstOrDefault(n => n.Contains("pdfviewer-overview.pdf"));
if (!string.IsNullOrEmpty(fileName))
{
    this.pdfViewer.Source = assembly.GetManifestResourceStream(fileName);
}

This is the result:

PdfViewer Getting Started Example

See Also

In this article
Not finding the help you need? Improve this article