Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions Document-Processing-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,6 @@
<li>
<a href="/document-processing/pdf/pdf-viewer/maui/Overview">.NET MAUI</a>
<ul>
<li><a href="/document-processing/pdf/pdf-viewer/maui/Overview">Overview</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/maui/Getting-Started">Getting Started</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/maui/Migration">Migrate from Xamarin.Forms</a></li>
<li>
Expand Down Expand Up @@ -2506,14 +2505,14 @@
<li>
<a href="/document-processing/pdf/pdf-viewer/uwp/overview">UWP</a>
<ul>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/overview">Overview</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/getting-started">Getting Started</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Viewing-PDF">Viewing PDF</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Customizing-progress-ring">Customizing progress ring</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Working-with-magnification">Working with magnification</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Working-with-text-search">Working with text search</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Select-And-Copy-Text">Working with text selection</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Working-with-page-navigation">Working with page navigation</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Supported-input-interactions">Supported input interactions</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Printing-PDF">Printing PDF</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Working-with-annotations">Working with annotations</a></li>
<li><a href="/document-processing/pdf/pdf-viewer/uwp/Concepts-and-Features/Working-with-text-markup-annotation">Working with text markup annotations</a></li>
Expand Down
1 change: 1 addition & 0 deletions Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ To navigate using the UI:

![Custom bookmark in .NET MAUI PDF Viewer](Images\custom-bookmark.png)

N>A custom bookmark currently stores only the target page information. It does not support storing or navigating to a specific position within the page, such as coordinates or a particular content region.
### Navigate Programmatically

To navigate to a custom bookmark programmatically, use the [GoToBookmark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToBookmark_Syncfusion_Maui_PdfViewer_Bookmark_) method. This method accepts a `Bookmark` object and navigates to the page associated with it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne

The PDF viewer allows navigating from one part of the PDF document to another using document link annotations. When a document link annotation is tapped, the PDF viewer scrolls to the destination page or location defined by that annotation. This type of annotation is most commonly used to make a PDF's table of contents interactive — each entry links directly to the corresponding page in the document.

![TOC Navigation](Images/TOCNavigation.gif)

N> Document link annotations differ from hyperlink annotations. Document links navigate **within** the same PDF document, while hyperlinks open an external URL in the device browser. See [Hyperlink Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/hyperlink-navigation) for details on handling external links.

## Enable or Disable Document Link Navigation
Expand Down
41 changes: 41 additions & 0 deletions Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,47 @@ Private void customDialogOkButton_Clicked(object sender, EventArgs e)

Button form fields will be rendered in the PDF viewer. But the PDF viewer supports only the `GoTo` actions that navigates to a particular location in the PDF document alone. Other types of button actions are not supported.

## Flatten form fields only on save

The [FlattenOnSave](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_FlattenOnSave) property converts form fields into non-editable content only when the PDF document is saved. This means the form fields remain editable while the document is open, and are flattened (made part of the document content) during the save operation, preventing any further modification afterward.

### Flatten specific form fields

You can selectively flatten specific form fields, such as signature fields, by iterating through the form field collection.

