The Xamarin PDF Viewer is a feature-rich and high-performance control for viewing and reviewing PDF files in Xamarin.Forms applications. The bookmark, hyperlink, and table of contents support provides easy navigation within and outside PDF files. PDF files can be reviewed with various annotation tools.
Easily get started with the Xamarin.Forms PDF Viewer using a few simple lines of XAML and C# code, as demonstrated in the following. Also explore our Xamarin.Forms PDF Viewer example, which shows you how to render and configure the PDF Viewer in Xamarin.Forms.
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GettingStarted"
x:Class="GettingStarted.MainPage"
xmlns:syncfusion="clr-namespace:Syncfusion.SfPdfViewer.XForms;assembly=Syncfusion.SfPdfViewer.XForms"
>
<ContentPage.BindingContext>
<local:PdfViewerViewModel></local:PdfViewerViewModel>
</ContentPage.BindingContext>
<Grid x:Name="pdfViewGrid">
<syncfusion:SfPdfViewer x:Name="pdfViewerControl" InputFileStream="{Binding PdfDocumentStream}"/>
</Grid>
</ContentPage>
using System.IO;
using System.Reflection;
using System.ComponentModel;
namespace GettingStarted
{
class PdfViewerViewModel : INotifyPropertyChanged
{
private Stream m_pdfDocumentStream;
/// <summary>
/// An event to detect the change in the value of a property.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// The PDF document stream that is loaded into the instance of the PDF Viewer.
/// </summary>
public Stream PdfDocumentStream
{
get
{
return m_pdfDocumentStream;
}
set
{
m_pdfDocumentStream = value;
NotifyPropertyChanged("PdfDocumentStream");
}
}
/// <summary>
/// Constructor of the view model class
/// </summary>
public PdfViewerViewModel()
{
//Accessing the PDF document that is added as embedded resource as stream.
m_pdfDocumentStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("GettingStarted.Assets.GIS Succinctly.pdf");
}
private void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
Load PDF files with thousands of pages instantly.
On-demand loading and virtualization means the control holds only the minimum required pages at runtime to reduce memory consumption.
Render pages on demand to help reduce initial load time when working with large documents.
The Xamarin PDF Viewer allows users to view password-protected PDF files. It has a built-in view for entering the password of encrypted PDF documents before displaying the file. This built-in view can be disabled.
Zoom in and out of the PDF document by pinching or changing the zoom percentage programmatically using an API.
The Xamarin.Forms PDF Viewer library has a built-in toolbar that can be customized.
The Xamarin.Forms PDF Viewer control comes with a powerful, built-in toolbar to execute the most important actions, such as page navigation, text search, and various annotation actions.
Customize the visibility of items on the built-in toolbar.
Disable the built-in toolbar and create a custom toolbar in your application.
Select text in a PDF document and copy it to the clipboard. This is helpful for sharing text content with others.
Locate all occurrences of specific text and navigate through them easily.
The PDF Viewer in Xamarin.Forms supports different internal and external navigations.
Navigate to bookmarks present in the PDF Viewer and custom bookmarks dynamically added by a user. Custom bookmarks can also be renamed, deleted, and saved in the PDF file.
The hyperlink navigation feature in Xamarin PDF Viewer enables navigation to URLs (website links) from a PDF file.
Navigate to the different parts of a PDF file listed in the table of contents section.
Print the loaded PDF document with annotation and signature details.
Review PDF files using a rich set of annotating tools.
Highlight important text in PDF files. Also, customize the appearance of the highlight or remove it.
Underline notable text in PDF files. Customize the appearance of the underline or remove it.
Underline notable text in PDF files using the squiggly style. Customize the appearance of the squiggly or remove it.
Strike through unimportant text in PDF files. Customize the appearance of the strikethrough or remove it.
Draw freehand on the pages of PDF files. Move, resize, remove, or edit the appearance of the freehand drawings.
Erase unwanted ink strokes to correct mistakes made in freehand drawing using the ink tool.
Include lines in PDF files. Move, resize, remove, or edit the appearance of the lines.
Include arrows in PDF files. Move, resize, remove, or edit the appearance of the arrows.
Include rectangles in PDF files. Move, resize, remove, or edit the appearance of the rectangles.
Include ellipses and circles in PDF files. Move, resize, remove, or edit the appearance of the ellipses.
Include polygons in PDF files. Move, resize, remove, or edit the appearance of the polygons.
Include clouds in PDF files. Move, resize, remove, or edit the appearance of the clouds.
Include polylines in PDF files. Move, resize, remove, or edit the appearance of the polyline annotations.
Include free text in PDF files. Move, resize, remove, or edit the appearance of the free text.
Add custom stamp annotations to the PDF files. The stamps can be resized, moved, removed, and saved.
Add sticky note annotations to PDF files. The sticky notes can be edited, moved, removed, and saved.
Restrict edit permissions to modify or remove annotations in a document. Locked annotations can also be unlocked.
Add handwritten signatures to PDF files. The signatures can be resized, moved, removed, and saved.
Fill, edit, flatten, and save AcroForms fields in PDF files.
Convert the pages of PDF files to images in JPG, PNG, and BMP formats.
The Xamarin PDF Viewer supports the import and export of annotations and form data.
Import and export annotations in FDF and XFDF formats.
Import and export form data in FDF, XFDF, XML, and JSON formats.
All static text within the PDF Viewer can be localized to any supported language.
The Syncfusion Xamarin PDF Viewer supports the following features:
You can find our Xamarin PDF Viewer demo, which demonstrates how to render and configure PDF Viewer.
No, this is a commercial product and requires a paid license. However, a free community license is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue, 5 or fewer developers, and 10 or fewer total employees.
A good place to start would be our comprehensive getting started documentation.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.