DevExpress PDF Viewer for .NET MAUI
- 3 minutes to read
Note
The DevExpress .NET MAUI PDF Viewer control requires a license to our Universal Subscription. Without a valid license, you cannot use this control within your .NET MAUI application.
The DevExpress PdfViewer component for .NET MAUI allows you to display PDF documents in your applications.
Review our demo app on GitHub to try out the PdfViewer
control:
PDF Viewer Elements (Anatomy)
The following figure shows basic elements of a PDF viewer:
Add a PDF Viewer to the Page
Before you proceed, read the following topic: Get Started with DevExpress Controls for .NET Multi-platform App UI (.NET MAUI).
The following example adds a PDF viewer to a page:
<ContentPage ...
xmlns:dxpdf="clr-namespace:DevExpress.Maui.Pdf;assembly=DevExpress.Maui.Pdf">
<dxpdf:PdfViewer x:Name="pdfViewer" />
</ContentPage>
The PdfViewer requires that you call the UseSkiaSharp()
method to use the Skia graphics engine to render PDF document pages:
using DevExpress.Maui;
using SkiaSharp.Views.Maui.Controls.Hosting;
namespace DXMauiPdfViewer {
public static class MauiProgram {
public static MauiApp CreateMauiApp() {
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseDevExpress(useLocalization: true)
.UseSkiaSharp()
.ConfigureFonts(fonts => {
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("univia-pro-regular.ttf", "Univia-Pro");
fonts.AddFont("roboto-bold.ttf", "Roboto-Bold");
fonts.AddFont("roboto-regular.ttf", "Roboto");
});
return builder.Build();
}
}
}
DevExpress PDF Document API
The PDF Document API library offers several unique features you may find useful for your PDF Viewer app:
- Export and import interactive form data in code
- Password-protect a document and specify a signature
- Edit form field properties
- Flatten annotations
The following examples show how to use the PDF Document API library in your .NET MAUI App:
- Populate E-Forms in a PDF File
Implements a view that opens a PDF File, obtains form fields, and allows you to populate them.
- Sign PDF Files
Shows how to use Office File API to sign PDF files.
You need an active license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use these features in production code. For pricing information, refer to the following page: DevExpress Subscription Plans.
Next Steps
- Load Document to PDF Viewer
- This topic explains how to load PDF files to the PDF viewer control.
- Page Navigation
- This topic describes how to navigate through PDF file pages and content.
- Select and Highlight Content
- This document explains how to select content and apply marking effects to text.
- Add Annotations
- This topic explains how to add different graphic annotations to a PDF document.
- Sign Documents
- This document explains how users can sign PDF documents.
- Commands
- This topic lists PDF viewer commands you can use to implement custom toolbars.