Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,28 @@ Install-Package MauiNativePdfView

## 🚀 Quick Start

### 1. Add Namespace
### 1. Add Handler

```csharp
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiNativePdfView() // <--- ADD THIS LINE
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});

return builder.Build();
}
}
```

### 2. Add Namespace

**Option A: Custom Schema (Recommended)**

Expand All @@ -103,7 +124,7 @@ xmlns:pdf="http://eightbot.com/maui/pdfview"
xmlns:pdf="clr-namespace:MauiNativePdfView;assembly=MauiNativePdfView"
```

### 2. Basic XAML
### 3. Basic XAML

```xml
<!-- Simple string binding - auto-converts to PdfSource! -->
Expand Down Expand Up @@ -135,7 +156,7 @@ The library supports automatic string conversion in XAML:
<pdf:PdfView Source="file:///path/to/document.pdf" />
```

### 3. Load a PDF (Code-Behind)
### 4. Load a PDF (Code-Behind)

```csharp
// From file
Expand All @@ -157,7 +178,7 @@ pdfViewer.Source = PdfSource.FromBytes(pdfBytes);
pdfViewer.Source = PdfSource.FromFile("/path/to/encrypted.pdf", "password");
```

### 4. Handle Events
### 5. Handle Events

```csharp
private void OnDocumentLoaded(object sender, DocumentLoadedEventArgs e)
Expand Down