File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,7 +89,28 @@ Install-Package MauiNativePdfView
8989
9090## 🚀 Quick Start
9191
92- ### 1. Add Namespace
92+ ### 1. Add Handler
93+
94+ ``` csharp
95+ public static class MauiProgram
96+ {
97+ public static MauiApp CreateMauiApp ()
98+ {
99+ var builder = MauiApp .CreateBuilder ();
100+ builder
101+ .UseMauiApp <App >()
102+ .UseMauiNativePdfView () // <--- ADD THIS LINE
103+ .ConfigureFonts (fonts =>
104+ {
105+ fonts .AddFont (" OpenSans-Regular.ttf" , " OpenSansRegular" );
106+ });
107+
108+ return builder .Build ();
109+ }
110+ }
111+ ```
112+
113+ ### 2. Add Namespace
93114
94115** Option A: Custom Schema (Recommended)**
95116
@@ -103,7 +124,7 @@ xmlns:pdf="http://eightbot.com/maui/pdfview"
103124xmlns:pdf="clr-namespace:MauiNativePdfView;assembly=MauiNativePdfView"
104125```
105126
106- ### 2 . Basic XAML
127+ ### 3 . Basic XAML
107128
108129``` xml
109130<!-- Simple string binding - auto-converts to PdfSource! -->
@@ -135,7 +156,7 @@ The library supports automatic string conversion in XAML:
135156<pdf : PdfView Source =" file:///path/to/document.pdf" />
136157```
137158
138- ### 3 . Load a PDF (Code-Behind)
159+ ### 4 . Load a PDF (Code-Behind)
139160
140161``` csharp
141162// From file
@@ -157,7 +178,7 @@ pdfViewer.Source = PdfSource.FromBytes(pdfBytes);
157178pdfViewer .Source = PdfSource .FromFile (" /path/to/encrypted.pdf" , " password" );
158179```
159180
160- ### 4 . Handle Events
181+ ### 5 . Handle Events
161182
162183``` csharp
163184private void OnDocumentLoaded (object sender , DocumentLoadedEventArgs e )
You can’t perform that action at this time.
0 commit comments