{% tabs %}
{% highlight c# %}

foreach (var item in pdfViewer.FormFields)
{
//Iterate Only signature form field and flatten it
if (item is SignatureFormField signature)
{
item.FlattenOnSave = true;
}
}

{% endhighlight %}
{% endtabs %}

### Flatten all form fields

To flatten all form fields in the document, set the FlattenOnSave property for each field:

{% tabs %}
{% highlight c# %}

//Iterate all the form fields and set flatten
foreach (var item in pdfViewer.FormFields)
{
item.FlattenOnSave = true;
}

{% endhighlight %}
{% endtabs %}

N>This property does not immediately change the UI; it is applied during the save operation.

## See Also
- [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview)
- [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,22 @@ The following example exports form data to an XFDF file in the application's dat

{% tabs %}
{% highlight C# %}
void ExportFormData()
{
string targetFile = Path.Combine(FileSystem.Current.AppDataDirectory, "ExportedFormData.xfdf");
FileStream fileStream = File.Create(targetFile);

pdfViewer.ExportFormData(fileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf);
SfPdfViewer PdfViewer = new SfPdfViewer();
PdfViewer.LoadDocumentAsync(PdfStream);

// Add the SfPdfViewer instance to the grid's children collection to ensure it's part of the visual tree.
myGrid.Children.Add(PdfViewer);

// Subscribe to the DocumentLoaded event to handle operations once the PDF document is fully loaded.
PdfViewer.DocumentLoaded += PdfViewer_DocumentLoaded;
private void PdfViewer_DocumentLoaded(object? sender, EventArgs? e)
{
using (var fileStream = File.Create("D://SavedForm.json"))
{
if(sender is SfPdfViewer pdfViewer)
pdfViewer.ExportFormData(fileStream, Syncfusion.Pdf.Parsing.DataFormat.Json);
}
}
{% endhighlight %}
{% endtabs %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne

# Form Filling in .NET MAUI PDF Viewer (SfPdfViewer)

The .NET MAUI PDF Viewer [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) enables users to view and fill AcroForm-based PDF forms across mobile and desktop apps. It supports interactive form filling through the built-in UI, and developers can access and modify form data programmatically using the `FormFields` API.
The .NET MAUI PDF Viewer [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) enables users to view and fill AcroForm-based PDF forms across mobile and desktop apps. It supports interactive form filling through the built-in UI, and developers can access and modify form data programmatically using the [FormFields](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) API.

The viewer supports saving filled forms, flattening form fields to make them non-editable, and importing or exporting form data in FDF, XFDF, JSON, and XML formats. These capabilities make the viewer ideal for capturing and handling form data efficiently within your application.

Expand Down
39 changes: 25 additions & 14 deletions Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ namespace PdfViewerExample

Open the `MainPage.xaml` file and follow the steps below.

1. Import the control namespace `Syncfusion.Maui.PdfViewer`, and then add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control inside the `<ContentPage.Content>` tag as follows.
2. Name the PDF viewer control as `pdfViewer`.
1. Import the control namespace `Syncfusion.Maui.PdfViewer`,
2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control inside the `<ContentPage.Content>` tag.
3. Name the PDF viewer control as `pdfViewer`.

{% tabs %}
{% highlight xaml tabtitle="MainPage.xaml" %}
Expand Down Expand Up @@ -183,7 +184,7 @@ namespace PdfViewerExample
{% endtabs %}

N> 1. While changing or opening different documents on the same page, the previously loaded document will be unloaded automatically by the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html).
N> 2. And, if you are using multiple pages in your application, then make sure to unload the document from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) while leaving the page that has it to release the memory and resources consumed by the PDF document that is loaded. The unloading of documents can be done by calling the [UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method.
N> 2. If you are using multiple pages in your application, then make sure to unload the document from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) while leaving the page that has it to release the memory and resources consumed by the PDF document that is loaded. The unloading of documents can be done by calling the [UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method.

## Step 6: Running the Application

Expand Down Expand Up @@ -246,12 +247,13 @@ namespace PdfViewerExample
{% endhighlight %}
{% endtabs %}

## Step 4: Add PDF Viewer to the Project
## Step 4: Add PDF Viewer

Open the `MainPage.xaml` file and follow the steps below.

1. Import the control namespace `Syncfusion.Maui.PdfViewer`, and then add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control inside the `<ContentPage.Content>` tag as follows.
2. Name the PDF viewer control as `pdfViewer`.
1. Import the control namespace `Syncfusion.Maui.PdfViewer`,
2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control inside the `<ContentPage.Content>` tag.
3. Name the PDF viewer control as `pdfViewer`.

{% tabs %}
{% highlight xaml tabtitle="MainPage.xaml" %}
Expand Down Expand Up @@ -355,6 +357,7 @@ namespace PdfViewerExample
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer"
xmlns:local="clr-namespace:PdfViewerExample"
x:Class="PdfViewerExample.MainPage">

<ContentPage.BindingContext>
Expand All @@ -371,7 +374,7 @@ namespace PdfViewerExample
{% endtabs %}

N> 1. While changing or opening different documents on the same page, the previously loaded document will be unloaded automatically by the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html).
N> 2. And, if you are using multiple pages in your application, then make sure to unload the document from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) while leaving the page that has it to release the memory and resources consumed by the PDF document that is loaded. The unloading of documents can be done by calling the [UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method.
N> 2. If you are using multiple pages in your application, then make sure to unload the document from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) while leaving the page that has it to release the memory and resources consumed by the PDF document that is loaded. The unloading of documents can be done by calling the [UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method.

## Step 6: Running the Application

Expand Down Expand Up @@ -401,7 +404,15 @@ Before proceeding, ensure the following are set up:

1. In **Solution Explorer,** right-click the project and choose **Manage NuGet Packages.**
2. Search for [Syncfusion.Maui.PdfViewer](https://www.nuget.org/packages/Syncfusion.Maui.PdfViewer/) and install the latest version.
3. Ensure the necessary dependencies are installed correctly, and the project is restored. If not, open the Terminal in Rider and manually run: `dotnet restore`.
3. Ensure the necessary dependencies are installed correctly, and the project is restored. If not, open the Terminal in Rider and manually run the following code.

{% tabs %}
{% highlight c# tabtitle="terminal" %}

dotnet restore

{% endhighlight %}
{% endtabs %}

## Step 3: Register the Syncfusion<sup>®</sup> Core Handler

Expand Down Expand Up @@ -438,8 +449,9 @@ namespace PdfViewerExample

Open the `MainPage.xaml` file and follow the steps below.

1. Import the control namespace `Syncfusion.Maui.PdfViewer`, and then add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control inside the `<ContentPage.Content>` tag as follows.
2. Name the PDF viewer control as `pdfViewer`.
1. Import the control namespace `Syncfusion.Maui.PdfViewer`.
2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control inside the `<ContentPage.Content>` tag.
3. Name the PDF viewer control as `pdfViewer`.

{% tabs %}
{% highlight xaml tabtitle="MainPage.xaml" %}
Expand Down Expand Up @@ -559,7 +571,7 @@ namespace PdfViewerExample
{% endtabs %}

N> 1. While changing or opening different documents on the same page, the previously loaded document will be unloaded automatically by the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html).
N> 2. And, if you are using multiple pages in your application, then make sure to unload the document from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) while leaving the page that has it to release the memory and resources consumed by the PDF document that is loaded. The unloading of documents can be done by calling the [UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method.
N> 2. If you are using multiple pages in your application, then make sure to unload the document from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) while leaving the page that has it to release the memory and resources consumed by the PDF document that is loaded. The unloading of documents can be done by calling the [UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method.

## Step 6: Running the Application

Expand All @@ -571,7 +583,7 @@ N> 2. And, if you are using multiple pages in your application, then make sure t
{% endtabcontents %}
![Getting started with .NET MAUI PDF Viewer](Images\Getting-Started\maui-pdf-viewer-getting-started.png)

The **Getting Started** example project for the .NET MAUI PDF Viewer can be downloaded [here](https://github.com/SyncfusionExamples/maui-pdf-viewer-examples). 
The **Getting Started** example project for the .NET MAUI PDF Viewer can be downloaded [here](https://github.com/SyncfusionExamples/maui-pdf-viewer-examples/tree/master/Getting%20Started). 

N> You can refer to our [.NET MAUI PDF Viewer](https://www.syncfusion.com/maui-controls/maui-pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [.NET MAUI PDF Viewer Example](https://github.com/syncfusion/pdf-viewer-sdk-net-maui-demos/tree/master/PdfViewer) that shows you how to render the PDF Viewer in .NET MAUI.

Expand All @@ -589,5 +601,4 @@ Now that the PDF Viewer is running, here is a suggested learning path to explore
| 6 | **Customize the toolbar** | Show, hide, add, or remove toolbar items to match your app's workflow. → [Toolbar Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar-customization) |
| 7 | **Redact sensitive content** | Permanently remove confidential text or images before sharing. → [Redaction](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/redaction) |

* [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview)
* [Migration Guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/migration)
* For migration from Xamarin to .NET MAUI, please follow the [Migration Guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/migration).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Document-Processing/PDF/PDF-Viewer/maui/Lock-Unlock.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ void LockAllAnnotations()

* Similarly, to unlock all the annotations, set the [IsLocked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.BaseAnnotationSettings.html#Syncfusion_Maui_PdfViewer_BaseAnnotationSettings_IsLocked) property value to `false`.

N>Setting AnnotationSettings.IsLocked to true locks annotations from being edited or deleted, but it does not prevent users from adding new annotations.
If an annotation read-only experience is required, hide the annotation buttons by using toolbar customization. When the annotation buttons are not available, users cannot add annotations through the built-in UI, and the PDF Viewer behaves like it is in annotation read-only mode.
For more details on customizing the built-in toolbar, refer to the toolbar [documentation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar-customization).

## Lock specific annotation

Expand Down
Loading