Skip to content

Commit 806f902

Browse files
Merge pull request #3 from Aulma/patch-1
2 parents c3cb5b2 + e29e45e commit 806f902

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff 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"
103124
xmlns: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);
157178
pdfViewer.Source = PdfSource.FromFile("/path/to/encrypted.pdf", "password");
158179
```
159180

160-
### 4. Handle Events
181+
### 5. Handle Events
161182

162183
```csharp
163184
private void OnDocumentLoaded(object sender, DocumentLoadedEventArgs e)

0 commit comments

Comments
 (0)