From 827ff1961bb019ff1d9db9bfe2d7e58b734fdb34 Mon Sep 17 00:00:00 2001 From: AbinayaEruthayaraj Date: Mon, 6 Jul 2026 19:38:18 +0530 Subject: [PATCH 001/127] Updated the getting started file for flutter pdfviewer control. --- .../PDF/PDF-Viewer/flutter/getting-started.md | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md b/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md index 43eb7a3167..cf724eda23 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md @@ -1,6 +1,6 @@ --- layout: post -title: Getting started with Flutter PDF Viewer widget | Syncfusion +title: Getting Started with Flutter PDF Viewer Widget | Syncfusion description: Learn here about getting started with Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget, its elements, and more. platform: document-processing control: SfPdfViewer @@ -18,34 +18,33 @@ To get started quickly, you can also check out our video tutorial below. Create a simple project using the instructions given in the [Getting Started with your first Flutter app](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation. ## Install the Flutter PDF Viewer package -Install the [Syncfusion® Flutter PDF Viewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer/versions) package to your project by run the following command in your project’s terminal: +Install the [Syncfusion® Flutter PDF Viewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer/versions) package to your project by running the following command in your project’s terminal: {% tabs %} -{% highlight yaml tabtitle="powershell" %} +{% highlight tabtitle="powershell" %} flutter pub add syncfusion_flutter_pdfviewer {% endhighlight %} {% endtabs %} -## Specify the asset path -Add the asset path to your `pubspec.yaml` file under the flutter section. +## Specify Asset Path +Create an assets folder in the project root, add a sample PDF file (for example, flutter-succinctly.pdf) to it, and specify the asset path in `pubspec.yaml` file under the flutter section. {% tabs %} {% highlight yaml tabtitle="pubspec.yaml" %} flutter: - -assets: -   - assets/ + assets: +   - assets/ {% endhighlight %} {% endtabs %} -## Add the script tags -For the web platform, we have used [PdfJs](https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js) for rendering the PDF pages, so the script file must be referred to in your `web/index.html` file. +## Add Script Tags +For the web platform, we have used [PdfJs](https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js) for rendering the PDF pages, so the script files must be added to your `web/index.html` file. -In your `web/index.html` file, add the following `script` tags, somewhere in the `head` or `body` of the document: +In your `web/index.html` file, add the following `script` tags, in the `body` of the document: For PdfJs library version 4.0 and above: {% tabs %} @@ -71,23 +70,22 @@ For PdfJs library versions below 4.0: {% endhighlight %} {% endtabs %} -N> A version above **2.11.338** is recommended for using annotation support. This will not flatten the unsupported annotations while rendering the pages. - +N> A version above **2.11.338** is recommended for using annotation support. Unsupported annotations are preserved rather than flattened during rendering. ## Import Package In the `main.dart` file, import the required package. {% tabs %} -{% highlight Dart %} +{% highlight dart %} import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; {% endhighlight %} {% endtabs %} -## Add the SfPdfViewer widget and load document -In the `main.dart` file, replace the build method with the following code to display the PDF using SfPdfViewer +## Add the SfPdfViewer Widget and Load Document +In the `main.dart` file, replace the build method with the following code to display the PDF using [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html). {% tabs %} {% highlight dart hl_lines="4" %} From 073fdd943724ad72644e4b6a4abbd29b78528409 Mon Sep 17 00:00:00 2001 From: jeyalakshmit Date: Thu, 9 Jul 2026 16:17:06 +0530 Subject: [PATCH 002/127] 1039209: Update the XPS to PDF converter NuGet package details in this UG page --- .../NET/NuGet-Packages-Required.md | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md b/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md index f85413bbe9..e6167e9992 100644 --- a/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md +++ b/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md @@ -108,7 +108,6 @@ N> 2. From the Essential Studio® 2018 Volume 3 release(v16.3.0.21 For advanced PDF features like compression, redaction, PDF/A conversion, image extraction, and OCR, include the corresponding Syncfusion® imaging package in your .NET Core applications: - @@ -160,6 +159,29 @@ For advanced PDF features like compression, redaction, PDF/A conversion, image e
+### Converting XPS to PDF + +For converting XPS to PDF, the following NuGet packages need to to be installed in your .NET application from [nuget.org](https://www.nuget.org/). + + + + + + + + + + + + + + +
Platform(s)NuGet Package
+ ASP.NET Core + + {{'[Syncfusion.XpsToPdfConverter.Net.Core.nupkg](https://www.nuget.org/packages/Syncfusion.XpsToPdfConverter.Net.Core)'| markdownify }} +
+ ### Additional NuGet packages required for Linux The SkiaSharp native assets NuGet package is required as additional dependency in your application created for deploying in Linux environments. There are 2 types of NuGet packages, please choose the correct NuGet package based on your Linux environment. From 1419d916aac2913f10d649e5f071274f1bb63d64 Mon Sep 17 00:00:00 2001 From: jeyalakshmit Date: Thu, 9 Jul 2026 17:07:10 +0530 Subject: [PATCH 003/127] 1039209-feedback updated --- .../PDF/PDF-Library/NET/NuGet-Packages-Required.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md b/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md index e6167e9992..282cf298d0 100644 --- a/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md +++ b/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md @@ -161,7 +161,7 @@ For advanced PDF features like compression, redaction, PDF/A conversion, image e ### Converting XPS to PDF -For converting XPS to PDF, the following NuGet packages need to to be installed in your .NET application from [nuget.org](https://www.nuget.org/). +To convert XPS documents to PDF, install the following required NuGet packages in your .NET application. @@ -204,7 +204,6 @@ The following table illustrates the native assets NuGet package with their match Common Linux distributions such as Ubuntu, Alpine, CentOS, Debian, Fedora, and RHEL Azure App Service Google App Engine - From 3dbb6d9ee104e60ce265615cd83d5dd55e017bf1 Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Wed, 8 Jul 2026 19:05:21 +0530 Subject: [PATCH 004/127] UG Document correction using Code-Studio AI --- .../maui/Add-Remove-Modify-Annotations.md | 32 ++++-- .../PDF-Viewer/maui/Annotation-Collection.md | 29 +++-- .../PDF-Viewer/maui/Annotations-Comment.md | 71 ++++++++---- .../PDF-Viewer/maui/Annotations-Overview.md | 37 +++--- .../PDF-Viewer/maui/Coordinates-Conversion.md | 46 +++++--- .../PDF/PDF-Viewer/maui/Custom-Bookmark.md | 60 +++++++--- .../maui/Document-Link-Annotations.md | 18 ++- .../PDF/PDF-Viewer/maui/Document-Outline.md | 36 ++++-- .../maui/DocumentLoadNotifications.md | 38 +++++-- .../maui/Form-Filling-Collection.md | 39 ++++--- .../maui/Form-Filling-Customization.md | 36 +++--- .../PDF/PDF-Viewer/maui/Form-Filling-Edit.md | 47 ++++---- .../PDF-Viewer/maui/Form-Filling-Events.md | 62 ++++++---- .../maui/Form-Filling-Import-Export.md | 73 ++++++++---- .../PDF-Viewer/maui/Form-Filling-Overview.md | 18 ++- .../PDF/PDF-Viewer/maui/Free-Text.md | 58 ++++++---- .../PDF/PDF-Viewer/maui/Getting-Started.md | 54 +++++---- .../PDF/PDF-Viewer/maui/Magnification.md | 32 ++++-- .../PDF/PDF-Viewer/maui/Overview.md | 68 +++++++---- .../PDF/PDF-Viewer/maui/Redaction.md | 107 +++++++++--------- .../PDF/PDF-Viewer/maui/Scrolling.md | 40 +++---- .../PDF/PDF-Viewer/maui/Shapes.md | 106 ++++++++--------- .../PDF/PDF-Viewer/maui/Undo-Redo.md | 27 +++-- .../PDF/PDF-Viewer/maui/ui-builder-skill.md | 81 ++++++------- 24 files changed, 758 insertions(+), 457 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md b/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md index 0091ebbe08..6612caba95 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md @@ -10,15 +10,23 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Add, Remove, and Edit Annotations -This section will review the various functions in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for adding, removing, and editing annotations in a PDF document. +This section explains the various functions in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for adding, removing, and editing annotations in a PDF document. ## Add annotations to a PDF document -This section will go through how to add annotations to a PDF document programmatically. +This section explains how to add annotations to a PDF document programmatically. ### Add annotations programmatically -You can add a new annotation to the PDF document programmatically by creating an annotation instance and providing it as a parameter to the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The following example shows how to create an instance of a circle annotation and add it to the PDF document. Similarly, you can create and add other types of annotations. +You can add a new annotation to the PDF document programmatically by creating an annotation instance and providing it as a parameter to the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The following example shows how to create an instance of a circle annotation and add it to the PDF document. Similarly, you can create and add other types of annotations. For more information on the available annotation types, refer to the [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview). + +To work with annotations, ensure the following namespaces are imported in your code file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} {% tabs %} {% highlight c# %} @@ -65,7 +73,7 @@ private void OnAnnotationAdded(object sender, AnnotationEventArgs e) ## Remove annotations from the PDF document -This section will go through different methods of removing annotations from a PDF document. +This section explains different methods of removing annotations from a PDF document. ### Remove a specific annotation @@ -123,7 +131,7 @@ private void OnAnnotationRemoved(object sender, AnnotationEventArgs e) ## Edit annotations -This section will go through different methods of editing annotations in a PDF document programmatically. +This section explains different methods of editing annotations in a PDF document programmatically. The `AddAnnotation`, `RemoveAnnotation`, and property modifications on the annotations each raise their respective events: [AnnotationAdded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded), [AnnotationRemoved](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved), and [AnnotationEdited](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited). ### Edit a specific annotation @@ -174,14 +182,14 @@ private void OnAnnotationEdited(object sender, AnnotationEventArgs e) {% endhighlight %} {% endtabs %} -### Adding custom information to an annotation +## Adding custom information to an annotation -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to assign custom information to annotations. The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property is utilized to store additional information about each annotation instance for reference. However, it's essential to note that these data are solely intended for reference purposes and will not be displayed in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) interface. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to assign custom information to annotations. The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property is utilized to store additional information about each annotation instance for reference. However, it's essential to note that this data is solely intended for reference purposes and will not be displayed in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) interface. -The provided code sample illustrates how to set the [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property for an annotation. Within this code sample, we set the custom data to represent the creation date of the annotation. +The provided code sample illustrates how to set the [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property for an annotation. In this code sample, the custom data is set to represent the creation date of the annotation. {% tabs %} -{% highlight C# %} +{% highlight c# %} private void OnAnnotationAdded(object sender, AnnotationEventArgs e) { @@ -196,3 +204,9 @@ private void OnAnnotationAdded(object sender, AnnotationEventArgs e) - [Select and Deselect Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/select-deselect-annotations) - [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) - [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) +- [Shapes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/shapes) +- [Text Markups](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups) +- [Ink](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink) +- [Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) +- [Stamps](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/stamps) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md index d0fd992116..0d1e0eeeb2 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md @@ -10,7 +10,19 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Annotation Collection in .NET MAUI PDF Viewer (SfPdfViewer) -The existing annotations in a PDF document can be accessed using the [Annotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This read only property will have the annotation collection information as soon as the document is loaded into the PDF Viewer. The following example explains how to use the property to obtain information about a square annotation that is the first on a specific document. +The existing annotations in a PDF document can be accessed using the [Annotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This read-only property will have the annotation collection information as soon as the document is loaded into the PDF Viewer. + +To work with the annotation collection, ensure the following namespaces are imported in your code file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using Microsoft.Maui.Graphics; +using System.Collections.ObjectModel; +{% endhighlight %} +{% endtabs %} + +The following example explains how to use the property to obtain information about the first annotation in a specific document. {% tabs %} {% highlight c# %} @@ -42,7 +54,8 @@ private void OnDocumentLoaded(object sender, EventArgs e) {% endtabs %} ## AnnotationsLoaded event -The [AnnotationsLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationsLoaded) event occurs after all annotations in the PDF have finished loading, either when the document is opened or when annotations are imported. You can use this event to perform actions once annotations are fully available in the viewer. + +The [AnnotationsLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationsLoaded) event occurs after all annotations in the PDF have finished loading, either when the document is opened or when annotations are imported. The `AnnotationsLoaded` event fires after the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event, once all annotations are fully available in the viewer. You can use this event to perform actions once annotations are fully available in the viewer. The following example explains how to wire and handle the event. {% tabs %} @@ -51,10 +64,10 @@ The following example explains how to wire and handle the event. void WireAnnotationsLoadedEvent() { // Wire the annotations loaded event of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). - pdfViewer.AnnotationsLoaded += OnAnnotationsLoaded; + PdfViewer.AnnotationsLoaded += OnAnnotationsLoaded; } -private void OnAnnotationsLoaded(object? sender, EventArgs e) +private void OnAnnotationsLoaded(object sender, EventArgs e) { Debug.WriteLine("All annotations have been loaded."); } @@ -63,6 +76,8 @@ private void OnAnnotationsLoaded(object? sender, EventArgs e) {% endtabs %} ## See Also -- [Add, Remove, and Modify Annotations](../add-remove-modify-annotations) -- [Annotations Overview](../annotations-overview) -- [Select and Deselect Annotations](../select-deselect-annotations) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) +- [Select and Deselect Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/select-deselect-annotations) +- [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) +- [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md index 23efabc7cb..f1dbf26573 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md @@ -9,6 +9,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne --- # Comments in .NET MAUI PDF Viewer (SfPdfViewer) + The PDF Viewer control provides options to add, edit, and delete comments for the following annotations in PDF documents: 1. Ink annotation 2. Shape annotation @@ -18,8 +19,25 @@ The PDF Viewer control provides options to add, edit, and delete comments for th 6. Free text annotation 7. Signature annotation -## Showing/Hiding the Comment panel +## Showing or hiding the comment panel The built-in Comment Panel in the PDF Viewer displays annotation comments. You can show or hide this panel using the [IsCommentsPanelVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsCommentsPanelVisible) property. The default value of this property is false. + +To work with the PDF Viewer and comments in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: + +{% tabs %} +{% highlight xml %} +xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} + {% tabs %} {% highlight c# %} @@ -30,7 +48,7 @@ PdfViewer.IsCommentsPanelVisible = true; {% endtabs %} {% tabs %} -{% highlight XAML %} +{% highlight xaml %} @@ -40,7 +58,8 @@ PdfViewer.IsCommentsPanelVisible = true; ## Comment panel -Annotation comments can be added to the PDF using the comment panel. Comment panel can be opened by using Built-in toolbar, In the toolbar you can see the comments button in the primary toolbar for desktop and top toolbar for mobile. The comment panel displays all annotations in the document along with their comments and replies, allowing you to add comments to any annotation and reply to existing comments or annotations. + +Annotation comments can be added to the PDF using the comment panel. The comment panel can be opened using the built-in toolbar. In the toolbar, you can find the Comments button in the primary toolbar for desktop and in the top toolbar for mobile. The comment panel displays all annotations in the document along with their comments and replies, allowing you to add comments to any annotation and reply to existing comments or annotations. The following image represents how to add the comments using the toolbar on the desktop. ![Annotations comments Built-in toolbar](Images/Annotations/desktop-comment.gif) @@ -50,16 +69,18 @@ The following image represents how to add comments using the toolbar on mobile. ![Annotations comments Built-in toolbar](Images/Annotations/mobile-comment.gif) ## Adding comments or replies -Follow these steps to add comments or replies : + +Follow these steps to add comments or replies: 1. Select the annotation in the PDF document and open the comment panel. 2. The corresponding comment thread is highlighted in the comment panel. -3. Add comments and replies using the comment panel. -4. Using the reply button in the comment panel, you can add a comment directly to a specific annotation, ensuring the discussion stays linked to that annotation. +3. Add a comment using the comment input area. +4. To reply to an existing comment or annotation, use the Reply button in the comment panel. This keeps the discussion linked to that annotation. 5. Multiple replies can be added to a comment. ## Add comments or replies programmatically -These can add comments or replies to existing annotations programmatically by accessing the specific annotation from the Annotations collection. This allows you to enhance collaboration and provide feedback directly within the PDF. -The following example explains how to add comments or replies to specific annotations in the PDF document. + +You can add comments or replies to existing annotations programmatically by accessing the specific annotation from the Annotations collection. This allows you to enhance collaboration and provide feedback directly within the PDF. +The following example explains how to add comments or replies to a specific annotation in the PDF document. {% tabs %} {% highlight c# %} @@ -77,22 +98,32 @@ annotation.Comments.Add(comment); {% endhighlight %} {% endtabs %} -## Editing the comments and comments replies of the annotations -Comments and replies can be edited through the context menu available under the More Options in the Comment Panel. Follow the steps below: -Select the annotation comment in the comment panel. +## Editing comments and replies + +Comments and replies can be edited through the context menu available under More Options in the Comment Panel. Follow the steps below: +1. Select the annotation comment in the comment panel. +2. Click More Options in the comment or reply container. +3. Select Edit from the context menu. +4. An editable text box appears. Change the content of the comment or reply. -1. Click More options in the comment or reply to container. -2. Select Edit from the context menu. -3. An editable text box appears. Change the content of the comment or reply. +## Deleting comments and replies -## Delete Comment or Comment Replies -Comments and replies can be deleted through the context menu available under the More Options in the Comment Panel. Follow the steps below: +Comments and replies can be deleted through the context menu available under More Options in the Comment Panel. Follow the steps below: 1. Select the annotation comment in the comment panel. -2. Click More options in the comment or reply to container. +2. Click More Options in the comment or reply container. 3. Select Delete from the context menu. -**Note :** Deleting the root comment from the comment panel also deletes the associated annotation. +**Note:** Deleting the root comment from the comment panel also deletes the associated annotation. ## See Also -- [Add, Remove, and Modify Annotations](../add-remove-modify-annotations) -- [Annotations Overview](../annotations-overview) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) +- [Annotation Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotation-collection) +- [Ink](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink) +- [Shapes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/shapes) +- [Stamps](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/stamps) +- [Sticky Notes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/sticky-notes) +- [Free Text](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/free-text) +- [Text Markups](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups) +- [Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md index 81f8f00195..8efeadc59e 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md @@ -18,11 +18,11 @@ To learn how to work with annotations, you can also check out our video tutorial -## Supported Annotation Types +## Supported annotation types The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the following annotation types, grouped by category. -### Text Markup Annotations +### Text markup annotations Use these annotations to mark up text content within the PDF document. @@ -35,7 +35,7 @@ Use these annotations to mark up text content within the PDF document. For more information, see [Text Markup Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups). -### Shape Annotations +### Shape annotations Use these annotations to draw geometric shapes over PDF content. @@ -50,7 +50,9 @@ Use these annotations to draw geometric shapes over PDF content. For more information, see [Shape Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/shapes). -### Freehand and Rich Content Annotations +### Freehand and rich content annotations + +Use these annotations to draw freehand strokes or add rich content such as text boxes, stamps, and notes over PDF content. | Annotation | Description | |---|---| @@ -62,35 +64,24 @@ For more information, see [Shape Annotations](https://help.syncfusion.com/docume For more information, see [Ink Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink), [Free Text Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/free-text), [Stamps](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/stamps), and [Sticky Notes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/sticky-notes). -## In This Section - -### Annotation Types - -| Topic | Description | -|---|---| -| [Text Markup Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups) | Highlight, underline, strikeout, and squiggly annotations on selected text. | -| [Shape Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/shapes) | Draw arrows, circles, lines, polygons, polylines, and rectangles over pages. | -| [Ink Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink) | Draw freehand strokes over any page area. | -| [Ink Eraser](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink-eraser) | Erase portions of existing ink annotations. | -| [Free Text Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/free-text) | Place a text box directly on the page. | -| [Stamps](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/stamps) | Apply predefined or custom image stamps on a page. | -| [Sticky Notes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/sticky-notes) | Attach pop-up notes to specific locations on a page. | +## Common annotation operations -### Common Annotation Operations +The following topics describe common operations that apply across annotation types. | Topic | Description | |---|---| -| [Add, Remove, and Modify Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) | Programmatically add, update, and delete any annotation type. | +| [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) | Programmatically add, update, and delete any annotation type. | | [Annotation Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotation-collection) | Access and iterate the full annotation collection. | | [Select and Deselect Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/select-deselect-annotations) | Select one or more annotations programmatically. | | [Lock and Unlock Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/lock-unlock) | Prevent annotations from being edited or deleted. | | [Show and Hide Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/show-hide) | Toggle visibility of annotations without removing them. | | [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) | Import/export annotation data in XFDF, FDF, JSON, and XML formats. | | [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) | Reverse or reapply recent annotation changes. | -| [Annotation Comments](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-comment) | Add review comments and status to annotations. | +| [Comments](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-comment) | Add review comments and replies to annotations. | ## See Also -- [Add, Remove, and Modify Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) -- [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) + - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) -- [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [Keyboard Shortcuts](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/keyboard-shortcuts) +- [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md b/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md index 8802bc9bf6..d7237b396f 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md @@ -12,11 +12,21 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne PDF Viewer allows users to obtain the PDF page coordinates relative to the PDF Viewer’s client coordinates and vice versa. It also allows you to obtain the scroll point relative to the PDF page coordinates and bring the given region into view. +To work with coordinate conversions, ensure the following namespaces are imported in your code file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using Microsoft.Maui.Graphics; +using System.Collections.ObjectModel; +{% endhighlight %} +{% endtabs %} + ## Client rectangle -The [ClientRectangle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) in the MAUI PdfViewer control is a rectangular area that represents the dimensions of the client area or viewport. The client area denotes the visible portion of the PDF document within the control. In the MAUI PDF Viewer, this client rectangle is illustrated by the red rectangle in the following figure. +The [ClientRectangle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) in the MAUI PdfViewer control is a rectangular area that represents the dimensions of the client area or viewport. The client area denotes the visible portion of the PDF document within the control. In the MAUI PDF Viewer, this client rectangle is illustrated by the red rectangle in the following figure. -![Client rectangle in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Client-Rectangle.png) +![Client rectangle in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Client-Rectangle.png) The client rectangle can be obtained by the [ClientRectangle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) property of the PDF Viewer. The following code sample explains the same. @@ -29,9 +39,9 @@ Rect clientRectangle = PdfViewer.ClientRectangle; ## Client coordinates -The MAUI PDF Viewer specifies the position of points in the client area(viewport) using client coordinates. The upper-left corner of the client area (viewport) of the control is the origin for client coordinates. The client coordinates in the MAUI PDF Viewer are shown in the following figure. +The MAUI PDF Viewer specifies the position of points in the client area (viewport) using client coordinates. The upper-left corner of the client area (viewport) of the control is the origin for client coordinates. The client coordinates in the MAUI PDF Viewer are shown in the following figure. -![Client coordinates in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Client-Coordinates.png) +![Client coordinates in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Client-Coordinates.png) ### Get the page number from a client point @@ -55,15 +65,15 @@ private void PdfViewer_Tapped(object sender, GestureEventArgs e) ## PDF page coordinates -PDF page coordinates are represented in terms of a device-independent coordinate system called user space, which is independent of the output device that will be used for printing or display. The user space coordinates system is initialized to a default state for each page of a PDF document. The length of a unit is 1/72 inch, which is approximately the same as a unit of point(pt). As an example, the dimensions of a letter-sized paper in PDF page coordinates are shown in the diagram below. +PDF page coordinates are represented in terms of a device-independent coordinate system called user space, which is independent of the output device that will be used for printing or display. The user space coordinates system is initialized to a default state for each page of a PDF document. The length of a unit is 1/72 inch, which is equivalent to one point (pt). As an example, the dimensions of a letter-sized paper in PDF page coordinates are shown in the diagram below. -![Page coordinates in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Page-Coordinates.png) +![Page coordinates in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Page-Coordinates.png) ## Scroll coordinates -Scroll coordinates in the MAUI PdfViewer denote pixel-based positions as pages are scrolled, indicating precise locations within the entire document. The coordinate system originates from the top-left corner of the visible area. +Scroll coordinates in the MAUI PDF Viewer denote pixel-based positions as pages are scrolled. They indicate precise locations within the entire document. The coordinate system originates from the top-left corner of the visible area. -## Convert PDF Viewer’s coordinates to PDF page coordinates +## Convert PDF Viewer's coordinates to PDF page coordinates You can obtain the PDF page coordinates using the [ConvertClientPointToPagePoint(clientPoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertClientPointToPagePoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the client point and page number as input parameters. The following code sample explains how to convert a tapped client area position to a page point. @@ -85,9 +95,9 @@ private void PdfViewer_Tapped(object sender, GestureEventArgs e) {% endhighlight %} {% endtabs %} -## Convert PDF page coordinates to PDF Viewer’s coordinates +## Convert PDF page coordinates to PDF Viewer's coordinates -You can obtain the PDF Viewer’s coordinates using the [ConvertPagePointToClientPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToClientPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code sample explains how to convert a square annotation’s position in the page coordinates to a client point. +You can obtain the PDF Viewer's coordinates using the [ConvertPagePointToClientPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToClientPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code sample explains how to convert a square annotation's position in the page coordinates to a client point. {% tabs %} {% highlight c# %} @@ -100,7 +110,7 @@ Annotation annotation = annotations[0]; // Type cast to the specific annotation type. Here, the first annotation is a square annotation. if (annotation is SquareAnnotation squareAnnotation) { - //Get the annotation’s page number. + //Get the annotation's page number. int pageNumber = squareAnnotation.PageNumber; //Get the annotation bounds. RectF annotationBounds = squareAnnotation.Bounds; @@ -114,7 +124,7 @@ if (annotation is SquareAnnotation squareAnnotation) ## Convert PDF page coordinates to scroll coordinates -You can obtain the PDF Viewer’s scroll coordinates using the [ConvertPagePointToScrollPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToScrollPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code example explains how to convert a square annotation’s position in the page coordinates to a scroll point. +You can obtain the PDF Viewer's scroll coordinates using the [ConvertPagePointToScrollPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToScrollPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code example explains how to convert a square annotation's position in the page coordinates to a scroll point. {% tabs %} {% highlight c# %} @@ -129,7 +139,7 @@ if (annotation is SquareAnnotation squareAnnotation) { //Get the annotation bounds. RectF annotationBounds = squareAnnotation.Bounds; - //Get the annotation’s page number. + //Get the annotation's page number. int pageNumber = squareAnnotation.PageNumber; //Find the position of the annotation in page coordinates. Point pagePoint = new Point(annotationBounds.X, annotationBounds.Y); @@ -140,7 +150,11 @@ if (annotation is SquareAnnotation squareAnnotation) {% endtabs %} ## See Also -- [Annotations Overview](../annotations-overview) -- [Page Navigation](../page-navigation) -- [Scrolling](../scrolling) + +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) +- [Scrolling](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/scrolling) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Annotation Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotation-collection) +- [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/magnification) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md b/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md index 743750bcbb..70f7c4d901 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md @@ -12,12 +12,32 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne PDF documents can include custom bookmarks that allow the user to bookmark pages and navigate to them. The PDF viewer control displays these custom bookmarks in outline view. -## Showing/Hiding the Custom Bookmarks Pane +To work with custom bookmarks in code, ensure the following namespaces are imported in your C# file: -The built-in custom bookmark view of the PDF Viewer displays the custom bookmarks, can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Linq; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: {% tabs %} -{% highlight XAML %} +{% highlight xml %} +xmlns:pdfViewer="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} + +## Showing or hiding the custom bookmarks pane + +The built-in custom bookmark view of the PDF Viewer displays the custom bookmarks and can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. + +{% tabs %} +{% highlight xml %} @@ -41,11 +61,11 @@ var customBookmarks = pdfViewer.CustomBookmarks; {% endhighlight %} {% endtabs %} -## Add, Edit, and Remove Custom Bookmarks +## Add, rename, and remove custom bookmarks -You can manage custom bookmarks in the PDF viewer using the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. This property allows you to add, edit, or remove bookmarks that appear in the viewer’s bookmark pane. +You can manage custom bookmarks in the PDF viewer using the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. This property allows you to add, rename, or remove bookmarks that appear in the viewer's bookmark pane. -### Add Custom Bookmarks +### Add custom bookmarks You can add custom bookmarks either through the UI or programmatically. You can also track additions using event handlers. @@ -108,11 +128,11 @@ private void Bookmarks_CollectionChanged(object? sender, NotifyCollectionChanged {% endhighlight %} {% endtabs %} -### Rename Custom Bookmarks +### Rename custom bookmarks You can rename custom bookmarks either through the UI or programmatically. You can also track rename changes using event handlers. -#### Rename via Context Menu +#### Rename via context menu To rename a custom bookmark from the UI: 1. Tap the context menu button on the desired custom bookmark. @@ -208,11 +228,11 @@ private void Bookmark_PropertyChanged(object? sender, PropertyChangedEventArgs e {% endhighlight %} {% endtabs %} -### Remove Custom Bookmarks +### Remove custom bookmarks You can remove custom bookmarks either through the UI or programmatically. You can also track bookmark removal using event handlers. -#### Remove via Context Menu +#### Remove via context menu To remove a custom bookmark from the UI: 1. Tap the context menu button on the custom bookmark you want to delete. @@ -245,9 +265,9 @@ To track when a custom bookmark is removed, handle the [CollectionChanged](https private void Bookmarks_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { // Check if the change action is 'Remove' - else if (e.Action == NotifyCollectionChangedAction.Remove && e.OldItems != null) + if (e.Action == NotifyCollectionChangedAction.Remove && e.OldItems != null) { - // Iterate through reomoved bookmarks + // Iterate through removed bookmarks foreach (Bookmark bookmark in e.OldItems) { Debug.WriteLine($"Removed bookmark: {bookmark.Name} at page {bookmark.PageNumber}"); @@ -262,7 +282,7 @@ private void Bookmarks_CollectionChanged(object? sender, NotifyCollectionChanged You can navigate to custom bookmarks either through the UI or programmatically using the PDF viewer's built-in features. -### Navigate Using UI +### Navigate using UI To navigate using the UI: 1. Ensure the outline view is visible by setting the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property to `true`. @@ -270,8 +290,9 @@ 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 +**Note:** 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. @@ -288,6 +309,9 @@ if (customBookmark != null) {% endtabs %} ## See Also -- [Document Outline](../document-outline) -- [Page Navigation](../page-navigation) -- [Hyperlink Navigation](../hyperlink-navigation) + +- [Document Outline](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/document-outline) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) +- [Hyperlink Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/hyperlink-navigation) +- [Annotation Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotation-collection) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md b/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md index b368ca412a..e68ec702fb 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md @@ -10,13 +10,21 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Document Link Navigation in .NET MAUI PDF Viewer (SfPdfViewer) -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. +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. + +To work with document link navigation in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} ![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. +**Note:** 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 +## Enable or disable document link navigation The document link navigation can be turned on or off using the [EnableDocumentLinkNavigation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableDocumentLinkNavigation) property. The default value of this property is `true`. The code snippet below illustrates disabling the document link navigation. @@ -29,6 +37,10 @@ pdfViewer.EnableDocumentLinkNavigation = false; {% endtabs %} ## See Also + - [Hyperlink Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/hyperlink-navigation) - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) - [Document Outline (Bookmarks)](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/document-outline) +- [Custom Bookmarks](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/custom-bookmark) +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md b/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md index d0ad9cc1c3..449a9bcdda 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md @@ -12,9 +12,26 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne A PDF document may optionally have a document outline (also called bookmarks) which allows the user to navigate from one part of the document to another. The PDF viewer control displays the document outline in a tree-structured hierarchy of outline elements. -## Showing/hiding the outline view +To work with the document outline in code, ensure the following namespaces are imported in your C# file: -The PDF viewer’s built-in outline view that displays the document outline in a tree like structure can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using System.Linq; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: + +{% tabs %} +{% highlight xml %} +xmlns:pdfViewer="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} + +## Showing / hiding the outline view + +The PDF Viewer's built-in outline view, which displays the document outline in a tree-like structure, can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. {% tabs %} {% highlight XAML %} @@ -43,7 +60,7 @@ var documentOutline = pdfViewer.DocumentOutline; ## Accessing nested child elements -The outline elements nested within each outline element can be accessed from the [OutlineElement.Children](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.OutlineElement.html#Syncfusion_Maui_PdfViewer_OutlineElement_Children) property. Below code snippet illustrates accessing the 2nd element in the document outline. And then accessing its 3rd child. +The outline elements nested within each outline element can be accessed from the [OutlineElement.Children](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.OutlineElement.html#Syncfusion_Maui_PdfViewer_OutlineElement_Children) property. The following code snippet illustrates accessing the third element in the document outline and then accessing its fourth child (using zero-based indexing). {% tabs %} {% highlight c# %} @@ -56,15 +73,15 @@ OutlineElement nestedElement = outlineElement.Children[3]; ## Navigating to outline elements -### Navigating using UI +### Navigating using the UI -As mentioned above, you can show the outline view by setting the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property to `true`. When the outline view is showing, you can tap on any element to navigate to the destination pointed by that element. +After showing the outline view using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property as described above, you can tap on any element to navigate to the destination pointed to by that element. -![Document outline in .NET MAUI PDF Viewer](Images\outline-view.png) +![Document outline in .NET MAUI PDF Viewer](Images/outline-view.png) ### Navigating programmatically -The PDF viewer allows the users to navigate to an outline element using the [GoToOutlineElement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToOutlineElement_Syncfusion_Maui_PdfViewer_OutlineElement_) method. The below code snippet illustrates the same. +The PDF Viewer allows users to navigate to an outline element using the [GoToOutlineElement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToOutlineElement_Syncfusion_Maui_PdfViewer_OutlineElement_) method. The following code snippet illustrates how to navigate to an outline element. {% tabs %} {% highlight c# %} @@ -79,6 +96,9 @@ if (outlineElement != null) {% endtabs %} ## See Also + - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) - [Document Link Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/document-link-annotations) -- [Custom Bookmark](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/custom-bookmark) +- [Custom Bookmarks](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/custom-bookmark) +- [Hyperlink Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/hyperlink-navigation) +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md b/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md index cc3c1cd34c..ef0c01ff02 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md @@ -12,6 +12,22 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) and [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) events to notify whether the document has been opened and displayed in the view or not. +To work with document load events in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: + +{% tabs %} +{% highlight XAML %} +xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} + ## Document loaded event The [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event triggers after the document is loaded in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). Refer to the following code example: @@ -24,7 +40,7 @@ The [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfView DocumentLoaded="PdfViewer_DocumentLoaded"/> {% endhighlight %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_DocumentLoaded(object sender, EventArgs e) { @@ -37,11 +53,11 @@ The [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfView If you want to perform any operation immediately after the document has loaded, you can handle the operations in this event. For example, if you want to initially open a document with a specific page number or zoom factor, then call the respective APIs in this event handler. The following code example explains opening a document with a specified page number of 4. {% tabs %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_DocumentLoaded(object sender, EventArgs e) { - pdfViewer.GoToPage(4); + PdfViewer.GoToPage(4); } {% endhighlight %} @@ -49,18 +65,18 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs e) ## Document load failures -When a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), users are notified with a context-specific error message via the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event. This event helps developers identify the cause of the failure and implement custom error handling for a smoother user experience. +When a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event notifies the application with a context-specific error message. This event helps developers identify the cause of the failure and implement custom error handling for a smoother user experience. ### Document load failed event The [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event alerts users when a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) due to one of the following conditions: * A corrupted document is loaded. * A password-protected document is provided with an invalid or empty password. -* A non-PDF file is attempted to be loaded. +* A non-PDF file is loaded. * The document contains an XFA form, which is currently unsupported. * Exceptions occur during PDF loading or page rendering due to limitations or issues in platform-specific native PDF renderers. -The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) will return the error [Message](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Message) and [Exception](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Exception) details for the failure. The following code example explains the same. +The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) returns the error [Message](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Message) and [Exception](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Exception) details for the failure. The following code example explains how to handle the event. {% tabs %} {% highlight XAML hl_lines="3" %} @@ -70,7 +86,7 @@ The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion DocumentLoadFailed="PdfViewer_DocumentLoadFailed"/> {% endhighlight %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e) { @@ -82,7 +98,7 @@ private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEvent ### Handling document load failures -The [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event allows you to handle the load failures at the application level in your own way. Set the [Handled](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Handled) property of the [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) to `true` to disable the control’s default error messages and handle your logic with the error information. +By default, the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) displays its own error message when a document fails to load. If you prefer to handle the failure at the application level with custom logic instead, set the [Handled](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Handled) property of the [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) to `true` to suppress the control's default error messages and implement your own handling using the error information. {% tabs %} {% highlight XAML hl_lines="3" %} @@ -92,7 +108,7 @@ The [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Pdf DocumentLoadFailed="PdfDocumentLoadFailed"/> {% endhighlight %} -{% highlight C# hl_lines="4" %} +{% highlight c# hl_lines="4" %} public MainPage() { @@ -110,6 +126,10 @@ private void PdfDocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e) {% endtabs %} ## See Also + - [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) +- [Open a Password Protected Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-password-protected-document) - [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) +- [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/magnification) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md index 3a1774c759..b243fcd7c9 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md @@ -10,21 +10,30 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Form Fields Collection in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer.FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) property provides access to all form fields present in the loaded PDF document. The collection is available after the document finishes loading and can be accessed from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event. +The [SfPdfViewer.FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) property provides access to all form fields present in the loaded PDF document. The collection is available after the document finishes loading and can be accessed from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event. For a broader overview of form-filling support, see [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview). + +To work with form fields in code, ensure the following namespaces are imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using System.Linq; +{% endhighlight %} +{% endtabs %} ## Accessing the FormFields collection -The following code snippet illustrates getting the total count of form fields in the PDF document. +The following code snippet illustrates getting the total count of form fields in the PDF document. Call the `WireDocumentLoadedEvent` method from your page constructor or initialization logic so the `DocumentLoaded` handler is registered before a document is loaded. {% tabs %} -{% highlight C# %} +{% highlight c# %} public void WireDocumentLoadedEvent() { // Wire the document loaded event to occur when a PDF document is loaded. PdfViewer.DocumentLoaded += OnDocumentLoaded; } -private void OnDocumentLoaded(object? sender, EventArgs? e) +private void OnDocumentLoaded(object sender, EventArgs e) { // Get the form field count. int fieldCount = PdfViewer.FormFields.Count; @@ -34,10 +43,10 @@ private void OnDocumentLoaded(object? sender, EventArgs? e) ## Retrieve a specific form field by name -You can retrieve a specific form field from the collection by filtering on the [Name](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_Name) property. The following example retrieves a text form field named `"name"`. +You can retrieve a specific form field from the collection by filtering on the [Name](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_Name) property. The following example retrieves a text form field whose name is `name`. {% tabs %} -{% highlight C# %} +{% highlight c# %} FormField formField = PdfViewer.FormFields.Where(x => x.Name == "name").FirstOrDefault(); if (formField is TextFormField nameTextBox) @@ -52,7 +61,7 @@ if (formField is TextFormField nameTextBox) Form fields can be prevented from being modified by setting the [ReadOnly](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_ReadOnly) property to `true`. The following example makes all form fields read-only. {% tabs %} -{% highlight C# %} +{% highlight c# %} // Restrict editing of all form fields. foreach (FormField formField in PdfViewer.FormFields) { @@ -66,7 +75,7 @@ foreach (FormField formField in PdfViewer.FormFields) The [ClearFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClearFormData_System_Int32_) method clears the data in all form fields in the PDF document. {% tabs %} -{% highlight C# %} +{% highlight c# %} // Clear all form field data in the document. PdfViewer.ClearFormData(); {% endhighlight %} @@ -75,7 +84,7 @@ PdfViewer.ClearFormData(); To clear form data on a specific page, pass the page number to the method. {% tabs %} -{% highlight C# %} +{% highlight c# %} // Clear all form field data on page 2. PdfViewer.ClearFormData(2); {% endhighlight %} @@ -83,12 +92,12 @@ PdfViewer.ClearFormData(2); ## Attach custom data to a form field -The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_CustomData) property allows you to store additional reference information on any form field instance. This data is for application use only and is not displayed or saved in the PDF document. +The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_CustomData) property allows you to store additional reference information for any form field instance. This data is for application use only and is not displayed or saved in the PDF document. To use this example, wire the `FormFieldValueChanged` event of the `SfPdfViewer` (for more details, see [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events)). -The following example stores the modification timestamp on a form field whenever its value changes. +The following example stores the modification timestamp for a form field whenever its value changes. {% tabs %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChangedEventArgs e) { e.FormField.CustomData = "Modified: " + DateTime.Now.ToString(); @@ -97,7 +106,11 @@ private void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChange {% endtabs %} ## See Also + - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) - [Edit Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-edit) - [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) -- [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) \ No newline at end of file +- [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) +- [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) +- [Form Field Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md index a81ae9514f..d7d7ac2eaa 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md @@ -8,20 +8,21 @@ documentation: ug keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .net maui open pdf, maui pdf viewer, maui pdf view --- -# Customize Form Fields in .NET MAUI PDF Viewer (SfPdfViewer) +# Customize form fields in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to customize the visual appearance of form fields by modifying properties on their [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) objects. You can change the background color, text (foreground) color, border color, and border width. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to customize the visual appearance of form fields by modifying properties on their [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) objects. A form field can have one or more `Widget` instances (the visual representations of the field on the page). You can change the background color, foreground (text) color, border color, and border width. -N> * Appearance customizations support undo and redo. -N> * Customizations cannot be applied when a form field is locked. -N> * Customized colors and border width are preserved during import, export, printing, and saving. +**Note:** +* Appearance customizations support undo and redo. +* Customizations cannot be applied when a form field is locked. For details, see [Lock and Unlock Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/lock-unlock). +* Customized colors and border width are preserved during import, export, printing, and saving. For more information, see [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) and [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document). ## Customize the background color The [BackgroundColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html#Syncfusion_Maui_PdfViewer_Widget_BackgroundColor) property sets the fill color behind the field content. The following example applies a uniform background color to all form fields in the document. {% tabs %} -{% highlight C# %} +{% highlight c# %} foreach (FormField formField in PdfViewer.FormFields) { foreach (Widget widget in formField.Widgets) @@ -33,12 +34,12 @@ foreach (FormField formField in PdfViewer.FormFields) {% endhighlight %} {% endtabs %} -## Customize the text color +## Customize the foreground (text) color -The `ForegroundColor` property sets the text color inside the form field. The following example applies a red text color to all text form fields. +The `ForegroundColor` property sets the color of the text inside the form field. The following example applies a red text color to all text form fields. {% tabs %} -{% highlight C# %} +{% highlight c# %} foreach (FormField formField in PdfViewer.FormFields) { if (formField is TextFormField textBoxField) @@ -57,7 +58,7 @@ foreach (FormField formField in PdfViewer.FormFields) The `BorderColor` property sets the color of the border drawn around the form field. The following example applies a red border to all text form fields. {% tabs %} -{% highlight C# %} +{% highlight c# %} foreach (FormField formField in PdfViewer.FormFields) { if (formField is TextFormField textBoxField) @@ -76,7 +77,7 @@ foreach (FormField formField in PdfViewer.FormFields) The `BorderWidth` property sets the thickness of the border around the form field. The following example sets a border width of `2.0` on all text form fields. {% tabs %} -{% highlight C# %} +{% highlight c# %} foreach (FormField formField in PdfViewer.FormFields) { if (formField is TextFormField textBoxField) @@ -92,13 +93,13 @@ foreach (FormField formField in PdfViewer.FormFields) ## Detect widget property changes -The `PropertyChanged` event on a [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) fires whenever a widget property — such as `BorderColor`, `BackgroundColor`, `BorderWidth`, or `ForegroundColor` — changes. Subscribe to this event after the document loads. +In addition to setting widget properties, you can also track when a widget property changes at runtime. The `PropertyChanged` event on a [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) fires whenever a widget property — such as `BorderColor`, `BackgroundColor`, `BorderWidth`, or `ForegroundColor` — changes. Subscribe to this event after the document loads. {% tabs %} -{% highlight C# %} +{% highlight c# %} void SubscribeToWidgetPropertyChanges() { - foreach (FormField formField in pdfViewer.FormFields) + foreach (FormField formField in PdfViewer.FormFields) { foreach (var widget in formField.Widgets) { @@ -107,7 +108,7 @@ void SubscribeToWidgetPropertyChanges() } } -private void Widget_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) +private void Widget_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (sender is Widget widget) { @@ -122,7 +123,12 @@ private void Widget_PropertyChanged(object? sender, System.ComponentModel.Proper {% endtabs %} ## See Also + - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) - [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) - [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection) - [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) +- [Edit Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-edit) +- [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) +- [Lock and Unlock](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/lock-unlock) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md index 8fe6013bba..35c06bcda9 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md @@ -14,7 +14,7 @@ The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer. ## Editing form fields programmatically -All form field edits shown below should be placed in your page's code-behind (`MainPage.xaml.cs`). The document must be fully loaded before accessing [FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) — call these from the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded") event handler or a button click after the document is open. +All form field edits shown below should be placed in your page's code-behind (`MainPage.xaml.cs`). The document must be fully loaded before accessing [FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) — call these from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler or a button click handler after the document is open. ### Editing text form fields @@ -23,8 +23,8 @@ A text form field can be modified using the [Text](https://help.syncfusion.com/c {% tabs %} {% highlight C# tabtitle="MainPage.xaml.cs" %} -// Call after DocumentLoaded fires, or from a button_Clicked handler. -FormField formField = pdfViewer.FormFields.Where(x => x.Name == "name").FirstOrDefault(); +// Call after the DocumentLoaded event fires, or from an OnEditButtonClicked handler. +FormField formField = PdfViewer.FormFields.Where(x => x.Name == "name").FirstOrDefault(); if (formField is TextFormField nameTextBox) { @@ -124,7 +124,7 @@ if (formField is RadioButtonFormField radioButton) ### Editing signature form fields -Programmatically, add a signature to an unsigned signature field by creating and assigning an ink annotation to the [SignatureFormField.Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature) property. The following code snippet illustrates retrieving a signature form field named "signature" from the PDF Viewer. +You can programmatically add a signature to an unsigned signature field by creating and assigning an ink annotation to the [SignatureFormField.Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature) property. The following code snippet illustrates retrieving a signature form field named "signature" from the PDF Viewer. {% tabs %} {% highlight C# %} @@ -143,21 +143,21 @@ if (signature != null) {% endhighlight %} {% endtabs %} -The [Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature) property is of type [InkAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html) and it will behave like an ink after signing. If the PDF document is saved, the signature will be preserved as an ink annotation in the saved document. +The [Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature) property is of type [InkAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html) and it behaves like an ink annotation after signing. If the PDF document is saved, the signature will be preserved as an ink annotation in the saved document. #### Suppressing the signature modal view -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the signature modal view and use your own UI in its place. This can be achieved by setting the `FormFieldModalViewAppearingEventArgs.Cancel` property to `true` in the [SignatureModalViewAppearing](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SignatureModalViewAppearing) event handler. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the signature modal view and use your own UI in its place. This can be achieved by setting the `FormFieldModalViewAppearingEventArgs.Cancel` property to `true` in the [SignatureModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SignatureModalViewAppearing) event handler. -The below code snippet illustrates suppressing the signature modal view and using a UI implemented in the app in its place. In this illustration, it is assumed that the signature is produced in the form of an image stream when the user completes drawing the signature in the custom dialog. When the signing is completed using the custom dialog, a stamp annotation is created and assigned as the signature of the form field. +The following code snippet illustrates suppressing the signature modal view and using a UI implemented in the app in its place. In this illustration, it is assumed that the signature is produced in the form of an image stream when the user completes drawing the signature in the custom dialog. When the signing is completed using the custom dialog, a stamp annotation is created and assigned as the signature of the form field. {% tabs %} {% highlight c# %} SignatureFormField? signatureFormField; -pdfviewer.SignatureModalViewAppearing += PdfViewer_SignatureModalViewAppearing; +PdfViewer.SignatureModalViewAppearing += PdfViewer_SignatureModalViewAppearing; -private void PdfViewer_SignatureModalViewAppearing(object? Sender, FormFieldModalViewAppearingEventArgs e) +private void PdfViewer_SignatureModalViewAppearing(object? sender, FormFieldModalViewAppearingEventArgs e) { e.Cancel = true; signatureFormField = e.FormField as SignatureFormField; @@ -166,10 +166,10 @@ private void PdfViewer_SignatureModalViewAppearing(object? Sender, FormFieldModa ShowCustomDialog(); } -Private void customDialogOkButton_Clicked(object sender, EventArgs e) +private void customDialogOkButton_Clicked(object sender, EventArgs e) { //Get the signature in the form of a Stream instance (possibly converted from an image of the user's freehand drawing) - signatureImageStream = GetSignatureImageStream(); + Stream signatureImageStream = GetSignatureImageStream(); // Create a stamp annotation. The bounds values are not necessary since the stamp will be automatically fit over the signature form field. StampAnnotation signatureStamp = new StampAnnotation(signatureImageStream, signatureFormField.PageNumber, new RectF(0, 0, 0, 0)); @@ -180,13 +180,13 @@ Private void customDialogOkButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} -### Button form fields +### Button form fields behavior -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. +Button form fields will be rendered in the PDF Viewer. The PDF Viewer supports only the `GoTo` actions that navigate to a particular location in the PDF document. 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. +The [FlattenOnSave](https://help.syncfusion.com/cr/maui/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 @@ -195,7 +195,7 @@ You can selectively flatten specific form fields, such as signature fields, by i {% tabs %} {% highlight c# %} -foreach (var item in pdfViewer.FormFields) +foreach (var item in PdfViewer.FormFields) { //Iterate Only signature form field and flatten it if (item is SignatureFormField signature) @@ -215,7 +215,7 @@ To flatten all form fields in the document, set the FlattenOnSave property for e {% highlight c# %} //Iterate all the form fields and set flatten -foreach (var item in pdfViewer.FormFields) +foreach (var item in PdfViewer.FormFields) { item.FlattenOnSave = true; } @@ -223,7 +223,7 @@ foreach (var item in pdfViewer.FormFields) {% endhighlight %} {% endtabs %} -## Controlling form field editing at the viewer Level +## Controlling form field editing at the viewer level The `AllowEditFormFields` property is used to control form field editing at the viewer level. By default, editing is enabled, allowing users to interact with all supported form fields. When this property is set to false, all form fields become non-editable, making the document effectively read-only without modifying individual field properties. This behavior applies to all form field types and takes effect immediately on the loaded document. @@ -238,15 +238,16 @@ You can disable editing programmatically using the following: {% highlight c# %} // Disable form field editing -pdfViewer.AllowEditFormFields = false; +PdfViewer.AllowEditFormFields = false; {% endhighlight %} {% endtabs %} This property supports dynamic changes at runtime, meaning you can enable or disable form field editing at the viewer level based on requirements, and the changes will be applied instantly. -N>Setting AllowEditFormFields to false does not modify the ReadOnly property of individual form fields. It acts as an additional layer of control, and a field remains non-editable if either its ReadOnly property is true or viewer-level editing is disabled +**Note:** Setting `AllowEditFormFields` to false does not modify the `ReadOnly` property of individual form fields. It acts as an additional layer of control, and a field remains non-editable if either its `ReadOnly` property is true or viewer-level editing is disabled. ## 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) - [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) @@ -254,3 +255,11 @@ N>Setting AllowEditFormFields to false does not modify the ReadOnly property of - [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) - [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) - [Electronic Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) +- [Form Field Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) +- [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection) +- [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) +- [Customize Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-customization) +- [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) +- [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) +- [Electronic Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md index 8dff6e7771..becd51ead7 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md @@ -10,7 +10,28 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Form Field Events in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) exposes events that allow you to track and respond to user interactions with form fields, such as value changes and focus changes. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) exposes events that allow you to track and respond to user interactions with form fields. The following table summarizes the available events: + +| Event | Description | +|---|---| +| [FormFieldValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged) | Raised when the value of a form field changes. | +| [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) | Raised when a text or signature field gains or loses focus. | + +To work with form field events in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: + +{% tabs %} +{% highlight XAML %} +xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} ## Detect value changes @@ -20,7 +41,7 @@ Subscribe to the event in XAML: {% tabs %} {% highlight XAML %} - {% endhighlight %} {% endtabs %} @@ -28,30 +49,30 @@ Subscribe to the event in XAML: Handle the event in code: {% tabs %} -{% highlight C# %} -private void PdfViewer_FormFieldValueChanged(object? sender, FormFieldValueChangedEventArgs? e) +{% highlight c# %} +private void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChangedEventArgs e) { - if (e != null && e.FormField is TextFormField textFormField) + if (e.FormField is TextFormField textFormField) { // Read the previous and current values. - string? oldText = e.OldValue?.ToString(); - string? newText = e.NewValue?.ToString(); + string oldText = e.OldValue?.ToString(); + string newText = e.NewValue?.ToString(); } } {% endhighlight %} {% endtabs %} -N> The `OldValue` and `NewValue` types vary by field type. For a checkbox, cast them to `bool` to read the checked state. For a combo box or radio button, cast them to `string`. +**Note:** The `OldValue` and `NewValue` types vary by field type. For a checkbox, cast them to `bool` to read the checked state. For a combo box or radio button, cast them to `string`. -## Detect focus and unfocus +## Detect focus changes -The [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) event is raised when a text or signature field gains or loses focus. Use the `HasFocus` property to determine whether the field is being focused or unfocused. +The [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) event is raised when a text or signature field gains or loses focus. This event is raised only for text and signature form fields. Use the [HasFocus](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldFocusChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldFocusChangedEventArgs_HasFocus) property of the [FormFieldFocusChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldFocusChangedEventArgs.html) to determine whether the field is being focused or unfocused. Subscribe to the event in XAML: {% tabs %} {% highlight XAML %} - {% endhighlight %} {% endtabs %} @@ -59,22 +80,21 @@ Subscribe to the event in XAML: Handle the event in code: {% tabs %} -{% highlight C# %} -private void PdfViewer_FormFieldFocusChanged(object? sender, FormFieldFocusChangedEvenArgs? e) +{% highlight c# %} +private void PdfViewer_FormFieldFocusChanged(object sender, FormFieldFocusChangedEventArgs e) { - if (e != null) - { - FormField? field = e.FormField; - bool hasFocus = e.HasFocus; - } + FormField field = e.FormField; + bool hasFocus = e.HasFocus; } {% endhighlight %} {% endtabs %} -N> `FormFieldFocusChanged` is raised only for text and signature form fields. - ## See Also + - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) - [Edit Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-edit) -- [Form Data Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) +- [Form Filling Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) - [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection) +- [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) +- [Customize Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-customization) +- [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md index a237239651..d0baac1db6 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md @@ -12,6 +12,18 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to import form data into a PDF document and export filled form data from it. This is useful for pre-populating forms, backing up responses, or transferring data between systems. +To work with form data import and export in code, ensure the following namespaces are imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using Syncfusion.Pdf.Parsing; +using System.IO; +{% endhighlight %} +{% endtabs %} + +The `DataFormat` enumeration used for import and export is part of the `Syncfusion.Pdf.NET` package. Ensure this package is installed alongside `Syncfusion.Maui.PdfViewer`. + ## Supported data formats The following formats are supported for both import and export: @@ -20,12 +32,12 @@ The following formats are supported for both import and export: |---|---| | XFDF | XML Forms Data Format — standard format compatible with most PDF viewers. | | FDF | Forms Data Format — standard format compatible with most PDF viewers. | -| JSON | Custom format, compatible with PDF Viewers (WPF, Flutter, JavaScript, etc.). | -| XML | Custom format, compatible with PDF Viewers (WPF, Flutter, JavaScript, etc.). | +| JSON | Syncfusion-specific format for structured form data exchange across Syncfusion PDF viewers (WPF, Flutter, JavaScript, etc.). | +| XML | Syncfusion-specific format for hierarchical form data exchange across Syncfusion PDF viewers (WPF, Flutter, JavaScript, etc.). | -The required format can be selected from the [DataFormat](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Parsing.DataFormat.html) enumeration. +The required format can be selected from the [DataFormat](https://help.syncfusion.com/cr/maui/Syncfusion.Pdf.Parsing.DataFormat.html) enumeration. -N> XFDF and FDF are standard formats compatible with global PDF viewers. JSON and XML are Syncfusion-specific formats for cross-platform use within Syncfusion products only. +**Note:** XFDF and FDF are standard formats compatible with global PDF viewers. JSON and XML are Syncfusion-specific formats for cross-platform use within Syncfusion products only. ## Import form data @@ -34,14 +46,13 @@ Use the [ImportFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Pdf The following example imports form data from an XFDF file stored in the application's data directory. {% tabs %} -{% highlight C# %} +{% highlight c# %} void ImportFormData() { string fileName = Path.Combine(FileSystem.Current.AppDataDirectory, "FormDataInfo.xfdf"); Stream inputFileStream = File.OpenRead(fileName); - inputFileStream.Position = 0; - pdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf); + PdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf); } {% endhighlight %} {% endtabs %} @@ -49,8 +60,14 @@ void ImportFormData() To continue importing even if the file contains errors, pass `true` for the `continueImportOnError` parameter. {% tabs %} -{% highlight C# %} -pdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf, true); +{% highlight c# %} +void ImportFormDataWithOnError() +{ + string fileName = Path.Combine(FileSystem.Current.AppDataDirectory, "FormDataInfo.xfdf"); + Stream inputFileStream = File.OpenRead(fileName); + + PdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf, true); +} {% endhighlight %} {% endtabs %} @@ -58,32 +75,42 @@ pdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf Use the [ExportFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportFormData_System_IO_Stream_Syncfusion_Pdf_Parsing_DataFormat_) method to write the current form field values to a file. Pass an empty writable stream and the desired format. -The following example exports form data to an XFDF file in the application's data directory. +The following example exports form data to an XFDF file in the application's data directory. Ensure the PDF document is loaded before exporting — call `ExportFormData` from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler. + +First, wire the `DocumentLoaded` event after loading the document: {% tabs %} -{% highlight C# %} +{% highlight c# %} +// Load the PDF document and add the viewer to the visual tree. +PdfViewer.LoadDocumentAsync(PdfStream); +myGrid.Children.Add(PdfViewer); + +// Subscribe to the DocumentLoaded event to export once the document is fully loaded. +PdfViewer.DocumentLoaded += PdfViewer_DocumentLoaded; +{% endhighlight %} +{% endtabs %} -SfPdfViewer PdfViewer = new SfPdfViewer(); - PdfViewer.LoadDocumentAsync(PdfStream); +Then, handle the event and export the form data: -// 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) +{% tabs %} +{% highlight c# %} +private void PdfViewer_DocumentLoaded(object sender, EventArgs e) { - using (var fileStream = File.Create("D://SavedForm.json")) + string fileName = Path.Combine(FileSystem.Current.AppDataDirectory, "SavedForm.xfdf"); + using (var fileStream = File.Create(fileName)) { - if(sender is SfPdfViewer pdfViewer) - pdfViewer.ExportFormData(fileStream, Syncfusion.Pdf.Parsing.DataFormat.Json); + PdfViewer.ExportFormData(fileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf); } } {% endhighlight %} {% endtabs %} ## See Also + - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) -- [Form Data Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) +- [Form Filling Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) - [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) +- [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection) +- [Edit Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-edit) +- [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md index 66daff411d..3519b2abef 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md @@ -10,9 +10,17 @@ 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](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_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/maui/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. +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. For saving filled forms, see [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document). + +To work with form fields in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} ## Supported form field types @@ -26,12 +34,12 @@ The viewer supports saving filled forms, flattening form fields to make them non | Signature | Captures a handwritten, text, or image signature. | | Button | Renders a button; supports `GoTo` navigation actions only. | -## XFA forms are not supported +## XFA forms -The PDF viewer supports only Acroforms. PDF documents that contain an XFA form cannot be loaded in the PDF Viewer. When a PDF with an XFA form is attempted to be loaded, the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event is raised. +The PDF Viewer supports only AcroForms. PDF documents that contain an XFA form cannot be loaded in the PDF Viewer. When you attempt to load a PDF with an XFA form, the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event is raised. {% tabs %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e) { if (e.Message == "This PDF cannot be loaded because it contains XFA form.") diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md index f3d1b59dd1..44f53e9a1b 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md @@ -10,15 +10,24 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Free Text Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify free text annotation in the PDF document. This is useful for adding text notes, comments, or feedback to the PDF pages. This section will go through the functions available in PDF Viewer for working with free text annotations. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify free text annotations in the PDF document. This is useful for adding text notes, comments, or feedback to the PDF pages. This section explains the functions available in the PDF Viewer for working with free text annotations. + +To work with free text annotations in code, ensure the following namespaces are imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using Microsoft.Maui.Graphics; +{% endhighlight %} +{% endtabs %} ## Add free text annotations -This section will go through how to add free text annotations to a PDF page using toolbar as well as programmatically. +This section explains how to add free text annotations to a PDF page using the built-in toolbar as well as programmatically. -### Add the free text annotations using the toolbar +### Add free text annotations using the built-in toolbar -On the built-in toolbar, a free text annotation tool is available. Using that, you can add the free text annotation to the tapped position. Additionally, the toolbar shows the option to modify the properties of existing or new free text annotations. +On the built-in toolbar, a free text annotation tool is available. Using that, you can add the free text annotation to the tapped position. Additionally, the built-in toolbar shows the option to modify the properties of existing or new free text annotations. The following image represents how to add the free text annotations using the toolbar on the desktop. @@ -28,7 +37,7 @@ The following image represents how to add the free text annotation using the too ![Free text Built-in toolbar](Images/mobilefreetext.gif) -### Add free text annotation without using the toolbar +### Add a free text annotation without using the toolbar You can add free text annotation to a PDF document by tapping with a touch (or mouse down) on a PDF page. The following steps explain how to add free text annotation in a PDF. @@ -64,9 +73,9 @@ void DisableFreetextMode() {% endhighlight %} {% endtabs %} -### Adding Annotations Programmatically +### Add annotations programmatically -You can create and add a free Text annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a free text annotation and add it to the first page of a PDF document. +You can create and add a free text annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a free text annotation and add it to the first page of a PDF document. {% tabs %} {% highlight C# %} @@ -124,7 +133,7 @@ void CustomizeDefaultFreeTextSettings() {% endhighlight %} {% endtabs %} -### How to create a free text annotation without a border? +### Create a free text annotation without a border The PDF Viewer allows you to customize annotation properties using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property. By default, free text annotations include a visible border. To create a free text annotation without a border, set the [BorderWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FreeTextAnnotationSettings.html#Syncfusion_Maui_PdfViewer_FreeTextAnnotationSettings_BorderWidth) property to 0 using the [FreeTextAnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FreeTextAnnotationSettings.html#properties). @@ -133,7 +142,7 @@ The following example demonstrates how to create a free text annotation without {% tabs %} {% highlight C# %} // Access the default free text annotation settings -FreeTextAnnotationSettings freeTextSettings = pdfViewer.AnnotationSettings.FreeText; +FreeTextAnnotationSettings freeTextSettings = PdfViewer.AnnotationSettings.FreeText; // Set the border width to zero to remove the border freeTextSettings.BorderWidth = 0; @@ -142,6 +151,8 @@ freeTextSettings.BorderWidth = 0; ## Edit the selected free text annotation +You can edit the text content and properties of a selected free text annotation either through UI interaction or programmatically. + ### Edit the text with UI interaction Double-tapping the selected free text annotation will allow you to edit its text content. @@ -187,9 +198,9 @@ The `SfPdfViewer.FreeTextModalViewAppearing` event is triggered whenever the mod {% tabs %} {% highlight c# %} -pdfviewer.FreeTextModalViewAppearing += PdfViewer_FreeTextModalViewAppearing; +PdfViewer.FreeTextModalViewAppearing += PdfViewer_FreeTextModalViewAppearing; -private void PdfViewer_FreeTextModalViewAppearing(object? Sender, AnnotationModalViewAppearingEventArgs e) +private void PdfViewer_FreeTextModalViewAppearing(object? sender, AnnotationModalViewAppearingEventArgs e) { // Implement the logic to hide unwanted UI elements such as toolbar items added to the app UI. } @@ -202,9 +213,9 @@ The `SfPdfViewer.FreeTextModalViewDisappearing` event is triggered when the moda {% tabs %} {% highlight c# %} -pdfviewer.FreeTextModalViewDisappearing += PdfViewer_FreeTextModalViewDisappearing; +PdfViewer.FreeTextModalViewDisappearing += PdfViewer_FreeTextModalViewDisappearing; -Private void PdfViewer_FreeTextModalViewDisappearing(object? Sender, EventArgs e) +private void PdfViewer_FreeTextModalViewDisappearing(object? sender, EventArgs e) { // Implement the logic to show the UI elements that were hidden from the FreeTextModalViewAppearing event handler. } @@ -214,17 +225,17 @@ Private void PdfViewer_FreeTextModalViewDisappearing(object? Sender, EventArgs e ### Suppressing the free text modal view and implementing your own UI -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the free text modal view and use your own UI in its place. This can be achieved by setting the [AnnotationModalViewAppearingEventArgs.Cancel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ModalViewAppearingEventArgs.html#Syncfusion_Maui_PdfViewer_ModalViewAppearingEventArgs_Cancel) property to `true` in the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) event handler. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the free text modal view and use your own UI in its place. This can be achieved by setting the [AnnotationModalViewAppearingEventArgs.Cancel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ModalViewAppearingEventArgs.html#Syncfusion_Maui_PdfViewer_ModalViewAppearingEventArgs_Cancel) property to `true` in the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) event handler. The `ShowCustomDialog()` and `customDialog.Text` used in the sample below are user-defined and must be implemented by the developer. -The below code snippet illustrates suppressing the free text modal view and using a UI implemented in the app in its place. The free text annotation instance that is created or edited can be obtained from the event args. Once the user enters the text in the custom dialog and confirms, the text can be assigned to this free text annotation instance. +The following code snippet illustrates suppressing the free text modal view and using a UI implemented in the app in its place. The free text annotation instance that is created or edited can be obtained from the event args. Once the user enters the text in the custom dialog and confirms, the text can be assigned to this free text annotation instance. {% tabs %} {% highlight c# %} Annotation editedAnnotation; -pdfviewer.FreeTextModalViewAppearing += PdfViewer_FreeTextModalViewAppearing; +PdfViewer.FreeTextModalViewAppearing += PdfViewer_FreeTextModalViewAppearing; -private void PdfViewer_FreeTextModalViewAppearing(object? Sender, AnnotationModalViewAppearingEventArgs e) +private void PdfViewer_FreeTextModalViewAppearing(object? sender, AnnotationModalViewAppearingEventArgs e) { e.Cancel = true; editedAnnotation = e.Annotation; @@ -232,9 +243,9 @@ private void PdfViewer_FreeTextModalViewAppearing(object? Sender, AnnotationModa ShowCustomDialog(); } -Private void customDialogOkButton_Clicked(object sender, EventArgs e) +private void customDialogOkButton_Clicked(object sender, EventArgs e) { - //Get the typed text from the custom dialog + //Get the typed text from the custom dialog string newText = customDialog.Text; if(editedAnnotation is FreeTextAnnotation freeText) { @@ -245,9 +256,14 @@ Private void customDialogOkButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} -N> For WinUI and MacCatalyst platforms, there is no separate modal view to receive text input from the users. As a result, the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) and [FreeTextModalViewDisappearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewDisappearing) events are not applicable for these platforms. +**Note:** For WinUI and MacCatalyst platforms, there is no separate modal view to receive text input from the users. As a result, the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) and [FreeTextModalViewDisappearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewDisappearing) events are not applicable for these platforms. ## See Also + - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) -- [Add, Remove, and Modify Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) - [Text Markups](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups) +- [Comments](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-comment) +- [Sticky Notes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/sticky-notes) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md index 03a061ee29..6adf7cc680 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md @@ -102,7 +102,7 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma using System.ComponentModel; using System.Reflection; -internal class PdfViewerViewModel : INotifyPropertyChanged +public class PdfViewerViewModel : INotifyPropertyChanged { private Stream pdfDocumentStream; @@ -133,7 +133,7 @@ internal class PdfViewerViewModel : INotifyPropertyChanged public PdfViewerViewModel() { // Load the embedded PDF document stream. - // Replace 'PdfViewerExample' with your project's namespace in resource path + // Replace 'PdfViewerExample' with your project's default namespace in the resource path. Verify that the namespace matches your project name. pdfDocumentStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("PdfViewerExample.Assets.PDF_Succinctly.pdf"); } @@ -169,8 +169,19 @@ xmlns:local="clr-namespace:PdfViewerExample" {% endhighlight %} {% 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. 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. +**Note:** 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). +**Note:** 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. + +{% tabs %} +{% highlight c# %} +// Call UnloadDocument when navigating away from the page to free resources. +protected override void OnNavigatedFrom(NavigatedFromEventArgs args) +{ + PdfViewer.UnloadDocument(); + base.OnNavigatedFrom(args); +} +{% endhighlight %} +{% endtabs %} ## Step 6: Running the Application @@ -187,13 +198,13 @@ Before proceeding, ensure the following are in place: 1. Install [.NET 9 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) or later. 2. Set up a .NET MAUI environment with Visual Studio Code. -3. Ensure that the .NET MAUI workload is installed and configured as described [here](https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation?view=net-maui-8.0&tabs=visual-studio-code). +3. Ensure that the .NET MAUI workload is installed and configured as described in the [.NET MAUI installation guide](https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation?view=net-maui-9.0&tabs=visual-studio-code). ## Step 1: Create a New MAUI Project -1. Open the command palette by pressing `Ctrl+Shift+P` and type **.NET:New Project** and enter. +1. Open the command palette by pressing `Ctrl+Shift+P` and type **.NET: New Project** and press Enter. 2. Choose the **.NET MAUI App** template. -3. Select the project location, type the project name and press enter. +3. Select the project location, type the project name, and press Enter. 4. Then choose **Create project**. ## Step 2: Install the Syncfusion® MAUI PDF Viewer NuGet Package @@ -265,11 +276,14 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma {% highlight xml tabtitle="PdfViewerExample.csproj" %} - + {% endhighlight %} {% endtabs %} + +If the project does not reload automatically after editing the `.csproj`, close and reopen the project. + 3. In this example, the PDF document is loaded using MVVM binding. Create a new C# file named `PdfViewerViewModel.cs` and add the following code snippet. {% tabs %} @@ -278,7 +292,7 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma using System.ComponentModel; using System.Reflection; -internal class PdfViewerViewModel : INotifyPropertyChanged +public class PdfViewerViewModel : INotifyPropertyChanged { private Stream pdfDocumentStream; @@ -309,7 +323,7 @@ internal class PdfViewerViewModel : INotifyPropertyChanged public PdfViewerViewModel() { // Load the embedded PDF document stream. - // Replace 'PdfViewerExample' with your project's namespace in resource path + // Replace 'PdfViewerExample' with your project's default namespace in the resource path. Verify that the namespace matches your project name. pdfDocumentStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("PdfViewerExample.Assets.PDF_Succinctly.pdf"); } @@ -326,7 +340,7 @@ internal class PdfViewerViewModel : INotifyPropertyChanged {% endhighlight %} {% endtabs %} -4. Open the `MainPage.xaml` file again and add the namespace `PdfViewerExample`and name it as `local`. +4. Open the `MainPage.xaml` file again and add the namespace `PdfViewerExample` and name it as `local`. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} xmlns:local="clr-namespace:PdfViewerExample" @@ -368,7 +382,7 @@ Before proceeding, ensure the following are set up: ## Step 1: Create a new .NET MAUI Project -1. Go to **File > New Solution,** Select .NET (C#), and choose the .NET MAUI App template. +1. Go to **File > New Solution**, select .NET (C#), and choose the .NET MAUI App template. 2. Enter the Project Name, Solution Name, and Location. 3. Select the .NET Framework version and click Create. @@ -388,7 +402,7 @@ dotnet restore ## Step 3: Register the Syncfusion® Core Handler -[Syncfusion.Maui.Core](https://www.nuget.org/packages/Syncfusion.Maui.Core/) is a dependency for all MAUI Syncfusion controls. This package will be automatically installed as a dependency when [Syncfusion.Maui.PdfViewer](https://www.nuget.org/packages/Syncfusion.Maui.PdfViewer) NuGet is installed. +[Syncfusion.Maui.Core](https://www.nuget.org/packages/Syncfusion.Maui.Core/) is automatically installed as a dependency when [Syncfusion.Maui.PdfViewer](https://www.nuget.org/packages/Syncfusion.Maui.PdfViewer) NuGet is installed. 1. Add the following namespace in your `MauiProgram.cs` file. {% tabs %} @@ -425,16 +439,16 @@ Open the `MainPage.xaml` file and follow the steps below. 1. Add the following namespace in your MainPage.xaml file. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} - xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" {% endhighlight %} {% endtabs %} -2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. Name the PDF viewer control as `pdfViewer`. +2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} - + {% endhighlight %} {% endtabs %} @@ -448,7 +462,7 @@ Open the `MainPage.xaml` file and follow the steps below. {% highlight xml tabtitle="PdfViewerExample.csproj" %} - + {% endhighlight %} @@ -461,7 +475,7 @@ Open the `MainPage.xaml` file and follow the steps below. using System.ComponentModel; using System.Reflection; -internal class PdfViewerViewModel : INotifyPropertyChanged +public class PdfViewerViewModel : INotifyPropertyChanged { private Stream pdfDocumentStream; @@ -492,7 +506,7 @@ internal class PdfViewerViewModel : INotifyPropertyChanged public PdfViewerViewModel() { // Load the embedded PDF document stream. - // Replace 'PdfViewerExample' with your project's namespace in resource path + // Replace 'PdfViewerExample' with your project's default namespace in the resource path. Verify that the namespace matches your project name. pdfDocumentStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("PdfViewerExample.Assets.PDF_Succinctly.pdf"); } @@ -539,7 +553,7 @@ N> 2. If you are using multiple pages in your application, then make sure to unl {% endtabcontent %} {% endtabcontents %} -![Getting started with .NET MAUI PDF Viewer](Images\Getting-Started\maui-pdf-viewer-getting-started.png) +![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/tree/master/Getting%20Started).  diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md b/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md index dc4d5b61be..2bcdd3c2a0 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md @@ -12,7 +12,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne Give users precise control over how PDF content is displayed — from pinch-to-zoom on touch screens to setting an exact zoom percentage in code. You can also lock the view to predefined zoom modes like *Fit to Page* or *Fit to Width* to optimize readability for different document types. -## Adjusting the Zoom Factor +## Adjusting the zoom factor You can control the zoom level using the [ZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ZoomFactor) property. Refer to the following code example. @@ -28,7 +28,13 @@ PdfViewer.ZoomFactor = 3; You can also retrieve the current zoom level using the same property. -### Setting Minimum and Maximum Zoom Limits +{% tabs %} +{% highlight c# %} +double currentZoom = PdfViewer.ZoomFactor; +{% endhighlight %} +{% endtabs %} + +### Setting minimum and maximum zoom limits By default, the zoom range varies by platform: * **Mobile (Android/iOS):** 1.0 to 4.0 @@ -63,25 +69,25 @@ The PDF Viewer supports the following zoom modes via the [ZoomMode](https://help The default value is [ZoomMode.Default](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_Default). -### Zoom Mode via Built-In Toolbar +### Zoom mode via the built-in toolbar #### Desktop Toolbar The built-in toolbar includes a magnification dropdown showing the current zoom percentage. Users can select predefined zoom levels or choose **Fit to Page** / **Fit to Width**. -![Desktop Zoom Mode Combo Box](Images/windowszoom.gif) +![Desktop zoom mode combo box](Images/windowszoom.gif) #### Mobile Toolbar On mobile, the magnification tool appears only after the zoom factor changes. Users can then select **Fit to Page** or **Fit to Width**. Once selected, the icon disappears until the zoom factor changes again. -![Mobile Zoom Mode Combo box](Images/ZoomModeforMobile.gif) +![Mobile zoom mode combo box](Images/ZoomModeforMobile.gif) -### Programmatically Setting Zoom Mode +### Programmatically setting zoom mode #### Fit to Page -You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToPage) enumeration. It will magnify the PDF document so that the entire PDF page is visible in the view port. +You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToPage) enumeration. It magnifies the PDF document so that the entire PDF page is visible in the viewport. Refer to the following code example:  {% tabs %} @@ -97,7 +103,7 @@ pdfViewer.ZoomMode = ZoomMode.FitToPage; #### Fit to Width -You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToWidth) enumeration. It will magnify the PDF document so that the widest page of the PDF document fits the width of the view port. +You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToWidth) enumeration. It magnifies the PDF document so that the widest page of the PDF document fits the width of the viewport. Refer to the following code example: {% tabs %} @@ -106,14 +112,14 @@ Refer to the following code example: {% endhighlight %} {% highlight c# %} -// To apply fit-to-page zoom mode. +// To apply fit-to-width zoom mode. pdfViewer.ZoomMode = ZoomMode.FitToWidth; {% endhighlight %} {% endtabs %} N> When the `ZoomFactor` is manually changed, the `ZoomMode` resets to `Default`. You can reapply the desired zoom mode afterward. -## Maintain Zoom Level in Single Page View Mode +## Maintain zoom level in single-page view mode In single-page view mode, the zoom level resets to default each time you navigate to a new page. To maintain a consistent zoom factor throughout the document, enable the [PersistZoomOnPageChange](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PersistZoomOnPageChange) property. This applies whether navigation is triggered by the built-in toolbar controls or programmatic APIs. The default value of [PersistZoomOnPageChange](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PersistZoomOnPageChange) is `False`. @@ -153,7 +159,7 @@ PdfViewer.PersistZoomOnPageChange = false; {% endhighlight %} {% endtabs %} -## Enable or Disable Double-Tap Zoom +## Enable or disable double-tap zoom The PDF Viewer allows users to zoom in and out of the document using a double-tap gesture. This behavior can be controlled programmatically using the `AllowDoubleTapZoom` property. @@ -173,6 +179,10 @@ pdfViewer.AllowDoubleTapZoom = false; {% endtabs %} ## See Also + - [Scrolling](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/scrolling) - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) - [Gesture Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/gesture-events) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) +- [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Overview.md index 4fe084bb75..f8e12c5d87 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Overview.md @@ -10,13 +10,13 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # .NET MAUI PDF Viewer (SfPdfViewer) Overview -Build powerful PDF experiences into your .NET MAUI app with the [SfPdfViewer](https://www.syncfusion.com/maui-controls/maui-pdf-viewer) control. Whether you need to display documents for review, let users fill out forms, redact sensitive data, or annotate content — the PDF Viewer gives you a full-featured, cross-platform solution that works on Android, iOS, macOS, and Windows from a single code base. +Build powerful PDF experiences into your .NET MAUI app with the [SfPdfViewer](https://www.syncfusion.com/maui-controls/maui-pdf-viewer) control. Whether you need to display documents for review, let users fill out forms, redact sensitive data, or annotate content — the PDF Viewer gives you a full-featured, cross-platform solution that works on Android, iOS, macOS, and Windows from a single codebase. To get started, see [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started). -## In This Section +## In this section | Topic | Description | |---|---| -| [Getting Started](https://help.syncfusion.com/maui/pdf-viewer/getting-started) | Install the package, configure the handler, and load your first PDF document. | +| [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) | Install the package, configure the handler, and load your first PDF document. | | [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) | Load documents from streams, local storage, URLs, Base64 strings, or password-protected files. | | [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) | Add, edit, import, and export highlights, shapes, ink, stamps, sticky notes, and more. | | [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) | Fill, edit, import, and export PDF form fields including text boxes, checkboxes, and signatures. | @@ -26,42 +26,68 @@ Build powerful PDF experiences into your .NET MAUI app with the [SfPdfViewer](ht | [Toolbar Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar-customization) | Show, hide, add, remove, and reorder toolbar items. | | [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) | Customize the appearance of the PDF Viewer control. | | [Redaction](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/redaction) | Permanently remove sensitive content from PDF documents. | -| [Electronic Signature](https://help.syncfusion.com/maui/pdf-viewer/signature) | Add handwritten, typed, or image-based signatures. | -| [Keyboard Shortcuts](https://help.syncfusion.com/maui/pdf-viewer/keyboard-shortcuts) | Keyboard shortcuts available on desktop platforms. | -| [Localization](https://help.syncfusion.com/maui/pdf-viewer/localization) | Translate all built-in strings into any supported language. | +| [Electronic Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) | Add handwritten, typed, or image-based signatures. | +| [Keyboard Shortcuts](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/keyboard-shortcuts) | Keyboard shortcuts available on desktop platforms. | +| [Localization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/localization) | Translate all built-in strings into any supported language. | | [Migration Guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/migration) | Migrate from Xamarin.Forms SfPdfViewer to .NET MAUI SfPdfViewer. | ## Key Features +### Navigation and viewing + * **Virtual scrolling** - Easily scroll through the pages in the document fluently. Pages are rendered only when required to improve loading and scrolling performance. * **Magnification** - The content of a PDF document can be efficiently zoomed in and out by pinching or changing the zoom factor programmatically. * **Zoom modes** - Improve document readability by adjusting magnification to suit your viewing needs. Use *Fit to Page* to display the entire page without scrolling, ideal for quick overviews. Choose *Fit to Width* for optimal reading of content with narrow columns, such as newspapers or multi-column layouts. * **Page navigation** - Navigate to the desired pages instantly using the page navigation option programmatically or by dragging the scroll head in the UI. -* **Open password-protected PDFs** - Load and view password-protected PDFs in a hassle-free way. You can design a custom password request view and integrate the functionality easily with the options available. -* **Built-in Toolbar** - The PDF Viewer control includes a built-in toolbar, offering a seamless user experience with essential functions such as page navigation, text search, page layout mode adjustments, and various annotation tools. The toolbar's visibility can also be customized according to user preferences. -* **Text search** - Search for text and instantly navigate all its occurrences in a PDF document. -* **Select and copy text** - Select text from a PDF document and copy it to the clipboard. This helps share text content with others. +* **Page layout modes** - View the PDF files in different page layout modes, such as continuous scroll and single page. * **Outline view** - Use the outline view's hierarchical list of headings and subheadings to instantly navigate to the required topic in the document. * **Custom bookmarks** - Add, remove, and modify custom bookmarks in PDF files. This feature lets you quickly jump to specific sections or chapters without scrolling through the entire document. * **Document link navigation** - Navigate to the topic or position by tapping the document link annotation of the topics in the table of contents in a PDF document. * **Hyperlink navigation** - Detects hyperlinks, and tapping on the hyperlink will open the URL in a browser. -* **Form filling** - Fill, modify, import, export, and save form data from PDF documents. This feature helps to digitize the manual process of filling out paper forms. This can be used for filling out job applications, registration forms, medical forms, etc. Supported form fields are text box, checkbox, radio button, combo box, list box, button (only GoTo actions), and signature. -* **Ink or free-hand drawing annotation** - Add, remove, modify, save, import, and export ink annotations in PDF files. This feature will help make quick notes on specific text or passages, add marks or drawings to images, and add handwritten signatures. -* **Ink or free-hand drawing eraser** - Remove or erase portions of freehand drawings or ink annotations. This feature can be used to correct a mistake or remove unwanted marks. -* **Shape annotations** - Add, remove, modify, import, and export shape annotations in PDF files. The available shapes are arrow, circle, line, rectangle, polygon, and polyline. This feature will help highlight important paragraphs, images, or blocks of text, point out certain areas of interest, underline text or phrases in an image, or divide different sections or paragraphs, and provide directional guidance. +* **Text search** - Search for text and instantly navigate all its occurrences in a PDF document. +* **Select and copy text** - Select text from a PDF document and copy it to the clipboard. This helps share text content with others. +* **Coordinates conversion** - Obtain the PDF page coordinates relative to the PDF Viewer's client coordinates and vice versa. It also helps to obtain the scroll point relative to the PDF page coordinates and bring the given region into view. + +### Document loading and security + +* **Open password-protected PDFs** - Load and view password-protected PDFs in a hassle-free way. You can design a custom password request view and integrate the functionality easily with the options available. +* **Redaction** - Permanently remove sensitive content from PDF documents. + +### Annotations + +* **Ink or freehand drawing annotation** - Add, remove, modify, save, import, and export ink annotations in PDF files. This feature helps make quick notes on specific text or passages, add marks or drawings to images, and add handwritten signatures. +* **Ink or freehand drawing eraser** - Remove or erase portions of freehand drawings or ink annotations. This feature can be used to correct a mistake or remove unwanted marks. +* **Shape annotations** - Add, remove, modify, import, and export shape annotations in PDF files. The available shapes are arrow, circle, line, rectangle, polygon, and polyline. This feature helps highlight important paragraphs, images, or blocks of text, point out certain areas of interest, underline text or phrases in an image, or divide different sections or paragraphs, and provide directional guidance. * **Stamp annotation** - Add, remove, modify, import, and export stamp annotations in PDF files. Stamps are predefined graphical text that can be used to mark or signify certain aspects of documents, like that they have undergone quality checks or audits. This feature also allows adding personalized images or text to PDF documents. -* **Sticky note annotation** - Add, remove, modify, import, and export sticky note annotations in PDF files. This feature will help add comments or notes to a specific part of a document to clarify complex concepts, terms, or ideas. -* **Text markup annotations** - Add, remove, modify, import, and export text markup annotations in PDF files. The available text markups are highlight, underline, strikeout, and squiggly. This feature will help mark important passages, emphasize specific words or phrases, indicate that certain content should be removed, or indicate that text contains possible errors. +* **Sticky note annotation** - Add, remove, modify, import, and export sticky note annotations in PDF files. This feature helps add comments or notes to a specific part of a document to clarify complex concepts, terms, or ideas. +* **Text markup annotations** - Add, remove, modify, import, and export text markup annotations in PDF files. The available text markups are highlight, underline, strikeout, and squiggly. This feature helps mark important passages, emphasize specific words or phrases, indicate that certain content should be removed, or indicate that text contains possible errors. * **Free text annotation** - Add, remove, modify, import, and export free text annotations in PDF files. This feature helps to add text notes, comments, or feedback to PDF documents. -* **Show and Hide Annotations** - This feature enables users to manage the visibility of specific annotations or all annotations within the document. +* **Show and hide annotations** - This feature enables users to manage the visibility of specific annotations or all annotations within the document. + +### Form filling and signatures + +* **Form filling** - Fill, modify, import, export, and save form data from PDF documents. This feature helps to digitize the manual process of filling out paper forms. This can be used for filling out job applications, registration forms, medical forms, etc. Supported form fields are text box, checkbox, radio button, combo box, list box, button (only GoTo actions), and signature. * **Electronic signatures** - Add, remove, and modify electronic signatures in PDF files that include freehand-drawn, text, and image signatures. It can be used to sign contracts and agreements digitally, eliminating the need for physical signatures. -* **Page layout modes** - View the PDF files in different page layout modes, such as continuous scroll and single page. -* **Save** - Save the modified PDF files. -* **Print** - Print the PDF files. -* **Coordinates conversion** - Obtain the PDF page coordinates relative to the PDF Viewer’s client coordinates and vice versa. It also helps to obtain the scroll point relative to the PDF page coordinates and bring the given region into view. + +### Toolbar and customization + +* **Built-in toolbar** - The PDF Viewer control includes a built-in toolbar, offering a seamless user experience with essential functions such as page navigation, text search, page layout mode adjustments, and various annotation tools. The toolbar's visibility can also be customized according to user preferences. * **Localization** - All static text within the PDF Viewer can be localized to any supported language. +### Saving and printing + +* **Save** - Save the modified PDF files to a file stream, with optional annotation flattening. +* **Print** - Print the PDF files directly from the viewer. + ## See Also + - [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) +- [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) +- [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/magnification) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) +- [Print a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/print-a-document) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [Redaction](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/redaction) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md b/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md index c3fb16a8c0..6ebe255cdd 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md @@ -12,22 +12,38 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne Before sharing a PDF externally, use redaction to permanently remove sensitive data — such as personal details, financial figures, or confidential text — from the document. Unlike simply covering content with a shape or annotation, redaction in [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) eliminates the underlying content entirely once the document is saved, making recovery impossible. -## Types of Redactions +## Types of redactions The PDF Viewer provides multiple methods to apply redaction, allowing you to securely conceal sensitive content based on different requirements. The available redaction types include: -- **Text-based Redaction** : Allows you to manually select the texts on a page and apply redaction to hide the texts. -- **Selected Area Redaction** : Allows you to manually select a rectangular area on a page and apply redaction to hide any content within that region. -- **Page-based Redaction** : Enables you to redact entire pages of a PDF document, ensuring that all content on those pages is permanently removed. +- **Text-based redaction**: Allows you to manually select the texts on a page and apply redaction to hide the texts. +- **Selected area redaction**: Allows you to manually select a rectangular area on a page and apply redaction to hide any content within that region. +- **Page-based redaction**: Enables you to redact entire pages of a PDF document, ensuring that all content on those pages is permanently removed. +Text-based and selected-area redactions can be performed either with the built-in toolbar or with UI interaction using the `RedactionMode` property. Page-based redaction is available only programmatically via the `AddPageRedactionMarks` method. -## Mark region to redact +## Customize the default redaction appearance + +In redaction mode, the redaction is applied with a default appearance and behavior. You can modify these settings before marking regions on the pages. To define the appearance and behavior, customize the default settings using the [RedactionSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +The following example demonstrates how to obtain the default redaction settings and modify their appearance properties. Similarly, you can modify other available properties. -You need to mark the region for redaction by using one of the available methods such as text-based, selected-area or page-based redaction. +{% tabs %} +{% highlight c# %} +void CustomizeDefaultRedactionSettings() +{ + // Access the default redaction settings from the SfPdfViewer instance and modify the default appearance properties. + PdfViewer.RedactionSettings.MarkerBorderColor = Colors.Blue; // Border color for the marked region. + PdfViewer.RedactionSettings.FillColor = Colors.Red; // Fill color after redaction is applied. + PdfViewer.RedactionSettings.FontColor = Colors.Black; // Font color for overlay text. + PdfViewer.RedactionSettings.OverlayText = "text"; // Text to display on the redacted area. + PdfViewer.RedactionSettings.IsRepeat = true; // Repeat overlay text across the redacted area. +} +{% endhighlight %} +{% endtabs %} -## Mark regions for redaction using toolbar +## Mark regions for redaction using the built-in toolbar -The built-in toolbar includes a redaction tool that allows you to redact text, specific areas, or entire pages by marking the desired region on the PDF document and clicking the Apply button. The toolbar also provides options to modify redaction properties, such as the color and the text to display in the redacted area. +You need to mark the region for redaction by using one of the available methods such as text-based, selected-area, or page-based redaction. The built-in toolbar includes a redaction tool that allows you to redact text, specific areas, or entire pages by marking the desired region on the PDF document and clicking the Apply button. The toolbar also provides options to modify redaction properties, such as the color and the text to display in the redacted area. The following image represents how to perform redactions using the toolbar on the desktop. @@ -39,14 +55,14 @@ The following image represents how to perform redactions using the toolbar on mo ## Mark regions for redaction without using the toolbar -You can mark the region for redaction in a PDF document with UI interaction using touch or mouse using the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to mark the region on a PDF. +You can mark the region for redaction in a PDF document with UI interaction (touch or mouse) by setting the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to mark the region on a PDF. -1. Set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to Text or Rect. It activates the text-based or selected-area Redaction mode on the control. -2. Place your finger (or mouse) on the text in the PDF document, where you want to start redaction. +1. Set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to Text or Rect. It activates the text-based or selected-area redaction mode on the control. +2. Place your finger (or mouse) over the text in the PDF document where you want to start redaction. 3. Drag the finger (or cursor) across the text to select. 4. Complete adding the region to the selected text or area by releasing the finger (or cursor). -5. Once you have done that, set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) to None. It will disable the redaction mode and save the marked region for redaction. -6. You can later redact the marked regions using [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method. +5. Once you have finished marking regions, set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) to None. It will disable the redaction mode. The marked regions will be retained for redaction. +6. You can later redact the marked regions using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method. The following code explains how to enable the text-based redaction mode. @@ -83,7 +99,7 @@ void DisableRedactionMode() ## How to perform redaction programmatically -### Add redaction mark on the PDF +### Add a redaction mark to the PDF You can mark regions for text or specific areas programmatically using the [AddRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), and redact entire pages using the [AddPageRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddPageRedactionMarks_System_Collections_Generic_List_System_Int32__) method. The following example demonstrates how to mark regions for redaction, such as a specific area and page in the PDF document. @@ -102,17 +118,31 @@ void AddRedactionMarkOnSpecificRegionAndPages() PdfViewer.AddRedactionMark(redactionMark); // Add redaction marks to specific pages (pages 3, 5, and 1). - PdfViewer.AddPageRedactionMarks(new List([3, 5, 1])); + PdfViewer.AddPageRedactionMarks(new List { 3, 5, 1 }); } {% endhighlight %} {% endtabs %} -### Remove the selected redaction mark on the PDF +### Redact the marked region -You can remove a redaction mark for text, a specific area, or a page programmatically using the [SelectedRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectedRedactionMark) property and the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of SfPdfViewer. To remove a redaction mark, select the specific mark you want to delete and pass it to the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method. The following example demonstrates how to remove a selected redaction mark from the PDF document. +After marking the regions, you can redact them by using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This method redacts all marked regions and saves the document, making the changes irreversible. The following example demonstrates how to redact a marked region or page in a PDF document. {% tabs %} -{% highlight C# %} +{% highlight c# %} +private async void RedactMarkedRegion() +{ + // Apply redaction to all marked regions in the PDF document. + await PdfViewer.RedactAsync(); +} +{% endhighlight %} +{% endtabs %} + +### Remove the selected redaction mark + +You can remove a redaction mark for text, a specific area, or a page programmatically using the [SelectedRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectedRedactionMark) property and the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of the SfPdfViewer. To remove a redaction mark, select the specific mark you want to delete and pass it to the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method. The following example demonstrates how to remove a selected redaction mark from the PDF document. + +{% tabs %} +{% highlight c# %} void RemoveSelectedRedactionMark() { // Check if any redaction mark is currently selected. @@ -125,12 +155,12 @@ void RemoveSelectedRedactionMark() {% endhighlight %} {% endtabs %} -### Remove all the redaction marks in the PDF +### Remove all redaction marks You can remove all redaction marks from a document programmatically by calling the [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method. The following example demonstrates how to remove all redaction marks from a PDF document. {% tabs %} -{% highlight C# %} +{% highlight c# %} void RemoveAllRedactionMarksDrawn() { // Removes all the redaction marks from a PDF document using [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). @@ -139,41 +169,12 @@ void RemoveAllRedactionMarksDrawn() {% endhighlight %} {% endtabs %} -### Redact the marked region - -You can redact the marked regions by using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This method redacts all marked regions and saves the document, making the changes irreversible. The following example demonstrates how to redact a marked region or page in a PDF document. - -{% tabs %} -{% highlight C# %} -private async void RedactMarkedRegion() -{ - // Apply redaction to all marked regions in the PDF document. - await PdfViewer.RedactAsync(); -} -{% endhighlight %} -{% endtabs %} - -## Customize the default redaction appearance - -In redaction mode, the redaction is applied with a default appearance and behavior. You can modify these settings before marking regions on the pages. To define the appearance and behavior, customize the default settings using the [RedactionSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). -The following example demonstrates how to obtain the default redaction settings and modify their appearance properties. Similarly, you can modify other available properties. - -{% tabs %} -{% highlight C# %} -void CustomizeDefaultRedactionSettings() -{ - // Access the default redaction settings from the SfPdfViewer instance and modify the default appearance properties. - PdfViewer.RedactionSettings.MarkerBorderColor = Colors.Blue; // Border color for the marked region. - PdfViewer.RedactionSettings.FillColor = Colors.Red; // Fill color after redaction is applied. - PdfViewer.RedactionSettings.FontColor = Colors.Black; // Font color for overlay text. - PdfViewer.RedactionSettings.OverlayText = "text"; // Text to display on the redacted area. - PdfViewer.RedactionSettings.IsRepeat = true; // Repeat overlay text across the redacted area. -} -{% endhighlight %} -{% endtabs %} - ## See Also + - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) - [Text Search](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-search) - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) - [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) +- [Print a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/print-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md b/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md index 5468d2d858..038b8348f5 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md @@ -14,7 +14,7 @@ Keep document navigation smooth and predictable by using the PDF Viewer's built- W> Since the PDF Viewer includes built-in scrolling, avoid placing it inside other scrollable containers like [ScrollView](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/scrollview?view=net-maui-8.0), as this may lead to unexpected behavior. -## Programmatic Scrolling +## Programmatic scrolling Use the [ScrollToOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ScrollToOffset_System_Double_System_Double_) method to scroll to a specific horizontal and vertical offset. Offset values are measured in **device-independent units**. If the specified offset is invalid or out of bounds, the scroll action will be ignored and the viewer will retain its current position. @@ -25,11 +25,11 @@ PdfViewer.ScrollToOffset(100, 1000); {% endhighlight %} {% endtabs %} -## Detect Scroll Changes +## Detect scroll changes -You can monitor scroll changes using the `PropertyChanged` event. By monitoring the [HorizontalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_HorizontalOffset) and [VerticalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_VerticalOffset) property changes, you can respond to both the horizontal and vertical scroll movements respectively. +You can monitor scroll changes using the `PropertyChanged` event. By monitoring the [HorizontalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_HorizontalOffset) and [VerticalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_VerticalOffset) property changes, you can respond to horizontal and vertical scroll movements. -The following is the code example for subscribing to the `PropertyChanged` event. +The following code example shows how to subscribe to the `PropertyChanged` event. {% tabs %} {% highlight XAML %} @@ -50,7 +50,7 @@ void SubscribeToPropertyChangedEvent() {% endhighlight %} {% endtabs %} -The following code example illustrates how implement the event handler and to respond to both horizontal and vertical scroll changes: +The following code example illustrates how to implement the event handler and respond to both horizontal and vertical scroll changes: {% tabs %} {% highlight c# %} @@ -71,15 +71,15 @@ private void PdfViewer_PropertyChanged(object sender, {% endhighlight %} {% endtabs %} -## Detecting End of Document +## Detecting end of document You can determine if the control has reached the vertical end of the document by evaluating the following properties: -* `VerticalOffset`: It provides the current vertically scrolled offset. -* `ClientRectangle`: It provides the viewport area bounds. -* `ExtentHeight`: It provides the overall vertical height of the PDF document. +* `VerticalOffset`: Provides the current vertical scroll offset. +* `ClientRectangle`: Provides the viewport area bounds. +* `ExtentHeight`: Provides the overall vertical height of the PDF document. -Below is the code example to detect whether the control has reached the vertical end of the document. +The following code example detects whether the control has reached the vertical end of the document. {% tabs %} {% highlight c# %} @@ -110,7 +110,6 @@ private void PdfViewer_PropertyChanged(object sender, PdfViewer.ClientRectangle.Width >= PdfViewer.ExtentWidth); } } - {% endhighlight %} {% endtabs %} @@ -118,7 +117,7 @@ private void PdfViewer_PropertyChanged(object sender, On Android and iOS platforms, the scroll head offers a quick way to move through pages. Users can drag the thumb indicator to scroll within the PDF document. -![Scroll Head](Images\ScrollHead.png) +![Scroll head](Images/ScrollHead.png) ### Show or Hide the Scroll Head @@ -139,7 +138,7 @@ When scrolling through large PDF documents, you may notice blank pages appearing To minimize this and provide a smoother scrolling experience, the SfPdfViewer control offers the `OverscanCount` property. This property defines how many pages should be pre-rendered and kept in memory on each side of the current viewport. Increasing this value reduces the chance of blank pages during fast scrolling but may increase memory usage. -The following example shows how to set `OverscanCount` property: +The following example shows how to set the `OverscanCount` property: {% tabs %} {% highlight xaml %} @@ -148,20 +147,21 @@ The following example shows how to set `OverscanCount` property: {% endhighlight %} {% highlight c# %} -SfPdfViewer PdfViewer = new SfPdfViewer(); - // Set the cache range (number of pages before and after the current viewport) PdfViewer.OverscanCount = 15; - -// Load a PDF document -PdfViewer.LoadDocument("sample.pdf"); {% endhighlight %} {% endtabs %} -N> - Use a reasonable OverscanCount value. Large values can cause memory spikes and app freezes. -N> - Pages with very high resolution may still render slowly due to native rendering limitations. +**Note:** +* Use a reasonable `OverscanCount` value. Large values can cause memory spikes and app freezes. +* Pages with very high resolution may still render slowly due to native rendering limitations. ## See Also + - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) - [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/magnification) - [Gesture Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/gesture-events) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) +- [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) +- [Coordinate Conversion](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/coordinates-conversion) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md b/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md index a43874cbac..39557b0c21 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md @@ -10,24 +10,24 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, mau # Shape Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The shape annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove and modify shapes in the PDF document. This is useful for making corrections or emphasizing important points in the document. This section will go through the various types and functions available in the PDF Viewer for working with shape annotations. +The shape annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify shapes in the PDF document. This is useful for making corrections or emphasizing important points in the document. This section explains the various types and functions available in the PDF Viewer for working with shape annotations. ## Types of shapes -The following shape annotation types are now available in the PDF Viewer. +The following shape annotation types are available in the PDF Viewer. -1. Arrow -2. Circle. -3. Line. -4. Square. -5. Polygon. -6. Polyline. +1. Arrow +2. Circle +3. Line +4. Square +5. Polygon +6. Polyline ## Add shapes to a PDF document -This section will cover how to add shape annotations to a PDF document using a toolbar as well as programmatically. +This section explains how to add shape annotations to a PDF document using the built-in toolbar as well as programmatically. -### Add shapes using the toolbar +### Add shapes using the toolbar A shape annotation tool with seven different sorts of annotations (arrow, circle, square, line, polygon, polyline, and cloud) is accessible on the built-in toolbar. Users are able to select any of these shapes and draw them on the page at any desired location. Additionally, the toolbar allows modification of properties for both existing and new annotations of the selected shape. @@ -51,9 +51,9 @@ You can interactively draw and add shape annotations to a PDF document by touch 6. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). This will disable the circle drawing mode and save the drawn circles to the PDF pages as circle annotations. 7. You can later move, resize, or edit the annotation. -### Add Polygon and Polyline shapes +### Add polygon and polyline shapes -Adding polygon and polyline shapes with touch or mouse will vary slightly from adding other shape types. To add it interactively, refer to the following steps. +Adding polygon and polyline shapes with a touch or mouse differs slightly from adding other shape types. To add one interactively, refer to the following steps. 1. Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [Polygon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Polygon) or [Polyline](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Polyline). It sets the control’s drawing mode to polygon or polyline, respectively. 2. To begin drawing the shape, tap the desired location on the screen (using touch or mouse). @@ -118,7 +118,7 @@ CircleAnnotation CreateCircleAnnoation() void AddCircleAnnotation() { - Annotation circleAnnotation = CreateCircleAnnoation(); + Annotation circleAnnotation = CreateCircleAnnotation(); //Add the circle annotation to the PDF document using the AddAnnotation method of the `SfPdfViewer` instance. PdfViewer.AddAnnotation(circleAnnotation); @@ -133,7 +133,7 @@ In the shape annotation mode, the shape annotations will be drawn with a default The following example explains how to obtain the default circle annotation settings and modify some of its properties. Similarly, you can also modify the properties of other shape annotations. {% tabs %} -{% highlight C# %} +{% highlight c# %} void CustomizeDefaultCircleSettings() { //Obtain the default circle annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. @@ -151,7 +151,7 @@ void CustomizeDefaultCircleSettings() ## Edit the selected shape annotation -You can edit the properties of the selected shape annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected circle annotation. Similarly, you can modify the other shape annotation properties. +You can edit the properties of the selected shape annotation programmatically by accessing the selected annotation instance. You can obtain the selected annotation instance from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected circle annotation. Similarly, you can modify the other shape annotation properties. {% tabs %} {% highlight C# %} @@ -159,7 +159,7 @@ You can edit the properties of the selected shape annotation programmatically by /// Edit the selected circle annotation. /// /// The selected annotation instance that may be obtained from the annotation selected event -void EditSelectedCicleAnnotation(Annotation selectedAnnotation) +void EditSelectedCircleAnnotation(Annotation selectedAnnotation) { // Typecast the selected annotation as a circle annotation. if (selectedAnnotation is CircleAnnotation circleAnnotation) @@ -175,42 +175,41 @@ void EditSelectedCicleAnnotation(Annotation selectedAnnotation) ## Border styles for shape annotation [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to change the shape annotations' border style. Currently, it provides support for the following border styles. -1. Cloudy -2. Solid +1. Cloudy +2. Solid N> By default, the border style of the shape annotations is solid. The value of `BorderStyle` property is applicable only for square and polygon annotations only and it does not affect other shape annotations such as circle, line, arrow, and polyline annotations. -### Draw cloud shaped annotation +### Draw a cloud-shaped annotation -To draw a cloud annotation, set the annotation mode to either [AnnotationMode.Square](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html) or [AnnotationMode.Polygon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html). Then you should set the `BorderStyle` property of the shape annotation settings to `BorderStyle.Cloudy`. The following sample code illustrates how to draw a rectangle and polygon annotation with the cloud border style. +To draw a cloud annotation, set the annotation mode to either [AnnotationMode.Square](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html) or [AnnotationMode.Polygon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html). Then you should set the `BorderStyle` property of the shape annotation settings to `BorderStyle.Cloudy`. The following sample code illustrates how to draw a square and polygon annotation with the cloud border style. {% tabs %} -{% highlight C# %} +{% highlight c# %} // Draw square cloud annotation - SfPdfViewer pdfViewer = new SfPdfViwer(); - pdfViewer.AnnotationMode = AnnotationMode.Square; - pdfViewer.AnnotationSettings.Rectangle.BorederStyle = BorderStyle.Cloudy; + PdfViewer.AnnotationMode = AnnotationMode.Square; + PdfViewer.AnnotationSettings.Rectangle.BorderStyle = BorderStyle.Cloudy; {% endhighlight %} {% endtabs %} {% tabs %} -{% highlight C# %} +{% highlight c# %} - // Draw polygon cloud annotation - pdfViewer.AnnotationMode = AnnotationMode.Polygon; - pdfViewer.AnnotationSettings.Rectangle.BorederStyle = BorderStyle.Cloudy; + // Draw polygon cloud annotation + PdfViewer.AnnotationMode = AnnotationMode.Polygon; + PdfViewer.AnnotationSettings.Polygon.BorderStyle = BorderStyle.Cloudy; {% endhighlight %} {% endtabs %} ### Change the border style for the selected polygon annotation -You can change the border style of the selected polygon annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to change the border style of selected polygon annotation. Similarly, you can modify the square annotations border style. +You can change the border style of the selected polygon annotation programmatically by accessing the selected annotation instance. You can obtain the selected annotation instance from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to change the border style of the selected polygon annotation. Similarly, you can modify the square annotation's border style. {% tabs %} -{% highlight C# %} +{% highlight c# %} /// /// Change the selected shape annotation border style. /// @@ -218,11 +217,10 @@ You can change the border style of the selected polygon annotation programmatica void ChangeBorderStyleOfSelectedPolygonAnnotation(Annotation selectedAnnotation) { // Typecast the selected annotation as polygon annotation. - if (selectedAnnotation is PolygonAnnotation polygonAnnotation) - { - polygonAnnotation.BorderStyle = BorderStyle.Cloudy; // Change the border style to cloud. - } - + if (selectedAnnotation is PolygonAnnotation polygonAnnotation) + { + polygonAnnotation.BorderStyle = BorderStyle.Cloudy; // Change the border style to cloud. + } } {% endhighlight %} {% endtabs %} @@ -235,43 +233,49 @@ You can add cloud annotation to a PDF document using the built-in toolbar. ![Drawing cloud in mobile](Images/Annotations/mobile-cloud.gif) -### Add cloud shape annotation programmatically -You can create and add cloud polygon annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a cloud polygon annotation and add it to the first page of a PDF document. Similarly, you can add a square also. +### Add a cloud shape annotation programmatically + +You can create and add a cloud polygon annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a cloud polygon annotation and add it to the first page of a PDF document. Similarly, you can add a square. {% tabs %} -{% highlight C# %} -PolygonAnnotation CreateCloudAnnoation() +{% highlight c# %} +PolygonAnnotation CreateCloudAnnotation() { int pageNumber = 1; // Define the points for the polygon in the PDF coordinates. - List polygonPoints = new List - { new PointF(10, 10), - new PointF(100, 10), - new PointF(100, 100), - new PointF(10, 100) - }; + List polygonPoints = new List + { new PointF(10, 10), + new PointF(100, 10), + new PointF(100, 100), + new PointF(10, 100) + }; // Create a cloud border style polygon annotation. - PolygonAnnotation annotation = new PolygonAnnotation (polygonPoints, pageNumber); - + PolygonAnnotation annotation = new PolygonAnnotation(polygonPoints, pageNumber); + // Set the border style appearance for the polygon annotation. - annotation.BorderStyle = BorderStyle.Cloudy // set the border style + annotation.BorderStyle = BorderStyle.Cloudy; // set the border style return annotation; } void AddCloudAnnotation() { - Annotation polygonAnnotation = CreateCloudAnnoation(); + Annotation polygonAnnotation = CreateCloudAnnotation(); //Add the cloud border style polygon annotation to the PDF document using the AddAnnotation method of the `SfPdfViewer` instance. - PdfViewer.AddAnnotation(polygonAnnotation ); + PdfViewer.AddAnnotation(polygonAnnotation); } {% endhighlight %} {% endtabs %} ## See Also + - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) -- [Add, Remove, and Modify Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) - [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) +- [Comments](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-comment) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [Free Text](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/free-text) +- [Ink](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md b/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md index 13eda6edb0..4a425c385c 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Undo and Redo in .NET MAUI PDF Viewer (SfPdfViewer) -If you performed any undesired actions when adding, removing, moving, resizing or editing annotations, you can undo and redo the action to restore the previous state. This section will go through how to perform the undo and redo the changes made on the annotations. +If you performed any undesired actions when adding, removing, moving, resizing, or editing annotations, you can undo and redo the action to restore the previous state. This section explains how to undo and redo changes made to annotations. For desktop platforms such as Windows and macOS, you can also use the following shortcut keys to perform the actions. @@ -34,14 +34,14 @@ For desktop platforms such as Windows and macOS, you can also use the following ## Undo -You can perform undo to reverse the most recent action performed on the annotations using the [UndoCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UndoCommand) of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code examples explain how to bind the command to a button in XAML to perform the action on button click, and also execute the command programmatically as well. +You can undo the most recent action performed on the annotations using the [UndoCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UndoCommand) of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code examples show how to bind the command to a button in XAML to perform the action on button click, and how to execute the command programmatically. {% tabs %} -{% highlight XAML %} +{% highlight xaml %}
- + @@ -110,7 +109,7 @@ The `SfPdfViewer` supports the following keyboard interactions: - + @@ -119,7 +118,7 @@ The `SfPdfViewer` supports the following keyboard interactions: - + @@ -131,4 +130,4 @@ The `SfPdfViewer` supports the following keyboard interactions: ## Easier Touch Targets -The [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) has a touch target of 48 x 48, as per the standard for all elements. \ No newline at end of file +The [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) has a touch target of 48 x 48, as per the Material Design standard. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/add-remove-modify-annotations.md b/Document-Processing/PDF/PDF-Viewer/flutter/add-remove-modify-annotations.md index 59c0733509..9834f6b427 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/add-remove-modify-annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/add-remove-modify-annotations.md @@ -17,7 +17,7 @@ This section will go through how to add annotations to a PDF document programmat ### Add Annotations Programmatically -You can programmatically add a new annotation to the PDF document by creating an annotation instance and providing it as a parameter to the [addAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/addAnnotation.html) method of the `PdfViewerController` class. The following example shows how to create an instance of a highlight annotation and add it to the PDF document. Similarly, you can create and add other types of annotation. +You can programmatically add a new annotation to the PDF document by creating an annotation instance and providing it as a parameter to the [addAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/addAnnotation.html) method of the `PdfViewerController` class. The following example shows how to create an instance of a highlight annotation and add it to the PDF document. Similarly, you can create and add other types of annotations. {% tabs %} {% highlight dart hl_lines="11" %} @@ -90,7 +90,7 @@ void removeFirstAnnotation() { ### Remove All Annotations -You can programmatically remove all the annotations from a document by calling the [removeAllAnnotations](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/removeAllAnnotations.html) method. The optional `pageNumber` parameter can be used to clear the form field data on a specific page. By default, the pageNumber parameter is 0. Refer to the following code example. +You can programmatically remove all the annotations from a document by calling the [removeAllAnnotations](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/removeAllAnnotations.html) method. The optional `pageNumber` parameter can be used to clear the annotations on a specific page. By default, the `pageNumber` parameter is 0, which removes annotations from all pages of the PDF document. Refer to the following code example. {% tabs %} {% highlight dart hl_lines="3 8" %} @@ -138,7 +138,7 @@ This section will go through different methods of editing annotations in a PDF d ### Edit a Specific Annotation -You can edit the properties of an annotation from the document programmatically by accessing the specific annotation instance from the Annotation collection. The following example shows how to edit the first annotation in the annotation collection. Similarly, you can modify the other properties also. +You can edit the properties of an annotation from the document programmatically by accessing the specific annotation instance from the Annotation collection. The following example shows how to edit the first annotation in the annotation collection. Similarly, you can also modify the other properties. {% tabs %} {% highlight dart hl_lines="9 10" %} @@ -182,4 +182,4 @@ Widget build(BuildContext context) { } {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/annotation-collection.md b/Document-Processing/PDF/PDF-Viewer/flutter/annotation-collection.md index 9b2bfb1844..e9b6fa76fb 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/annotation-collection.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/annotation-collection.md @@ -9,7 +9,7 @@ documentation: ug # Annotation Collection in Flutter PDF Viewer widget (SfPdfViewer) -The annotations in the PDF document can be accessed by the [getAnnotations](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/getAnnotations.html) method of the [PdfViewerController](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController-class.html). The return value of the function will have the Annotation collection as soon as the document is loaded in the PDF viewer. The following code example shows how the annotation collection can be accessed. +The annotations in the PDF document can be accessed by the [getAnnotations](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/getAnnotations.html) method of the [PdfViewerController](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController-class.html). The method returns the annotation collection as soon as the document is loaded in the PDF viewer. The following code example shows how the annotation collection can be accessed. {% tabs %} {% highlight dart hl_lines="9 10" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/annotations-overview.md b/Document-Processing/PDF/PDF-Viewer/flutter/annotations-overview.md index 369ee03b9a..c6c8cd37a5 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/annotations-overview.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/annotations-overview.md @@ -9,7 +9,7 @@ documentation: ug # Annotations in Flutter PDF Viewer (SfPdfViewer) -The `SfPdfViewer` allows you to add, remove, and modify annotations in PDF documents. This section will go through the various types and functionalities available in the PDF Viewer for working with annotations. +The `SfPdfViewer` allows you to add, remove, and modify annotations in PDF documents. This section covers the various types and features available in the PDF Viewer for working with annotations. ## Supported Annotation Types diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/bookmark-navigation.md b/Document-Processing/PDF/PDF-Viewer/flutter/bookmark-navigation.md index a2c5634e8f..a089326ee5 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/bookmark-navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/bookmark-navigation.md @@ -13,13 +13,13 @@ Navigate to the desired bookmark topics using the default bookmark view or the c ## Open and Close the Built-in Bookmark View Programmatically -The built-in bookmark view in the `SfPdfViewer` can be opened using the [openBookmarkView](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewerState/openBookmarkView.html) method, and it can be closed either by tapping the close icon or the device's back button. Also, we can close the bookmark programmatically by using the Navigator’s pop method. +The built-in bookmark view in the `SfPdfViewer` can be opened using the [openBookmarkView](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewerState/openBookmarkView.html) method, and it can be closed either by tapping the close icon or the device's back button. Also, we can close the bookmark view programmatically by using the Navigator’s pop method. * You can use the [isBookmarkViewOpen](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewerState/isBookmarkViewOpen.html) property of the `SfPdfViewerState` class to know whether the built-in bookmark view is open or not. ![Bookmark view](images/bookmark-navigation/bookmark_view.png) -The following code example explains the opening of the built-in bookmark view programmatically. +The following code example shows how to open the built-in bookmark view programmatically. {% tabs %} {% highlight dart hl_lines="1 15" %} @@ -65,7 +65,7 @@ Widget build(BuildContext context) { ## Navigate to the Desired Bookmark Topic Programmatically -You can navigate to the desired bookmark topic programmatically using the [jumpToBookmark](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToBookmark.html) controller method. The following code example explains the same. +You can navigate to the desired bookmark topic programmatically using the [jumpToBookmark](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToBookmark.html) controller method. The following code example explains this functionality. N> Import **'package:syncfusion_flutter_pdf/pdf.dart'** in the Dart code if you use the [PdfBookmark](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmark-class.html) parameter. diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/document-link-annotation.md b/Document-Processing/PDF/PDF-Viewer/flutter/document-link-annotation.md index bd13cd22b6..6f4d3e523c 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/document-link-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/document-link-annotation.md @@ -9,11 +9,11 @@ documentation: ug # Document Link Annotation in Flutter PDF Viewer (SfPdfViewer) -By default, the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) allows you to navigate to the desired topic or position by tapping its document link annotation in the table of contents in a PDF document. +By default, the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) allows you to navigate to a specific topic or position within a PDF document by tapping a document link annotation. ## Enable or Disable the Document Link Annotation Navigation -You can enable or disable the navigation of document link annotations using the [enableDocumentLinkAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableDocumentLinkAnnotation.html) property. The following code example explains the same. +You can enable or disable the navigation of document link annotations using the [enableDocumentLinkAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableDocumentLinkAnnotation.html) property. The default value of this property is `true`. The following code example explains how to disable the document link annotation navigation. {% tabs %} {% highlight dart hl_lines="6" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/document-load-callbacks.md b/Document-Processing/PDF/PDF-Viewer/flutter/document-load-callbacks.md index 261d4a1b2f..c213a74c33 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/document-load-callbacks.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/document-load-callbacks.md @@ -1,7 +1,7 @@ --- layout: post title: Document Load Callbacks in Flutter PDF Viewer widget | Syncfusion -description: Learn here all about the document load callbacks in Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget +description: Learn all about the document load callbacks in Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget platform: document-processing control: SfPdfViewer documentation: ug @@ -78,4 +78,4 @@ Widget build(BuildContext context) { } {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/form-filling.md b/Document-Processing/PDF/PDF-Viewer/flutter/form-filling.md index 3a8f806d60..bfc4a4de47 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/form-filling.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/form-filling.md @@ -280,7 +280,7 @@ Widget build(BuildContext context) { ## Customize the visibility of built-in Signature pad -By default, the `SfPdfViewer` displays the signature pad when tapped on the signature form field. You can customize its visibility using the [canShowSignaturePad](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowSignaturePadDialog.html) property. The following code example explains this. +By default, the `SfPdfViewer` displays the signature pad when tapped on the signature form field. You can customize its visibility using the [canShowSignaturePadDialog](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowSignaturePadDialog.html) property. The following code example explains this. {% tabs %} {% highlight dart hl_lines="9" %} @@ -579,7 +579,7 @@ Widget build(BuildContext context) { {% endhighlight %} {% endtabs %} -## Importing and Exporting form data +## Importing and Exporting form data The Flutter PDF viewer allows users to import and export form data to and from PDF documents. The import and export of form data support the following extensions: @@ -590,7 +590,7 @@ The Flutter PDF viewer allows users to import and export form data to and from P The required file type can be chosen from the [DataFormat](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/DataFormat.html) enumeration. In the following sections, only the `xfdf` file type is explained for brevity. -N> Import ‘package:syncfusion_flutter_pdf/pdf.dart’ in the Dart code to use the [DartFormat](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/DataFormat.html) parameter. +N> Import ‘package:syncfusion_flutter_pdf/pdf.dart’ in the Dart code to use the [DataFormat](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/DataFormat.html) parameter. ### Exporting form data @@ -745,7 +745,7 @@ N> This `undoController` is common for annotations and form fields. You do not n ## Callbacks -The `SfPdfViewer` supports the [PdfFormFieldFocusChangeCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldFocusChangeCallback.html) to notify the interaction with the form fields and the [PdfFormFieldValueChangedCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldValueChangedCallback.html) to notify the values changes in the form fields. +The `SfPdfViewer` supports the [PdfFormFieldFocusChangeCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldFocusChangeCallback.html) to notify the interaction with the form fields and the [PdfFormFieldValueChangedCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldValueChangedCallback.html) to notify the value changes in the form fields. ### Form field focus change callback @@ -776,7 +776,7 @@ N> The `PdfFormFieldFocusChangeCallback` only triggers for text boxes and signat ### Form field value changed callback -The [onFormFieldValueChanged](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onFormFieldValueChanged.html) callback triggers when the value is changed in the form field. The [PdfFormFieldValueChangedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldValueChangedDetails-class.html) the `formField` instance along with its `oldValue` and `newValue`. The following code example explains this. +The [onFormFieldValueChanged](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onFormFieldValueChanged.html) callback triggers when the value is changed in the form field. The [PdfFormFieldValueChangedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldValueChangedDetails-class.html) returns the `formField` instance along with its `oldValue` and `newValue`. The following code example explains this. {% tabs %} {% highlight dart hl_lines="9 10 11 12" %} @@ -1038,7 +1038,7 @@ Future _validateAndSaveForm() async { if (formField.text == null || formField.text.isEmpty) { errors.add('Name is required.'); } else if (formField.text.length < 3) { - errors.add('Name should have atleast 3 characters.'); + errors.add('Name should have at least 3 characters.'); } else if (formField.text.length > 30) { errors.add('Name should not exceed 30 characters.'); } else if (formField.text.contains(RegExp(r'[0-9]'))) { @@ -1065,7 +1065,7 @@ Future _validateAndSaveForm() async { } else if (formField is PdfListBoxFormField) { if (formField.selectedItems == null || formField.selectedItems!.isEmpty) { - errors.add('Please select atleast one course.'); + errors.add('Please select at least one course.'); } } else if (formField is PdfSignatureFormField) { if (formField.signature == null) { diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/gesture-callbacks.md b/Document-Processing/PDF/PDF-Viewer/flutter/gesture-callbacks.md index a16e4c344a..beec90f11c 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/gesture-callbacks.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/gesture-callbacks.md @@ -9,7 +9,7 @@ documentation: ug # Gesture Callbacks in Flutter PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) supports the [PdfGestureCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureTapCallback.html) to notify the touch or mouse interaction with the widget. +The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) supports the [PdfGestureTapCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureTapCallback.html) to notify the touch or mouse interaction with the widget. ## Tap Callback @@ -17,14 +17,14 @@ The [onTap](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pd * [pageNumber](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureDetails/pageNumber.html) – This property returns the page number on which the tap took place. The value ranges from 1 to the total number of pages in the PDF document. If the tap occurs outside any PDF page boundaries, the result will be -1. -* [pagePosition](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureDetails/pagePosition.html) – This property returns the page’s tapped position in PDF coordinates. The coordinates have their origin at the top-left of the page. The number of the tapped page is identified by the PageNumber property. If the tap occurs outside any PDF page boundaries, the result will be (-1, -1). +* [pagePosition](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureDetails/pagePosition.html) – This property returns the tapped position on the page in PDF coordinates. The coordinates have their origin at the top-left of the page. The tapped page is identified by the pageNumber property. If the tap occurs outside any PDF page boundaries, the result will be (-1, -1). * [position](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureDetails/position.html) – This property returns the tapped position on the PDF Viewer widget. The coordinate space starts at the top left of the widget. The following code example illustrates how to retrieve information from the `PdfGestureDetails` and handle the `onTap` callback. {% tabs %} -{% highlight dart hl_lines="9 10 11" %} +{% highlight dart hl_lines="12 13 14" %} @override Widget build(BuildContext context) { @@ -42,4 +42,4 @@ Widget build(BuildContext context) { } {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md b/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md index cf724eda23..67fd8d51d1 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md @@ -18,7 +18,7 @@ To get started quickly, you can also check out our video tutorial below. Create a simple project using the instructions given in the [Getting Started with your first Flutter app](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation. ## Install the Flutter PDF Viewer package -Install the [Syncfusion® Flutter PDF Viewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer/versions) package to your project by running the following command in your project’s terminal: +Install the [Syncfusion® Flutter PDF Viewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer/versions) package to your project by running the following command in your project's terminal: {% tabs %} {% highlight tabtitle="powershell" %} @@ -29,14 +29,14 @@ flutter pub add syncfusion_flutter_pdfviewer {% endtabs %} ## Specify Asset Path -Create an assets folder in the project root, add a sample PDF file (for example, flutter-succinctly.pdf) to it, and specify the asset path in `pubspec.yaml` file under the flutter section. +Create an assets folder in the project root, add a sample PDF file (for example, flutter-succinctly.pdf) to it, and specify the asset path in the `pubspec.yaml` file under the flutter section. {% tabs %} {% highlight yaml tabtitle="pubspec.yaml" %} flutter: assets: -   - assets/ + - assets/ {% endhighlight %} {% endtabs %} @@ -72,7 +72,7 @@ For PdfJs library versions below 4.0: N> A version above **2.11.338** is recommended for using annotation support. Unsupported annotations are preserved rather than flattened during rendering. -## Import Package +## Import the Package In the `main.dart` file, import the required package. @@ -100,7 +100,7 @@ Widget build(BuildContext context) { {% endhighlight %} {% endtabs %} -N> You can refer to our [Flutter PDF Viewer](https://www.syncfusion.com/flutter-widgets/flutter-pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [Flutter PDF Viewer example](https://flutter.syncfusion.com/#/pdf-viewer/getting-started), which shows you how to render and configure the PDF Viewer. +N> You can refer to our [Flutter PDF Viewer](https://www.syncfusion.com/flutter-widgets/flutter-pdf-viewer) feature tour page for its groundbreaking features. You can also explore our [Flutter PDF Viewer example](https://flutter.syncfusion.com/#/pdf-viewer/getting-started), which shows you how to render and configure the PDF Viewer. ## See Also - [Open Document](./open-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/hyperlink-navigation.md b/Document-Processing/PDF/PDF-Viewer/flutter/hyperlink-navigation.md index 4cea43a406..86dd7fffc4 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/hyperlink-navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/hyperlink-navigation.md @@ -9,13 +9,13 @@ documentation: ug # Hyperlink Navigation in Flutter PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) allows you to open URLs or website links in the default browser. You can hide the built-in hyperlink navigation dialog or add a customized one with supported functionalities. +The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) allows you to open URLs or website links in the default browser. You can hide the built-in hyperlink navigation dialog or add a customized one using the available callbacks with supported functionalities. ![Hyperlink navigation dialog](images/hyperlink-navigation/hyperlink_navigation_dialog.jpg) ## Enable or Disable the Hyperlink Navigation -You can enable or disable the hyperlink navigation using the [enableHyperlinkNavigation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableHyperlinkNavigation.html) property. The following code example explains the same. +You can enable or disable the hyperlink navigation using the [enableHyperlinkNavigation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableHyperlinkNavigation.html) property. By default, the hyperlink navigation is enabled. The following code example explains how to disable it. {% tabs %} {% highlight dart hl_lines="9" %} @@ -38,7 +38,7 @@ You can enable or disable the hyperlink navigation using the [enableHyperlinkNav ## Customize the Visibility of the Hyperlink Navigation Dialog -By default, the built-in hyperlink navigation dialog will be displayed when any hyperlink is clicked. You can customize the visibility of the hyperlink navigation dialog using the [canShowHyperlinkDialog](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowHyperlinkDialog.html) property. The following code example explains the same. +By default, the built-in hyperlink navigation dialog will be displayed when any hyperlink is clicked. You can customize the visibility of the hyperlink navigation dialog using the [canShowHyperlinkDialog](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowHyperlinkDialog.html) property. The following code example explains how to hide the built-in dialog. {% tabs %} {% highlight dart hl_lines="9" %} @@ -61,11 +61,11 @@ By default, the built-in hyperlink navigation dialog will be displayed when any ## Callbacks -The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) hyperlink navigation supports the [PdfHyperlinkClickedCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedCallback.html) to notify when any hyperlink is clicked. +The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) hyperlink navigation supports the [PdfHyperlinkClickedCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedCallback.html) to notify when any hyperlink is clicked. This callback can also be used to implement a custom hyperlink dialog or to override the default navigation behavior. ### Hyperlink Clicked Callback -The [onHyperlinkClicked](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onHyperlinkClicked.html) callback triggers when any hyperlink in the PDF document is clicked. The [PdfHyperlinkClickedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedDetails-class.html) will return the [uri](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedDetails/uri.html) clicked in the PDF document. The following code example explains the same. +The [onHyperlinkClicked](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onHyperlinkClicked.html) callback triggers when any hyperlink in the PDF document is clicked. The [PdfHyperlinkClickedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedDetails-class.html) provides the [uri](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedDetails/uri.html) of the clicked hyperlink in the PDF document. Returning `false` from the callback prevents the default hyperlink navigation dialog from being displayed, allowing you to implement custom hyperlink handling. The following code example explains the same. {% tabs %} {% highlight dart hl_lines="9 10 11" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/localization.md b/Document-Processing/PDF/PDF-Viewer/flutter/localization.md index 9e2b059812..56ab1e31f5 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/localization.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/localization.md @@ -9,20 +9,20 @@ documentation: ug # Localization in Flutter PDF Viewer (SfPdfViewer) -By default, the `SfPdfViewer` widget supports US English localization. You can change the other languages by specifying the `MaterialApp` properties and adding the `flutter_localizations` and `syncfusion_localizations` packages to your application. +By default, the `SfPdfViewer` widget supports US English localization. You can change to other languages by specifying the `MaterialApp` properties and adding the `flutter_localizations` and `syncfusion_localizations` packages to your application. To use `flutter_localizations` and `syncfusion_localizations`, add the packages as a dependency to the `pubspec.yaml` file. {% highlight dart %} dependencies: -flutter_localizations: - sdk: flutter -syncfusion_localizations: ^XX.X.XX + flutter_localizations: + sdk: flutter + syncfusion_localizations: ^XX.X.XX {% endhighlight %} -Next, import the `flutter_localizations` and `syncfusion_localizations` library and specify the `localizationsDelegates` and `supportedLocales` for `MaterialApp` to localize the contents in the `SfPdfViewer` (page navigation dialog and bookmark view). +Next, import the `flutter_localizations` and `syncfusion_localizations` libraries and specify the `localizationsDelegates` and `supportedLocales` for `MaterialApp` to localize the contents in the `SfPdfViewer` (page navigation dialog and bookmark view). {% tabs %} {% highlight dart hl_lines="1 2 7 8 9 10 11 12 13 14 15 16 17" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/lock-unlock-annotations.md b/Document-Processing/PDF/PDF-Viewer/flutter/lock-unlock-annotations.md index a9a2222003..6832e68e20 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/lock-unlock-annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/lock-unlock-annotations.md @@ -1,7 +1,7 @@ --- layout: post title: Locking and Unlocking Annotations in Flutter PDF Viewer | Syncfusion -description: Learn here all about locking and unlocking annotations in PDF documents using the Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget and more. +description: Learn here all about locking and unlocking annotations in PDF documents using the Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget. platform: document-processing control: SfPdfViewer documentation: ug @@ -86,4 +86,4 @@ void lockSelectedAnnotation(Annotation selectedAnnotation) { {% endhighlight %} {% endtabs %} -* Similarly, to unlock the selected annotation, set the `isLocked` property value to false. +* Similarly, to unlock the selected annotation, set the `isLocked` property value to false. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/magnification.md b/Document-Processing/PDF/PDF-Viewer/flutter/magnification.md index 00c4fdda39..251ec801a0 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/magnification.md @@ -107,7 +107,7 @@ The [onZoomLevelChanged](https://pub.dev/documentation/syncfusion_flutter_pdfvie • When the double-tap zoom is performed. • When the `zoomLevel` property is changed. -The [PdfZoomDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfZoomDetails-class.html) will return the `oldZoomLevel` title and `newZoomLevel` values. The following code example explains the same. +The [PdfZoomDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfZoomDetails-class.html) will return the `oldZoomLevel` and `newZoomLevel` values. The following code example explains the same. {% tabs %} {% highlight dart hl_lines="6 7 8" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-base64.md b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-base64.md index d28615e390..763aa3a30b 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-base64.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-base64.md @@ -34,6 +34,10 @@ class MainApp extends StatelessWidget { @override Widget build(BuildContext context) { + // Base64 string of the PDF document. + // Replace with the actual base64 string of your PDF. + const String base64 = 'YOUR_BASE64_STRING_HERE'; + // Pass the base64 string of the PDF document to the SyncfusionPDFViewer widget. return const SyncfusionPDFViewer(base64: base64); } @@ -66,7 +70,7 @@ class _SyncfusionPDFViewerState extends State { ## Using Custom PDFSource -To load a document from a base64 string, you can convert the base64 string to a [Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html) using the [base64Decode](https://api.flutter.dev/flutter/dart-convert/base64Decode.html) method and pass it to the [SfPdfViewer.memory](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.memory.html) constructor. The following code example explains the same. +To load a document from a base64 string, you can convert the base64 string to a [Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html) using the [base64Decode](https://api.flutter.dev/flutter/dart-convert/base64Decode.html) method and pass it to the SfPdfViewer constructor through a custom PDFSource implementation. The following code example explains the same. * Import the `dart:convert` package to use the [base64Decode](https://api.flutter.dev/flutter/dart-convert/base64Decode.html) method. @@ -90,6 +94,10 @@ class MainApp extends StatelessWidget { @override Widget build(BuildContext context) { + // Base64 string of the PDF document. + // Replace with the actual base64 string of your PDF. + const String _base64 = 'YOUR_BASE64_STRING_HERE'; + // Pass the base64 string of the PDF document to the SyncfusionPDFViewer widget. return const SyncfusionPDFViewer(base64: _base64); } @@ -117,7 +125,7 @@ class _SyncfusionPDFViewerState extends State { } /// Custom PDFSource implementation for loading PDF from base64 encoded string. -class Base64PDFSource extends PDFSource { +class Base64PDFSource extends PdfSource { /// Creates a new instance of Base64PDFSource with the provided base64 string. Base64PDFSource(this._base64); diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-local-storage.md b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-local-storage.md index c9ea963ca3..535a30bb4d 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-local-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-local-storage.md @@ -9,7 +9,7 @@ documentation: ug # Open a PDF From Local Storage in Flutter PDF Viewer (SfPdfViewer) -The [SfPdfViewer.file](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.file.html) creates a widget that displays the PDF document obtained from a [`File`](https://api.flutter.dev/flutter/dart-io/File-class.html). The following code example explains the same. +The [SfPdfViewer.file](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.file.html) creates a widget that displays the PDF document obtained from a [`File`](https://api.flutter.dev/flutter/dart-io/File-class.html). The following code example demonstrates this. {% tabs %} {% highlight dart hl_lines="4 5" %} @@ -24,6 +24,6 @@ Widget build(BuildContext context) { {% endhighlight %} {% endtabs %} -N> On Android, this may require the `android.permission.READ_EXTERNAL_STORAGE`. +N> On Android, add the `android.permission.READ_EXTERNAL_STORAGE` permission in the `AndroidManifest.xml` file. N> Since the file system is not accessible from the browser, [SfPdfViewer.file](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.file.html) is not supported on Flutter Web. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-memory.md b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-memory.md index feea399074..3f1e99613e 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-memory.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-memory.md @@ -9,7 +9,7 @@ documentation: ug # Open a Document From Memory in Flutter PDF Viewer (SfPdfViewer) -The [SfPdfViewer.memory](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.memory.html) creates a widget that displays the PDF document obtained from the [Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html). The following code example explains the same. +The [SfPdfViewer.memory](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.memory.html) creates a widget that displays the PDF document obtained from the [Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html). The following code example demonstrates this. {% tabs %} {% highlight dart hl_lines="4 5" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document.md b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document.md index 76e5dfe528..4e7225e6d9 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document.md @@ -41,7 +41,7 @@ Widget build(BuildContext context) { N> It is recommended not to use both the [initialScrollOffset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialScrollOffset.html) and [initialPageNumber](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialPageNumber.html) properties at the same time. If both properties are defined, the [initialPageNumber](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialPageNumber.html) will be prioritized over the [initialScrollOffset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialScrollOffset.html). -## Load Document with the Specified Scroll Offset Position or Zoom Level +## Load the Document with the Specified Scroll Offset Position or Zoom Level The `SfPdfViewer` allows you to load the document with the specified scroll offset position or zoom level using the [initialScrollOffset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialScrollOffset.html) and [initialZoomLevel](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialZoomLevel.html) properties. The following code example explains the same. diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/overview.md b/Document-Processing/PDF/PDF-Viewer/flutter/overview.md index 7f1756dd47..368a86c4aa 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/overview.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/overview.md @@ -1,7 +1,7 @@ --- layout: post title: About Flutter PDF Viewer widget | Syncfusion -description: Learn here all about introduction of Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget, its features, and more. +description: Learn all about the Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget, its features, and more. platform: document-processing control: SfPdfViewer documentation: ug @@ -29,4 +29,4 @@ The Syncfusion® [Flutter PDF Viewer](https://www.syncfusion.com/f * [Accessibility](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/flutter/accessibility) * [Right to Left (RTL)](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/flutter/right-to-left) -N> You can also explore our [Flutter PDF Viewer example](https://flutter.syncfusion.com/#/pdf-viewer/getting-started) that shows you how to render and configure the PDF Viewer. +N> You can also explore our [Flutter PDF Viewer example](https://flutter.syncfusion.com/#/pdf-viewer/getting-started) that shows you how to render and configure the PDF Viewer. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/page-layout-and-scroll-direction.md b/Document-Processing/PDF/PDF-Viewer/flutter/page-layout-and-scroll-direction.md index cb57045668..e30b6e3f5d 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/page-layout-and-scroll-direction.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/page-layout-and-scroll-direction.md @@ -20,7 +20,7 @@ The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/lat ### Continuous Page Layout Mode -By default, the `continuous` page layout mode is enabled, which scrolls the PDF pages vertically and horizontally. To enable the `continuous` page layout mode in `SfPdfViewer`, use the following code sample. +By default, the `continuous` page layout mode is enabled, which displays all the PDF pages in a continuous flow. The scroll direction can be configured using the `scrollDirection` property. To set the page layout mode to `continuous` in `SfPdfViewer`, use the following code sample. {% tabs %} {% highlight dart hl_lines="6" %} @@ -38,7 +38,7 @@ Widget build(BuildContext context) { ### Single Page Layout Mode -In `Single` page layout mode, PDFs will be displayed page by page horizontally. To enable the `Single` page layout mode in `SfPdfViewer`, use the following code sample. +In `Single` page layout mode, the PDF pages are displayed one at a time, with horizontal scrolling by default. To set the page layout mode to `Single` in `SfPdfViewer`, use the following code sample. {% tabs %} {% highlight dart hl_lines="6" %} @@ -67,7 +67,7 @@ If the scroll direction is not specified, continuous page layout mode defaults t ### Vertical Scrolling -By default, `Vertical` scrolling is enabled, which moves the PDF pages from up to down. To enable the `Vertical` scrolling in `SfPdfViewer`, use the following code sample. +By default, `Vertical` scrolling is enabled, which scrolls the PDF pages from top to bottom. To set the scroll direction to `Vertical` in `SfPdfViewer`, use the following code sample. {% tabs %} {% highlight dart hl_lines="6" %} @@ -85,7 +85,7 @@ Widget build(BuildContext context) { ### Horizontal Scrolling -In `Horizontal` scrolling, PDF pages can be scrolled from left to right. To enable the `Horizontal` scrolling in `SfPdfViewer`, use the following code sample. +In `Horizontal` scrolling, PDF pages are scrolled from left to right. To set the scroll direction to `Horizontal` in `SfPdfViewer`, use the following code sample. {% tabs %} {% highlight dart hl_lines="6" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/page-navigation.md b/Document-Processing/PDF/PDF-Viewer/flutter/page-navigation.md index d74fd5ae64..5a0759eda7 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/page-navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/page-navigation.md @@ -9,16 +9,16 @@ documentation: ug # Page Navigation in Flutter PDF Viewer (SfPdfViewer) -Navigate to the desired pages instantly either by using the page navigation dialog or the controller methods programmatically. If the desired page doesn’t exist, then the navigation will not happen, and the older page will be retained. +Navigate to the desired pages instantly either by using the page navigation dialog available in the built-in toolbar, or by using the controller methods programmatically. If the desired page doesn’t exist, then the navigation will not happen, and the current page will be retained. ![Page navigation dialog](images/page-navigation/page_navigation_dialog.png) ## Navigate to the Desired Page Programmatically -The [jumpToPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToPage.html) controller method helps you to navigate to the specified page number in a PDF document. The following code example explains the same. +The [jumpToPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToPage.html) controller method helps you to navigate to the specified page number in a PDF document. The page number is 1-based. The following code example explains the same. {% tabs %} -{% highlight dart hl_lines="21" %} +{% highlight dart hl_lines="22" %} late PdfViewerController _pdfViewerController; @@ -159,7 +159,7 @@ Widget build(BuildContext context) { ## Navigate to the Desired Offset Programmatically -The [jumpTo](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpTo.html) controller method moves the scroll position of the `SfPdfViewer` to the specified horizontal and vertical offset. If the specified offset value is wrong, then the scroll will not happen, and the older position will be retained. +The [jumpTo](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpTo.html) controller method moves the scroll position of the `SfPdfViewer` to the specified horizontal and vertical offset. Both `xOffset` and `yOffset` accept `double` values in logical pixels. If the specified offset value is wrong, then the scroll will not happen, and the current position will be retained. N> Both the `xOffset` and `yOffset` are optional parameters and if the offset values are not provided, then the `SfPdfViewer` will be scrolled or moved to the default position (0, 0). @@ -217,7 +217,7 @@ The [onPageChanged](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/l The [PdfPageChangedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfPageChangedDetails-class.html) will return the `oldPageNumber`, `newPageNumber`, `isFirstPage`, and `isLastPage` values. The following code example explains the same. {% tabs %} -{% highlight dart hl_lines="6 7 8 9" %} +{% highlight dart hl_lines="6 7 8 9 10" %} @override Widget build(BuildContext context) { @@ -225,8 +225,10 @@ Widget build(BuildContext context) { body: SfPdfViewer.network( 'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf', onPageChanged: (PdfPageChangedDetails details) { + print(details.oldPageNumber); print(details.newPageNumber); print(details.isFirstPage); + print(details.isLastPage); }, )); } diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/right-to-left.md b/Document-Processing/PDF/PDF-Viewer/flutter/right-to-left.md index ccc2e7af16..55540fb09c 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/right-to-left.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/right-to-left.md @@ -17,7 +17,7 @@ Right-to-left rendering can be switched in the following ways: ### Wrapping the SfPdfViewer with Directionality Widget -To change the rendering direction from right to left, wrap the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) widget inside the [Directionality](https://api.flutter.dev/flutter/widgets/Directionality-class.html) widget and set the [textDirection](https://api.flutter.dev/flutter/widgets/Directionality/textDirection.html) property as [TextDirection.rtl](https://api.flutter.dev/flutter/widgets/Directionality/textDirection.html). +To change the rendering direction from right to left, wrap the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) widget inside the [Directionality](https://api.flutter.dev/flutter/widgets/Directionality-class.html) widget and set the [textDirection](https://api.flutter.dev/flutter/widgets/Directionality/textDirection.html) property as [TextDirection.rtl](https://api.flutter.dev/flutter/dart-ui/TextDirection.html). {% tabs %} {% highlight dart hl_lines="26 27 28 29 30 31 32" %} @@ -69,8 +69,8 @@ To use `flutter_localizations`, add the package as a dependency in the `pubspec. {% highlight dart %} dependencies: -flutter_localizations: - sdk: flutter + flutter_localizations: + sdk: flutter {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/select-deselect-annotations.md b/Document-Processing/PDF/PDF-Viewer/flutter/select-deselect-annotations.md index 5e8cdb0edc..fbee6d60df 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/select-deselect-annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/select-deselect-annotations.md @@ -63,14 +63,12 @@ Widget build(BuildContext context) { ### Customizing Selector Appearance -The `annotationSettings` property of `PdfViewerController` allows you to customize the default selector color. The following example explains how to customize the selector color for locked and unlocked annotations. +The `annotationSettings` property of `SfPdfViewer` allows you to customize the default selector color. The following example explains how to customize the selector color for locked and unlocked annotations. {% tabs %} {% highlight dart %} -void customizeSelectorAppearance() { - PdfAnnotationSettings annotationSettings = - _pdfViewerController.annotationSettings; +void customizeSelectorAppearance(PdfAnnotationSettings annotationSettings) { // For unlocked annotations. annotationSettings.selector.color = Colors.blue; // For locked annotations. @@ -102,7 +100,7 @@ void deselectAnnotation(Annotation selectedAnnotation) { ### Annotation Deselected Callback -The callback provided to the `onAnnotationDeselected` property is triggered when an annotation is deselected interactively or programmatically. The following code sample explains how to use this callback. +The callback provided to the [onAnnotationDeselected](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onAnnotationDeselected.html) property is triggered when an annotation is deselected interactively or programmatically. The following code sample explains how to use this callback. {% tabs %} {% highlight dart hl_lines="7 8 9 10" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/sticky-notes.md b/Document-Processing/PDF/PDF-Viewer/flutter/sticky-notes.md index 90ee5eaeba..7b362ad8a3 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/sticky-notes.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/sticky-notes.md @@ -9,7 +9,7 @@ documentation: ug # Sticky Note Annotations in Flutter PDF Viewer Widget (SfPdfViewer) -The sticky note annotation feature of `SfPdfViewer` allows you to add, remove, and modify sticky notes in a PDF document. This feature can help add comments or notes to specific parts of a document to clarify complex concepts, terms, or ideas. This section will cover the various functions available in `SfPdfViewer` for working with sticky note annotations. +The sticky note annotation feature of `SfPdfViewer` allows you to add and modify sticky notes in a PDF document. This feature can help add comments or notes to specific parts of a document to clarify complex concepts, terms, or ideas. This section will cover the various functions available in `SfPdfViewer` for working with sticky note annotations. ## Types of Sticky Notes @@ -103,7 +103,7 @@ void customizeDefaultStickyNoteSettings() { // Modify the default properties. stickyNoteSettings.icon = PdfStickyNoteIcon.comment; // Set the default icon to Comment. - stickyNoteSettings.color = Colors.yellow; // Stroke color + stickyNoteSettings.color = Colors.yellow; // Color of the sticky note. stickyNoteSettings.opacity = 0.75; // 75% Opacity } diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/text-markup.md b/Document-Processing/PDF/PDF-Viewer/flutter/text-markup.md index 9ab8ca9a6d..5e8835b12d 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/text-markup.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/text-markup.md @@ -27,7 +27,7 @@ This section will go through how to add text markup annotations to a PDF documen You can add text markup annotations to a PDF document by touching (or mouse down) and dragging using the [annotationMode](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/annotationMode.html) property of the PdfViewerController. The following steps explain how to add a text markup annotation on a text in a PDF: -1. Set the [annotationMode](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/annotationMode.html) property of the SfPdfViewer to any text markups (e.g., `highlight`). It activates the highlight annotation mode on the control. +1. Set the [annotationMode](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/annotationMode.html) property of the PdfViewerController to any text markups (e.g., `highlight`). It activates the highlight annotation mode on the control. 2. Place your finger (or mouse) on the text in the PDF document where you want to start adding the text markup. 3. Drag the finger (or cursor) across the text to select it. 4. Complete adding the text markup to the selected text by releasing the finger (or cursor). @@ -41,7 +41,7 @@ The following code explains how to enable the strikethrough annotation mode. Sim {% highlight dart %} void enableStrikethroughAnnotationMode() { - // Enable the strikeout annotation mode. + // Enable the strikethrough annotation mode. _pdfViewerController.annotationMode = PdfAnnotationMode.strikethrough; } diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/text-search.md b/Document-Processing/PDF/PDF-Viewer/flutter/text-search.md index 34a291158f..edc4b97bb0 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/text-search.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/text-search.md @@ -15,6 +15,8 @@ The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/lat The [searchText](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/searchText.html) controller method is used to initiate the text search and it takes the text to be searched and [TextSearchOption](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/TextSearchOption.html) as parameters. This method searches for the text, highlights all the instances of the text in the document, and returns the [PdfTextSearchResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) object holding the result values such as total instance count, current highlighted instance index, and more. The [PdfTextSearchResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) object will also help you navigate to the different searched text instances available and cancel the search operation. +You can use the [hasResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/hasResult.html) property to check whether the search has produced any matches and the [isSearchCompleted](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/isSearchCompleted.html) property to know whether the search operation has finished on all the pages. + On mobile and desktop platforms, the search will be performed asynchronously, so the results will be returned periodically on a page-by-page basis, which can be retrieved using the `PdfTextSearchResult.addListener` method in the application. Whereas on the web platform, the search will be performed synchronously, so the result will be returned only after completing the search on all the pages. This is because `isolate` is not supported for the web platform yet. @@ -23,9 +25,16 @@ To differentiate the highlighted texts, the current text instance highlight colo N> Import **'package:syncfusion_flutter_pdf/pdf.dart'** in the Dart code if you use the [TextSearchOption](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/TextSearchOption.html) parameter. +The `TextSearchOption` enum supports the following values: `caseSensitive` to perform a case-sensitive search and `none` to perform a case-insensitive search. + {% tabs %} {% highlight dart hl_lines="23 24 25 26 27 28 29 30 31 32 33 34 35 36" %} +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; +import 'package:syncfusion_flutter_pdf/pdf.dart'; + late PdfViewerController _pdfViewerController; late PdfTextSearchResult _searchResult; @@ -218,7 +227,7 @@ Widget build(BuildContext context) { ## Customize the Search Text Highlight Color -The colors in which the current instance and other instances are highlighted can be customized with the help of [currentSearchTextHighlightColor](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/currentSearchTextHighlightColor.html) and [otherSearchTextHighlightColor](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/otherSearchTextHighlightColor.html) property. The default highlight color is **Orange** [Color(0xFFE56E00)] and the current instance highlight color opacity (with respect to this property) will be higher than the other instances. By default, the current instance highlight color opacity will be 60% and the other instances color opacity will be 30%. +The colors in which the current instance and other instances are highlighted can be customized with the help of [currentSearchTextHighlightColor](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/currentSearchTextHighlightColor.html) and [otherSearchTextHighlightColor](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/otherSearchTextHighlightColor.html) properties. The default highlight color is **Orange** [Color(0xFFE56E00)] and the current instance highlight color opacity (with respect to this property) will be higher than the other instances. By default, the current instance highlight color opacity will be 60% and the other instances' color opacity will be 30%. The following code example explains how to customize the search text highlight color. @@ -273,7 +282,7 @@ Widget build(BuildContext context) { {% endhighlight %} {% endtabs %} -## How to Identify if There is No Instance Found for the Text Being Searched? +## How to Identify if No Instance is Found for the Searched Text? The [totalInstanceCount](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/totalInstanceCount.html) property in the [PdfTextSearchResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) object can be used to identify if no instance of the searched text is found in the PDF document. That is, if [totalInstanceCount](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/totalInstanceCount.html) returns value 0, then there is no matching instance found for the searched text. The following code explains the same. diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/text-selection.md b/Document-Processing/PDF/PDF-Viewer/flutter/text-selection.md index ffcffc8b67..d6a6bfca4e 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/text-selection.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/text-selection.md @@ -13,7 +13,7 @@ On a touch device, the [SfPdfViewer](https://pub.dev/documentation/syncfusion_fl On a desktop web browser, text selection can also be performed using mouse dragging with the [`selection`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfInteractionMode.html) interaction mode enabled. -N> Images in the document will not be selected, and multiple-page text selection is not supported for now. +N> Images in the document will not be selected, and multiple-page text selection is not supported currently. ## Enable or Disable Text Selection @@ -74,7 +74,7 @@ class _HomePageState extends State { {% endhighlight %} {% endtabs %} -## Customize the visibility of the text selection context menu +## Customize the Visibility of the Text Selection Context Menu The `canShowTextSelectionMenu` property allows the user to customize the visibility of the built-in text selection context menu. You can assign `false` to this property to disable the text selection context menu. The following code example explains how to disable the built-in text selection context menu in the PDF viewer. @@ -86,7 +86,7 @@ Widget build(BuildContext context) { return Scaffold( body: Container( child: SfPdfViewer.network( - 'https://cdn.syncfusion.com/content/PDFViewer/encrypted.pdf', + 'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf', canShowTextSelectionMenu: false, ), ), diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/ui-customization.md b/Document-Processing/PDF/PDF-Viewer/flutter/ui-customization.md index 51b709f2a0..b328426059 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/ui-customization.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/ui-customization.md @@ -11,9 +11,21 @@ documentation: ug This section walks you through the UI customization options supported in the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) widget. +## Prerequisites + +To use the `SfPdfViewer` widget, add the [`syncfusion_flutter_pdfviewer`](https://pub.dev/packages/syncfusion_flutter_pdfviewer) package to your `pubspec.yaml` file and import it in your code: + +{% tabs %} +{% highlight dart %} + +import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; + +{% endhighlight %} +{% endtabs %} + ## Customize the Space Displayed Between the PDF Pages -By default, the `SfPdfViewer` displays spacing between the PDF pages with a value of **4 pixels**. You can customize the space being displayed using the [pageSpacing](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/pageSpacing.html) property. The following code example explains the same. +By default, the `SfPdfViewer` displays spacing between the PDF pages with a value of **4 pixels**. You can customize the space displayed using the [pageSpacing](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/pageSpacing.html) property. The following code example explains the same. {% tabs %} {% highlight dart hl_lines="6" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/undo-redo.md b/Document-Processing/PDF/PDF-Viewer/flutter/undo-redo.md index 4dd80da7a1..00093a0851 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/undo-redo.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/undo-redo.md @@ -11,7 +11,7 @@ documentation: ug If you performed any undesired actions when adding, removing, or editing annotations, you can undo and redo the action to restore the previous state. This section will go through how to undo and redo the changes made to the annotations. -For desktop platforms such as Windows, macOS, Linux, and desktop web, you can use the following shortcut keys to perform the actions. +For desktop platforms such as Windows, macOS, Linux, and Web, you can use the following shortcut keys to perform the actions.
ActionAction Windows Macintosh LinuxCONTROL + 0
Shortcut for Text SearchShortcuts for Text Search
Open the search toolbarCONTROL + F
Shortcut for Text SelectionShortcuts for Text Selection
Copy the selected text
diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/viewing-password-protected-pdf-files.md b/Document-Processing/PDF/PDF-Viewer/flutter/viewing-password-protected-pdf-files.md index 5e87a04620..7c5da17cc0 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/viewing-password-protected-pdf-files.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/viewing-password-protected-pdf-files.md @@ -1,7 +1,7 @@ --- layout: post title: Viewing password-protected PDFs in Flutter PDF Viewer | Syncfusion -description: Learn here all about loading password-protected PDF feature of Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget and more. +description: Learn here all about loading password-protected PDFs using the Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget and more. platform: document-processing control: SfPdfViewer documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Viewing Password-Protected PDFs in Flutter PDF Viewer (SfPdfViewer) -To load a password-protected document without a password or with an invalid password in [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html), use the [password](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/password.html) property. The default password dialog will be displayed. +To load a password-protected document, use the [password](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/password.html) property in [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html). When the password is not provided or is invalid, the default password dialog will be displayed. ![Password dialog](images/password-dialog/password-dialog.png) @@ -84,9 +84,8 @@ class _CustomPasswordDialogState extends State { }, onDocumentLoadFailed: (details) { if (details.description.contains('password')) { - if (details.description.contains('password') && - _hasPasswordDialog) { - _errorText = "Invalid password !!"; + if (_hasPasswordDialog) { + _errorText = "Invalid password!"; _formKey.currentState?.validate(); _textFieldController.clear(); _passwordDialogFocusNode.requestFocus(); @@ -264,4 +263,4 @@ class _CustomPasswordDialogState extends State { {% endhighlight %} {% endtabs %} -![Custom Password dialog](images/password-dialog/custompassword-dialog.png) +![Custom Password dialog](images/password-dialog/custompassword-dialog.png) \ No newline at end of file From 40f84c1f725a7c1be79a79851ab2891950ad37d1 Mon Sep 17 00:00:00 2001 From: AbinayaSF4962 Date: Fri, 10 Jul 2026 16:10:38 +0530 Subject: [PATCH 026/127] Updated the all md files for flutter pdf library control. --- .../PDF-Library/flutter/getting-started.md | 24 +++---- .../flutter/loading-and-saving-document.md | 19 +++--- .../PDF/PDF-Library/flutter/overview.md | 20 +++--- .../flutter/working-with-annotations.md | 28 ++++---- .../flutter/working-with-attachments.md | 4 +- .../flutter/working-with-bookmarks.md | 27 ++++---- .../flutter/working-with-digital-signature.md | 65 +++++++++++-------- .../flutter/working-with-document.md | 40 ++++++------ .../flutter/working-with-flow-layout.md | 10 +-- .../PDF-Library/flutter/working-with-forms.md | 28 ++++---- .../working-with-headers-and-footers.md | 20 +++--- .../flutter/working-with-hyperlinks.md | 6 +- .../flutter/working-with-images.md | 12 ++-- .../flutter/working-with-layers.md | 6 +- .../PDF-Library/flutter/working-with-lists.md | 6 +- .../PDF-Library/flutter/working-with-pages.md | 17 ++--- .../flutter/working-with-pdf-conformance.md | 8 +-- .../flutter/working-with-pdf-templates.md | 12 ++-- .../flutter/working-with-security.md | 26 ++++---- .../flutter/working-with-shapes.md | 4 +- .../flutter/working-with-tables.md | 14 ++-- .../flutter/working-with-text-extraction.md | 16 ++--- .../PDF-Library/flutter/working-with-text.md | 26 ++++---- .../flutter/working-with-watermarks.md | 6 +- 24 files changed, 227 insertions(+), 217 deletions(-) diff --git a/Document-Processing/PDF/PDF-Library/flutter/getting-started.md b/Document-Processing/PDF/PDF-Library/flutter/getting-started.md index dfe0965ead..4e97dfebc8 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/getting-started.md +++ b/Document-Processing/PDF/PDF-Library/flutter/getting-started.md @@ -16,7 +16,7 @@ Check the following video to quickly get started with creating a Flutter PDF doc ## Steps to create PDF document in Flutter application -Create a simple project using the instructions given in the [`Getting Started with your first Flutter app'](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation. +Create a simple project using the instructions given in the [`Getting Started with your first Flutter app`](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation. **Add dependency** @@ -38,9 +38,9 @@ N> Here **xx.x.xx** denotes the current version of [`Syncfusion Flutter PDF`](ht Run the following command to get the required packages. {% tabs %} -{% highlight dart tabtitle="dart" %} +{% highlight powershell tabtitle="POWERSHELL" %} -$ flutter pub get +flutter pub get {% endhighlight %} {% endtabs %} @@ -67,8 +67,8 @@ Widget build(BuildContext context) { return Scaffold( body: Center( child: TextButton( - onPressed: _createPDF, - child: Text('Create PDF') + onPressed: _createPDF, + child: Text('Create PDF'), ), ), ); @@ -113,7 +113,7 @@ You can save and open a PDF document in desktop by using the following steps: Configure and enable the desktop support to run the app. {% tabs %} -{% highlight dart tabtitle="dart" %} +{% highlight dart tabtitle="dart" %} flutter config --enable--desktop @@ -129,10 +129,10 @@ Here you can get more details about [`How to add desktop support in the app`](ht Add the following packages to your pub spec file. {% tabs %} -{% highlight dart tabtitle="dart" %} +{% highlight dart tabtitle="dart" %} -path_provider: ^1.6.5 -open_file: ^3.0.1 +path_provider: ^2.0.7 +open_file: ^3.2.1 {% endhighlight %} {% endtabs %} @@ -275,11 +275,11 @@ Add the following code in the header section of index.html file under the web fo ## Save and download a PDF document in WASM -step 1: Add the [web](https://pub.dev/packages/web) package as a dependency in your **pubspec.yaml** file. +**Step 1:** Add the [web](https://pub.dev/packages/web) package as a dependency in your **pubspec.yaml** file. -step 2: Create a new Dart file called **save_file_wasm.dart**. +**Step 2:** Create a new Dart file called **save_file_wasm.dart**. -step 3: Add the following code: +**Step 3:** Add the following code: **Import package** diff --git a/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md b/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md index 9e3680c4e1..174655811d 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md +++ b/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md @@ -1,13 +1,13 @@ --- layout: post -title: Open and save PDF file in Flutter PDF library | Syncfusion -description: Learn here all about Open and save PDF file feature of Syncfusion Flutter PDF non-UI library and more. +title: Open and save a PDF file in Flutter PDF library | Syncfusion +description: Learn here all about Open and save a PDF file feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug --- -# Open and save PDF file in Flutter PDF +# Open and save a PDF file in Flutter PDF ## Opening an existing PDF document @@ -15,7 +15,7 @@ You can open an existing PDF document by using the [`PdfDocument`](https://pub.d {% tabs %} {% highlight dart tabtitle="dart" %} - +import 'dart:io'; //Opens an existing document from the list of bytes PdfDocument document = PdfDocument(inputBytes: File('input.pdf').readAsBytesSync()); @@ -23,21 +23,20 @@ PdfDocument document = {% endhighlight %} {% endtabs %} -## Opening an existing PDF document from the base 64 string +## Opening an existing PDF document from the Base64 string -You can open an existing document from the base 64 string by using the [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class as shown below. +You can open an existing document from the Base64 string by using the [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class as shown below. {% tabs %} {% highlight dart tabtitle="dart" %} - -//Opens an existing document from the base 64 string +//Opens an existing document from the Base64 string PdfDocument document = PdfDocument.fromBase64String( 'JVBERi0xLjcNCiWDkvr+DQoxIDAgb2JqDQo8PA0KL1R5cGUgL0NhdGFsb2cNCi9QYWdlcyAyIDAgUg0KPj4NCmVuZG9iag0KMiAwIG9iag0KPDwNCi9UeXBlIC9QYWdlcw0KL0tpZHMgWzMgMCBSXQ0KL0NvdW50IDENCi9SZXNvdXJjZXMgPDw+Pg0KDQovTWVkaWFCb3ggWzAgMCA1OTUgODQyXQ0KPj4NCmVuZG9iag0KMyAwIG9iag0KPDwNCi9Db3VudCAxDQovVHlwZSAvUGFnZXMNCi9LaWRzIFs0IDAgUl0NCi9QYXJlbnQgMiAwIFINCj4+DQplbmRvYmoNCjQgMCBvYmoNCjw8DQovVHlwZSAvUGFnZQ0KL1BhcmVudCAzIDAgUg0KPj4NCmVuZG9iag0KeHJlZg0KMCA1DQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMTcgMDAwMDAgbg0KMDAwMDAwMDA3MiAwMDAwMCBuDQowMDAwMDAwMTgwIDAwMDAwIG4NCjAwMDAwMDAyNTkgMDAwMDAgbg0KdHJhaWxlcg0KPDwNCi9Sb290IDEgMCBSDQovU2l6ZSA1DQo+Pg0KDQpzdGFydHhyZWYNCjMxMg0KJSVFT0Y='); {% endhighlight %} {% endtabs %} -## Saving a PDF document to list of bytes +## Saving a PDF document to a list of bytes You can save the manipulated PDF document as a list of bytes using the [`save`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html) method of [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class. Also, you can save the list of bytes to the file system as follows. @@ -55,4 +54,4 @@ List bytes =await document.save(); File('output.pdf').writeAsBytes(bytes); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/overview.md b/Document-Processing/PDF/PDF-Library/flutter/overview.md index d3729928ab..0010675bb2 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/overview.md +++ b/Document-Processing/PDF/PDF-Library/flutter/overview.md @@ -9,21 +9,21 @@ documentation: ug # Flutter PDF Overview -The Syncfusion® Flutter PDF is a library written natively in Dart for creating the PDF documents from scratch. The library can be used in Flutter Mobile and Web platforms without the dependency of Adobe Acrobat. The creation of PDF follows the most popular PDF 1.7 (ISO 32000-1) and latest PDF 2.0 (ISO 32000-2) specifications. +The Syncfusion® Flutter PDF is a library written natively in Dart for creating PDF documents from scratch. It can be used in Flutter Mobile and Web platforms without requiring Adobe Acrobat. The creation of PDF follows the most popular PDF 1.7 (ISO 32000-1) and the latest PDF 2.0 (ISO 32000-2) specifications. Check the following video for a quick overview of Syncfusion Flutter UI Widgets and File Format Packages. {% youtube "https://youtu.be/FwUSJtv-3NY?si=doGR-fOkvghf-UUa" %} ## Key features of Syncfusion® Flutter PDF: -* Support to create PDF files from scratch. -* Support to add text and drawing shapes. -* Support to add ordered and unordered lists. -* Support to draw raster images like JPEG and PNG formats. -* Support to add hyperlink and document link annotations. -* Support to add tables. -* Support to add headers and footers in PDF document. -* Support to add bookmarks in PDF document. -* Support to protect PDF document by encryption. +* Creates PDF files from scratch. +* Adds text and draws shapes. +* Adds ordered and unordered lists. +* Draws raster images such as JPEG and PNG formats. +* Adds hyperlink and document link annotations. +* Adds tables. +* Adds headers and footers in PDF documents. +* Adds bookmarks in PDF documents. +* Protects PDF documents with encryption. You can get the sample from this link: [`Flutter PDF`](https://github.com/syncfusion/flutter-examples). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md index 357d7c47ca..ec2e1beae4 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md @@ -254,8 +254,8 @@ PdfPage page = document.pages.add(); //Creates a new document link annotation PdfDocumentLinkAnnotation documentLinkAnnotation = PdfDocumentLinkAnnotation(Rect.fromLTWH(10, 40, 30, 30), - setAppearance: true, - PdfDestination(document.pages.add(), Offset(10, 0))); + PdfDestination(document.pages.add(), Offset(10, 0)), + setAppearance: true); //Adds this annotation the page. page.annotations.add(documentLinkAnnotation); @@ -305,7 +305,7 @@ document.dispose(); This annotation is used to navigate to a particular web URI while clicking on the link text. -The following code example explains how to add the Text Web Link annotation in a PDF document using the PdfTextWebLinkAnnotation. +The following code example explains how to add the Text Web Link annotation in a PDF document using the PdfTextWebLink. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -415,7 +415,7 @@ Pop-up annotation displays text in a pop-up window for entry and editing. It typically does not appear alone but is associated with markup annotation, its parent annotation. -PdfPopupAnnotation is used to add pop-up annotation in a PDF document. +PdfPopupAnnotation is used to add a pop-up annotation in a PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -471,9 +471,9 @@ document.dispose(); ## Flatten annotation -Annotations can be flattened by removing the existing annotation and replacing it with the graphics objects that would resemble the annotation and it cannot be edited. +Annotations can be flattened by removing the existing annotation and replacing it with graphics objects that resemble the annotation, making it non-editable. -This can be achieved by enabling the flattenAllAnnotations method . Please refer to the sample for flattening all the annotations in the PDF document. +This can be achieved by calling the flattenAllAnnotations method. Please refer to the sample for flattening all the annotations in the PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -571,7 +571,7 @@ annotation.innerColor = PdfColor(0, 255, 0); annotation.text = 'Modified Annotation'; annotation.author = 'Syncfusion'; annotation.modifiedDate = DateTime.now(); -annotation.setAppearance: true; +annotation.setAppearance = true; //Saves the document File('output.pdf').writeAsBytes(await document.save()); @@ -652,7 +652,7 @@ If set, do not display the annotation on the screens or allow the user to intera +If set, do not allow the user to interact with the annotation.

+If set, invert the interpretation of the noView flag for certain events.

readOnly

-If set, do not allow the user to interact with annotation.

locked

@@ -660,7 +660,7 @@ If set, do not allow the annotation to be deleted or its properties to be modifi
toggleNoView

-If set, invert the interpretation of the noView flat for certain events.

@@ -793,11 +793,11 @@ To export annotation data to the FDF file from the PDF document, you can use the //Load an existing PDF document. PdfDocument document = PdfDocument(inputBytes: File('input.pdf').readAsBytesSync()); - //Export the annotations to FDF file format + //Export the annotations to FDF file format. List bytes = document.exportAnnotation(PdfAnnotationDataFormat.fdf); //Save the FDF file. File('export.fdf').writeAsBytesSync(bytes); - //Dispose the document + //Dispose the document. document.dispose(); {% endhighlight %} @@ -815,7 +815,7 @@ To export annotation data to the XFDF file from the PDF document, you can use th PdfDocument(inputBytes: File('input.pdf').readAsBytesSync()); //Export the annotations to XFDF file format. List bytes = document.exportAnnotation(PdfAnnotationDataFormat.xfdf); - //Save the FDF file. + //Save the XFDF file. File('export.xfdf').writeAsBytesSync(bytes); //Dispose the document. document.dispose(); @@ -835,10 +835,10 @@ To export annotation data to the JSON file from the PDF document, you can use th PdfDocument(inputBytes: File('input.pdf').readAsBytesSync()); //Export the annotations to JSON file format. List bytes = document.exportAnnotation(PdfAnnotationDataFormat.json); - //Save the FDF file. + //Save the JSON file. File('export.json').writeAsBytesSync(bytes); //Dispose the document. document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md index 6ca44eeb2f..8d4823d301 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md @@ -1,7 +1,7 @@ --- layout: post title: Attachments in Flutter PDF library | Syncfusion -description: Learn here all about add, remove, and load the properties of file Attachments feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn here all about add, remove, and extract the properties of file Attachments feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -111,7 +111,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Extracting and saving an attachment to the disc +## Extracting and saving an attachment to the disk The Syncfusion® Flutter PDF provides support for extracting the attachments and saving them to the disk. The following code example explains how to extract and save an attachment. diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md index e513b9d967..4cbff61e61 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md @@ -9,7 +9,7 @@ documentation: ug # Bookmarks in Flutter PDF -The Syncfusion® Flutter PDF provides support to add [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) to a PDF document to navigate interactively from one part of the document to another. It provides customization such as title font, color, size and more. It also provides support to [`insert`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/insert.html), [`remove`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/remove.html), and modify the bookmarks in an existing PDF Document. +The Syncfusion® Flutter PDF provides support to add [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) to a PDF document to navigate interactively from one part of the document to another. It provides customization such as title font, color, size and more. It also provides support to [`insert`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/insert.html), [`remove`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/remove.html), and modify the bookmarks in an existing PDF document. ## Adding bookmarks to a PDF @@ -18,7 +18,7 @@ The [`PdfBookmarkBase`](https://pub.dev/documentation/syncfusion_flutter_pdf/lat {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF document +//Creates a new PDF document PdfDocument document = PdfDocument(); //Creates document bookmark @@ -30,13 +30,13 @@ bookmark.destination = PdfDestination(document.pages.add(), Offset(100, 100)); //Sets the text style bookmark.textStyle = [PdfTextStyle.bold]; -//Sets the bookmark color(RGB) +//Sets the bookmark color (RGB) bookmark.color = PdfColor(255, 0, 0); -//Save the document +//Saves the document File('Output.pdf').writeAsBytes(await document.save()); -//Dispose the document +//Disposes the document document.dispose(); {% endhighlight %} @@ -49,10 +49,10 @@ You can add a child bookmark by using the [`insert`](https://pub.dev/documentati {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF document +//Creates a new PDF document PdfDocument document = PdfDocument(); -//Add a page +//Adds a page PdfPage page = document.pages.add(); //Creates document bookmark @@ -72,16 +72,16 @@ childBookmark2.textStyle = [PdfTextStyle.italic]; childBookmark1.destination = PdfDestination(page, Offset(100, 100)); childBookmark2.destination = PdfDestination(page, Offset(100, 400)); -//Sets the bookmark color(RGB) +//Sets the bookmark color (RGB) childBookmark1.color = PdfColor(0, 255, 0); childBookmark2.color = PdfColor(0, 0, 255); -//Saves the bookmark +//Saves the document File('Output.pdf').writeAsBytes(await document.save()); -//Dispose the document +//Disposes the document document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -176,8 +176,7 @@ document.dispose(); ## Modifying bookmarks in an existing PDF -The Syncfusion® - Flutter PDF allows you to modify the [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) in the existing PDF document. The following modifications can be done to bookmarks in an existing document. +The Syncfusion® Flutter PDF allows you to modify the [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) in the existing PDF document. The following modifications can be done to bookmarks in an existing document. * Modify the bookmark style, color, title, and destination. * Add or insert new bookmarks into the root collection. @@ -217,4 +216,4 @@ File('output.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md index bb36c9beb9..bfca662d06 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md @@ -9,7 +9,7 @@ documentation: ug # Digital Signature in Flutter PDF -Flutter PDF allows you to add a digital signature to the PDF document. You can sign the PDF document internally by using a certificate with private keys or externally by using the digital signature created from various sources such as cloud services like DigitalSign. +Flutter PDF allows you to add a digital signature to the PDF document. You can sign the PDF document internally using a certificate with private keys or externally by using the digital signature created from various sources such as cloud services like DigitalSign. ## Adding a digital signature @@ -18,17 +18,17 @@ To add a digital signature, you need a certificate with private keys. The follow {% tabs %} {% highlight dart tabtitle="dart" %} -//Creates a new PDF document +//Creates a new PDF document. PdfDocument document = PdfDocument(); -//Adds a new page +//Adds a new page. PdfPage page = document.pages.add(); -//Creates a digital signature and sets signature information +//Creates a digital signature and sets signature information. PdfSignatureField field = PdfSignatureField(page, 'signature', bounds: Rect.fromLTWH(0, 0, 200, 100), signature: PdfSignature( - //Creates a certificate instance from the PFX file with a private key + //Creates a certificate instance from the PFX file with a private key. certificate: PdfCertificate(File('PDF.pfx').readAsBytesSync(), 'password123'), contactInfo: 'johndoe@owned.us', @@ -37,10 +37,10 @@ PdfSignatureField field = PdfSignatureField(page, 'signature', digestAlgorithm: DigestAlgorithm.sha256, cryptographicStandard: CryptographicStandard.cms)); -//Add a signature field to the form +//Add a signature field to the form. document.form.fields.add(field); -//Save and dispose the PDF document +//Save and dispose the PDF document. File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); @@ -117,6 +117,8 @@ document.dispose(); You can sign the PDF document from an external digital signature created from various sources such as cloud services like DigitalSign. +The `addExternalSigner` method on `PdfSignature` accepts a custom signer (an implementation of `IPdfExternalSigner`) and a list of public-certificate bytes that are used to generate the message digest to be signed. + The following code example shows how to sign the PDF document from an external signature. {% tabs %} @@ -148,10 +150,10 @@ You can create an external digital signature with the [`x509`](https://pub.dev/p **Add dependency** -Add this to your package's pubspec.yaml file. +Add the following dependency to your `pubspec.yaml` file and then run `flutter pub get`. {% tabs %} -{% highlight dart tabtitle="dart" %} +{% highlight yaml tabtitle="yaml" %} dependencies: x509: ^0.1.4 @@ -167,12 +169,14 @@ dependencies: import 'package:x509/x509.dart' as x509; {% endhighlight %} +{% endtabs %} You can compute the signed message digest by using the x509 package with a corresponding private key of the public certificate. +{% tabs %} {% highlight dart %} -//Class for singing a PDF document externally. +//Class for signing a PDF document externally. class PdfExternalSigner extends IPdfExternalSigner { //Hash algorithm. @override @@ -194,14 +198,14 @@ class PdfExternalSigner extends IPdfExternalSigner { {% endhighlight %} {% endtabs %} -You can use the sign method in IPdfExternalSigner for asynchronous signing. +You can use the sign method in `IPdfExternalSigner` for asynchronous signing. -N> Asynchronous signing will only work when saving the PDF document asynchronously. signSync works with synchronous and asynchronous save methods. +N> The asynchronous `sign` method only works when the PDF document is saved asynchronously (using `await document.save()`). The `signSync` method can be used with both `document.save()` and `document.saveSync()`. {% tabs %} {% highlight dart tabtitle="dart" %} - //Class for singing a PDF document externally. + //Class for signing a PDF document externally. class PdfExternalSigner extends IPdfExternalSigner { //Hash algorithm. @override @@ -223,7 +227,7 @@ N> Asynchronous signing will only work when saving the PDF document asynchronous {% endhighlight %} {% endtabs %} -## Adding multiple digital signature +## Adding multiple digital signatures You can apply one or more digital signatures to a PDF document. The following code example shows how to add multiple signatures to the PDF document. @@ -278,7 +282,7 @@ The Syncfusion® Flutter PDF supports creating long term signature N> The resulting PDF document size will be substantial because all the necessary signature information, Certificate Revocation List (CRL), and Online Certificate Status Protocol (OCSP) are embedded. -The following code example shows how to enable LTV for a signed PDF document using createLongTermValidity method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. +The following code example shows how to enable LTV for a signed PDF document using the `createLongTermValidity` method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -298,9 +302,9 @@ The following code example shows how to enable LTV for a signed PDF document usi {% endhighlight %} {% endtabs %} -## Create Long Term Validation (LTV) with public certificates data +## LTV with public certificates data -The following code example shows how to create an LTV for a signed PDF document using public certificates with the createLongTermValidity method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. +The following code example shows how to create an LTV for a signed PDF document using public certificates with the `createLongTermValidity` method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The `publicCertificatesData` parameter accepts the chain of certificates returned by `PdfCertificate.getCertificateChain()`, and the `includePublicCertificates` flag controls whether the certificates are embedded into the signed document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -327,12 +331,13 @@ The following code example shows how to create an LTV for a signed PDF document {% endhighlight %} {% endtabs %} -## Adding a timestamp in digital signature +## Adding a timestamp in a digital signature + +Use this approach when you are creating a new digital signature and want the signature itself to carry a trusted timestamp from a `TimestampServer` (a TSA URL, with optional `userName`, `password`, and `timeOut`). -The Syncfusion® - Flutter PDF allows you to add timestamp in the digital signature of the PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. +The Syncfusion® Flutter PDF allows you to add a timestamp in the digital signature of the PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. -N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). +N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). {% tabs %} {% highlight dart tabtitle="dart" %} @@ -378,11 +383,13 @@ N> Signing using TimestampServer only works when the document is saved using asy {% endhighlight %} {% endtabs %} -## Adding a timestamp in the PDF document +## Adding a timestamp to the PDF document + +Use this approach when you need to add a trusted timestamp to a PDF document without binding it to a certificate-based signature. -You can add timestamp to the PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. +You can add a timestamp to the PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. -N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). +N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). {% tabs %} {% highlight dart tabtitle="dart" %} @@ -416,11 +423,13 @@ N> Signing using TimestampServer only works when the document is saved using asy {% endhighlight %} {% endtabs %} -## Adding a timestamp in an existing PDF document +## Adding a timestamp to an existing PDF document -You can add timestamp to the existing PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. +Use this approach when the document already exists and you need to attach a trusted timestamp without re-signing with a certificate. -N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). +You can add a timestamp to the existing PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. + +N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). {% tabs %} {% highlight dart tabtitle="dart" %} @@ -450,4 +459,4 @@ N> Signing using TimestampServer only works when the document is saved using asy document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md index 459e64835e..a963bc2c50 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md @@ -18,7 +18,7 @@ You can choose the standard or custom page size when you add a page to the PDF d {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set the page size @@ -33,7 +33,7 @@ document.pages.add().graphics.drawString( //Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -42,7 +42,7 @@ You can create a PDF document with custom page size by using the following code {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set the page size @@ -53,19 +53,19 @@ document.pages.add().graphics.drawString( 'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 19), brush: PdfBrushes.mediumVioletRed); -//Save and close the PDF document +//Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} -You can change the page [`orientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageSettings/orientation.html) from [`portrait`] to landscape using the [`PdfPageOrientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageOrientation.html) enum by the following code snippet. +You can change the page [`orientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageSettings/orientation.html) from portrait to landscape using the [`PdfPageOrientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageOrientation.html) enum by the following code snippet. {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set the page size @@ -80,10 +80,10 @@ document.pages.add().graphics.drawString( brush: PdfBrushes.mediumVioletRed, bounds: const Rect.fromLTWH(170, 100, 0, 0)); -//Save and close the PDF document +//Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -92,13 +92,13 @@ You can also change the [`orientation`](https://pub.dev/documentation/syncfusion {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set the page size document.pageSettings.size = PdfPageSize.a4; -//Change the page orientation to 90 degree +//Change the page orientation to 90 degrees document.pageSettings.rotate = PdfPageRotateAngle.rotateAngle90; //Draw the text by adding page to the document @@ -107,10 +107,10 @@ document.pages.add().graphics.drawString( brush: PdfBrushes.mediumVioletRed, bounds: const Rect.fromLTWH(170, 100, 0, 0)); -//Save and close the PDF document +//Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -121,22 +121,22 @@ PDF [`sections`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Add a section to PDF document PdfSection section = document.sections!.add(); -//Draw the text by section page graphics +//Draw the text on the section page graphics section.pages.add().graphics.drawString( 'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 27), brush: PdfBrushes.mediumVioletRed, bounds: const Rect.fromLTWH(170, 100, 0, 0)); -//Save and close the PDF document +//Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -157,11 +157,11 @@ document.fileStructure.incrementalUpdate = false; //Set the compression level document.compressionLevel = PdfCompressionLevel.best; -//Saves the document +//Save the document File('output.pdf').writeAsBytes(await document.save()); -//Disposes the document +//Dispose the document document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md index b3f0ef4625..07b61f0d53 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md @@ -1,7 +1,7 @@ --- layout: post title: Flow layout in Flutter PDF library | Syncfusion -description: Learn here all about drawing images, paragraph text, header text and tables using Flow layout feature of Syncfusion Flutter non-UI PDF library and more. +description: Learn here all about drawing images, paragraph text, header text and tables using Flow layout feature of Syncfusion Flutter non-UI PDF library. platform: document-processing control: PDF documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Flow layout in Flutter PDF -The Syncfusion® Flutter PDF supports creating a PDF document with flow model by maintaining the position of previously drawn element. +The Syncfusion® Flutter PDF supports creating a PDF document with flow model by maintaining the position of the previously drawn elements. ## Flow model using PdfLayoutResult @@ -42,7 +42,7 @@ PdfLayoutResult layoutResult = textElement.draw( page.getClientSize().height))!; //Assign header text to PdfTextElement -textElement.text = 'Top 5 sales stores'; +textElement.text = 'Top 3 sales stores'; //Assign standard font to PdfTextElement textElement.font = PdfStandardFont(PdfFontFamily.helvetica, 14, @@ -70,7 +70,7 @@ row2.cells[0].value = 'E02'; row2.cells[1].value = 'Thomas'; row2.cells[2].value = '\$10,500'; PdfGridRow row3 = grid.rows.add(); -row3.cells[0].value = 'E02'; +row3.cells[0].value = 'E03'; row3.cells[1].value = 'Simon'; row3.cells[2].value = '\$12,000'; @@ -86,4 +86,4 @@ File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md index 8b85ad5e7e..640eb56d39 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md @@ -9,7 +9,7 @@ documentation: UG # Forms in Flutter PDF -An interactive form sometimes referred to as an AcroForm is a collection of fields for gathering information. A PDF document can contain any number of fields appearing on any combination of pages, all that makes a single, globally interactive form spanning the entire document. +An interactive form sometimes referred to as an AcroForm is a collection of fields for gathering information. A PDF document can contain any number of fields appearing on any combination of pages, all of which makes a single, globally interactive form spanning the entire document. ## Creating a new PDF form @@ -299,7 +299,7 @@ File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} -### Adding the check Box field +### Adding the check box field You can create the check box field in PDF forms using the PdfCheckBoxField class. @@ -340,7 +340,7 @@ final PdfDocument document = // Create a check box form field and add it to the existing document. document.form.fields.add(PdfCheckBoxField( - document.pages.add(), 'CheckBox', Rect.fromLTWH(100, 200, 70, 45), + document.pages[0], 'CheckBox', Rect.fromLTWH(100, 200, 70, 45), highlightMode: PdfHighlightMode.push, borderStyle: PdfBorderStyle.dot, borderColor: PdfColor(230, 0, 172), @@ -373,7 +373,7 @@ document.form.fields.add(PdfSignatureField(document.pages.add(), 'Sign', bounds: Rect.fromLTWH(100, 100, 100, 50))); //Save the PDF document. -File('output.pdf').writeAsBytesSync(document.save()); +File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} @@ -456,9 +456,9 @@ File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} -## Set appearance to the PDF form fields +## Setting appearance to the PDF form fields -After filling the form fields in the PDF document, it may appear empty due to the absence of the appearance dictionary. By setting the setDefaultAppearance method in PdfForm class to false, you can create the appearance dictionary. By this, the text will be visible in all PDF Viewers. +After filling the form fields in the PDF document, it may appear empty due to the absence of the appearance dictionary. By setting the setDefaultAppearance method in PdfForm class to true, you can create the appearance dictionary. By this, the text will be visible in all PDF Viewers. The following code sample explains how to set appearance to the PDF form fields. @@ -511,7 +511,7 @@ File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} -Retrieving or Modifying the fore, border, and back color of an existing form field +### Retrieving or modifying the fore, border, and back color of an existing form field You can retrieve or modify the fore, border, and background color of existing form fields in a PDF document by using the foreColor, borderColor, and backColor properties of the respective form fields. The following code sample explains this. @@ -653,7 +653,7 @@ File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} -### Enumerate the form fields +### Enumerating the form fields All the form fields are maintained in the PdfFormFieldCollection class. You can enumerate the fields from this form field collection and fill them. @@ -703,7 +703,7 @@ document.form.fields.add(PdfTextBoxField( text: 'toType', isPassword: true, spellCheck: true)); //Save the PDF document. -File('output.pdf').writeAsBytesSync(document.save()); +File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} @@ -748,7 +748,7 @@ document.form.fields.add(PdfTextBoxField( text: 'toType', isPassword: true, spellCheck: true)); //Save the PDF document. -File('output.pdf').writeAsBytesSync(document.save()); +File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} @@ -801,9 +801,9 @@ File('output.pdf').writeAsBytesSync(await document.save()); Flutter PDF supports auto naming of form fields in a PDF document while creating form fields with the same name. The fieldAutoNaming property of PdfForm is used to enable or disable auto naming of a form field. -While enabling this property, the field names are auto naming. If the fields are created using the same or common name, the created fields will act as an individual. +While enabling this property, the field names are auto-named. If the fields are created using the same or common name, the created fields will act as an individual. -While disabling this property, the field names are not auto naming, and the created fields are saved in a single group. The same value will be referred in all the same name fields. +While disabling this property, the field names are not auto-named, and the created fields are saved in a single group. The same value will be referred in all the same name fields. By default, the value is set to true. This is explained in the following code sample. @@ -935,7 +935,7 @@ File('output.pdf').writeAsBytesSync(await document.save()); ## Importing XML file to PDF -XML stands for an extensible markup language. The XML file is used to save the form data that can be imported into a PDF document. You can import the JSON file to PDF using the importData method available in the ['PdfForm'](#) class. +XML stands for an extensible markup language. The XML file is used to save the form data that can be imported into a PDF document. You can import the XML file to PDF using the importData method available in the ['PdfForm'](#) class. The following code sample explains how to import XML files to PDF. @@ -1044,7 +1044,7 @@ document.dispose(); Sometimes, Form fields may appear empty in an adobe reader due to the absence of the appearance dictionary. To resolve this, you need to enable the Adobe Reader default appearance by using the setDefaultAppearance method in PdfForm class. -The following code explains how to enable the default appearance in a new PDF document. +The following code explains how to enable the default appearance in an existing PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md index 90714757fb..78d4d7bfb0 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md @@ -1,7 +1,7 @@ --- layout: post title: Headers and Footers in Flutter PDF library | Syncfusion -description: Learn here all about drawing Headers and Footers feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn all about drawing Headers and Footers feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -9,13 +9,13 @@ documentation: ug # Headers and Footers in Flutter PDF -The Flutter PDF supports drawing the header and footer in PDF document using [`PdfPageTemplateElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageTemplateElement-class.html) class. The header and footer contain the graphics support and automatic field support to perform their operations. +The Flutter PDF supports drawing the header and footer in a PDF document using [`PdfPageTemplateElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageTemplateElement-class.html) class. The header and footer support graphics and automatic fields to perform various operations. -## Adding graphics and automatic fields to header and footer +## Adding graphics and automatic fields to the header and footer -This package supports to add page count, page numbers, date and time using automatic fields such as [`PdfPageCountField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageCountField-class.html), [`PdfPageNumberField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageNumberField-class.html) and [`PdfDateTimeField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDateTimeField-class.html), and more. +This package supports adding page count, page numbers, date and time using automatic fields such as [`PdfPageCountField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageCountField-class.html), [`PdfPageNumberField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageNumberField-class.html) and [`PdfDateTimeField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDateTimeField-class.html), and more. -The following code snippet explains how to use the graphics and automatic fields in header and footer. +The following code snippet explains how to use the graphics and automatic fields in the header and footer. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -34,7 +34,7 @@ PdfDateTimeField dateAndTimeField = PdfDateTimeField( dateAndTimeField.date = DateTime(2020, 2, 10, 13, 13, 13, 13, 13); dateAndTimeField.dateFormatString = 'E, MM.dd.yyyy'; -//Create the composite field with date field +//Create the composite field with a date field PdfCompositeField compositefields = PdfCompositeField( font: PdfStandardFont(PdfFontFamily.timesRoman, 19), brush: PdfSolidBrush(PdfColor(0, 0, 0)), @@ -65,7 +65,7 @@ PdfPageCountField count = PdfPageCountField( font: PdfStandardFont(PdfFontFamily.timesRoman, 19), brush: PdfSolidBrush(PdfColor(0, 0, 0))); -//set the number style for page count +//Set the number style for page count count.numberStyle = PdfNumberStyle.upperRoman; //Create the date and time field @@ -79,7 +79,7 @@ dateTimeField.date = DateTime(2020, 2, 10, 13, 13, 13, 13, 13); //Sets the date and time format dateTimeField.dateFormatString = 'hh\':\'mm\':\'ss'; -//Create the composite field with page number page count +//Create the composite field with page number and page count PdfCompositeField compositeField = PdfCompositeField( font: PdfStandardFont(PdfFontFamily.timesRoman, 19), brush: PdfSolidBrush(PdfColor(0, 0, 0)), @@ -110,6 +110,6 @@ document.dispose(); {% endhighlight %} {% endtabs %} -By executing the above code sample, you will get the PDF document as follows. +By executing the above code sample, you will get the PDF document as shown below. -![Header and Footer PDF](images/working-with-headers-and-footers/header-and-footer.png) +![Header and Footer PDF](images/working-with-headers-and-footers/header-and-footer.png) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md index 5b64a116e5..fb7a1712e0 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md @@ -9,7 +9,7 @@ documentation: ug # Hyperlinks in Flutter PDF -In PDF, hyperlinks can be added to allow the users to navigate to another part of a PDF file and web page. +In PDF, hyperlinks can be added to allow the users to navigate to another part of a PDF file or a web page. ## Working with Web navigation @@ -25,7 +25,7 @@ PdfDocument document = PdfDocument(); //Create and draw the web link in the PDF page PdfTextWebLink( - url: 'www.google.co.in', + url: 'https://www.google.co.in', text: 'google', font: PdfStandardFont(PdfFontFamily.timesRoman, 14), brush: PdfSolidBrush(PdfColor(0, 0, 0)), @@ -46,7 +46,7 @@ document.dispose(); ## Working with internal document navigation -To allow the users navigate to any other part of the same document, the [`PdfDocumentLinkAnnotation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocumentLinkAnnotation-class.html) class can be used. +To allow users to navigate to any other part of the same document, the [`PdfDocumentLinkAnnotation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocumentLinkAnnotation-class.html) class can be used. The following code explains how to add the hyperlink for internal document navigation. diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md index 97f8b6ef45..5addbd8cbf 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md @@ -1,7 +1,7 @@ --- layout: post title: Images in Flutter PDF library | Syncfusion -description: Learn here all about draw raster images and applying transparency and rotation to the images feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn how to draw raster images and apply transparency and rotation using the Syncfusion Flutter PDF non-UI library. platform: document-processing control: PDF documentation: ug @@ -9,9 +9,9 @@ documentation: ug # Images in Flutter PDF -Images are supported through the [`PdfImage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfImage-class.html) class, which is an abstract base class that provides functionality for [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) class. +Images are supported through the [`PdfImage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfImage-class.html) class, which is an abstract base class that provides functionality for the [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) class. -## Inserting an image in PDF document +## Inserting an image in a PDF document The following raster images are supported in Flutter PDF: @@ -62,7 +62,7 @@ PdfPage page = document.pages.add(); //Save the current graphics state PdfGraphicsState state = page.graphics.save(); -//Translate the coordinate system to the required position +//Translate the coordinate system to the required position page.graphics.translateTransform(20, 100); //Apply transparency @@ -89,9 +89,9 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Inserting image to PDF using a web URL +## Inserting an image to a PDF using a web URL -The ['PdfBitmap'](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) API accepts List and base64 string as inputs, so you can retrieve the image from the web URL as base64 or List and assign it to the bitmap class. +The [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) API accepts `List` and base64 string as inputs, so you can retrieve the image from the web URL as `List` (or base64) and assign it to the bitmap class. Steps to insert an image to the PDF using Web URL: 1. Add **http** package to the dependencies section of the **pubspec.yaml** file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md index 387bd5aff8..65f1fa6626 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md @@ -65,7 +65,7 @@ File('output.pdf').writeAsBytes(await document.save()); {% endhighlight %} {% endtabs %} -The following code shows how to add the multiple layers in an existing PDF document. +The following code shows how to add a layer to an existing PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -101,7 +101,7 @@ File('output.pdf').writeAsBytes(await document.save()); ## Toggling the visibility of layers -The visibility of a layer can be mentioned while creating a new page layer. +The visibility of a layer can be specified while creating a new page layer. The following code shows how to toggle the visibility of layers in a new PDF document. @@ -136,7 +136,7 @@ File('output.pdf').writeAsBytes(await document.save()); ## Removing layers from an existing PDF document -You can remove the layers from the layer collection represented by the [`PdfPageLayerCollection`](#) of the loaded page. This is showed in the following code sample. +You can remove the layers from the layer collection represented by the [`PdfPageLayerCollection`](#) of the loaded page. This is shown in the following code sample. {% tabs %} {% highlight dart tabtitle="dart" %} diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md index 62c9110dd0..da041ca826 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md @@ -1,7 +1,7 @@ --- layout: post title: Bullets and Lists in Flutter PDF library | Syncfusion -description: Learn here all about add ordered and unordered lists feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn here all about adding ordered and unordered lists features of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Bullets and Lists in Flutter PDF -The Syncfusion® Flutter PDF allows you list the content in ordered and unordered list. The ordered list can be number or alphabets and the unordered list can be bullets, circles, and images. +The Syncfusion® Flutter PDF allows you to list the content in ordered and unordered list. The ordered list can be number or alphabets and the unordered list can be bullets, circles, and images. ## Adding an ordered list @@ -76,7 +76,7 @@ document.dispose(); ## Adding a sub list -The Syncfusion® Flutter PDF also provides support to create a sub list to a [`PdfList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfList-class.html). A sub list can be created under both [`PdfOrderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfOrderedList-class.html) and [`PdfUnorderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfUnorderedList-class.html). The following code snippet explains the same. +The Syncfusion® Flutter PDF also provides support to create a sub list in a [`PdfList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfList-class.html). A sub list can be created under both [`PdfOrderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfOrderedList-class.html) and [`PdfUnorderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfUnorderedList-class.html). The following code snippet explains the same. {% tabs %} {% highlight dart tabtitle="dart" %} diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md index deaba3983a..56df6dd059 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md @@ -1,7 +1,7 @@ --- layout: post title: Pages in Flutter PDF library | Syncfusion -description: Learn here all about add, rotate pages and customize page settings feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn about adding and rotating pages and customizing page settings in the Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -16,7 +16,7 @@ The following code sample explains how to add a [`PdfPage`](https://pub.dev/docu {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Create a new PDF page and draw the text @@ -46,7 +46,7 @@ PdfDocument document = document.pages.insert(0); //Saves the document -File('output.pdf').writeAsBytes(await document.save()); +File('Output.pdf').writeAsBytes(await document.save()); //Disposes the document document.dispose(); @@ -62,7 +62,7 @@ You can add [`margin`](https://pub.dev/documentation/syncfusion_flutter_pdf/late {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set margin for all the pages @@ -71,10 +71,11 @@ document.pageSettings.margins.all = 200; //Draw the text by adding page to the document document.pages.add().graphics.drawString( 'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 27), - brush: PdfBrushes.darkBlue); + brush: PdfBrushes.darkBlue, bounds: const Rect.fromLTWH(170, 100, 0, 0)); //Save and dispose the PDF document -List bytes =await document.save(); +List bytes = await document.save(); +await File('Output.pdf').writeAsBytes(bytes); document.dispose(); {% endhighlight %} @@ -150,7 +151,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Get the number of pages from a PDF document +## Getting the number of pages from a PDF document You can get the page count from the existing PDF document as shown in the following code sample. @@ -232,7 +233,7 @@ document.pages.remove(page); document.pages.removeAt(0); //Saves the document -File('output.pdf').writeAsBytes(await document.save()); +File('Output.pdf').writeAsBytes(await document.save()); //Disposes the document document.dispose(); diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md index 71e9d5d5ff..061ae4ef7f 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md @@ -15,7 +15,7 @@ The Syncfusion® Flutter PDF currently supports the following PDF * PDF/A-2b conformance * PDF/A-3b conformance -N> To know more details about PDF/A standard refer [`https://en.wikipedia.org/wiki/PDF/A#Description`](https://en.wikipedia.org/wiki/PDF/A#Description) +N> To know more details about the PDF/A standard, refer to [PDF/A standard](https://en.wikipedia.org/wiki/PDF/A#Description) ## PDF/A-1b conformance @@ -63,7 +63,7 @@ document.dispose(); ## PDF/A-3b conformance -The PDF/A-3b conformance supports the external files as attachment to the PDF document, so you can attach any document format such as Excel, Word, HTML, CAD, or XML files. +The PDF/A-3b conformance supports external files as attachments to the PDF document, so you can attach any document format such as Excel, Word, HTML, CAD, or XML files. You can create a PDF/A-3b document by specifying the conformance level as a3b through PdfConformanceLevel enum when creating the new PDF document as follows. @@ -79,7 +79,7 @@ PdfDocument document = PdfDocument(conformanceLevel: PdfConformanceLevel.a3b) //Creates an attachment PdfAttachment attachment = PdfAttachment( 'input.txt', File('input.txt').readAsBytesSync(), - description: 'Input text', mimeType: 'application/txt') + description: 'Input text', mimeType: 'text/plain') ..relationship = PdfAttachmentRelationship.alternative ..modificationDate = DateTime.now(); @@ -93,4 +93,4 @@ File('output.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md index a8115e6f8e..e553fd141b 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md @@ -1,7 +1,7 @@ --- layout: post title: Templates in Flutter PDF library | Syncfusion -description: Learn here all about add headers and footers and stamp by Templates feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn here all about adding headers, footers, and stamps using the Templates feature of the Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -9,11 +9,11 @@ documentation: ug # Templates in Flutter PDF -A PDF template is a drawing surface, where contents can be added. All the elements that can be added to a [`PdfPage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage-class.html) is supported in [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) as well. The template in turn can be drawn over the page or can be positioned at any part of the page. +A PDF template is a drawing surface, where contents can be added. All the elements that can be added to a [`PdfPage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage-class.html) are supported in [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) as well. The template in turn can be drawn over the page or can be positioned at any part of the page. ## Creating a new PDF template -The [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) class can be used to create a new PDF template. You can add contents to the template using [`graphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage/graphics.html) property of the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) object. +The [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) class can be used to create a new PDF template. You can add contents to the template using [`graphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate/graphics.html) property of the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) object. The following code example explains how to add contents to the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) and render into the new PDF page. @@ -49,7 +49,7 @@ document.dispose(); Essential® PDF supports template creation using the [`CreateTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage/createTemplate.html) method, enabling users to extract content from an existing PDF page and seamlessly incorporate it into a new PDF document. -The below code illustrates how to create the template from an existing page and draw it in a new PDF document. +The following code illustrates how to create the template from an existing page and draw it in a new PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -69,6 +69,8 @@ The below code illustrates how to create the template from an existing page and PdfGraphics graphics = page.graphics; //Draw the template. graphics.drawPdfTemplate(template, Offset(0, 0)); + //Dispose the loaded PDF document. + loadedDocument.dispose(); //Save and dispose of the PDF document. File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); @@ -185,7 +187,7 @@ document.dispose(); ## Adding stamp to the PDF document -The Syncfusion® Flutter PDF allows you add stamp to the PDF document using PDF templates. +The Syncfusion® Flutter PDF allows you to add a stamp to the PDF document using PDF templates. The following code example explains how to draw text as a stamp to the PDF document. diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md index 1511700976..30b379cd7d 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md @@ -9,7 +9,7 @@ documentation: ug # Security in Flutter PDF -Flutter PDF allows you to protect the PDF document using encryption and set permission to the PDF document operations like printing, editing, copy content etc. using user password and owner password. Two types of encryption algorithms are available +Flutter PDF allows you to protect the PDF document using encryption and set permissions for PDF document operations like printing, editing, copying content, and more using user password and owner password. Two types of encryption algorithms are available * Rivest Cipher 4 (RC4) * Advanced Encryption Standard (AES) @@ -23,7 +23,7 @@ User password: Prevents people from opening or viewing a PDF document. Once the {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Document security @@ -48,16 +48,16 @@ document.dispose(); {% endhighlight %} {% endtabs %} -N> While using both user and owner passwords, please specify different user and owner password while encrypting the PDF document for better security. +N> When using both user and owner passwords, please specify a different password for each while encrypting the PDF document for better security. You can protect the PDF document from printing, editing, copying with the [`ownerPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/ownerPassword.html) by using the following code snippet. -Owner password: Sets PDF document restrictions, which can include printing, content copying, editing, page extracting, commenting, and more. Once the owner password is set, Acrobat will require this password to make any changes to the PDF document. It further secures the PDF document to set a PDF Owner Password. +Owner password: Sets PDF document restrictions, which can include printing, content copying, editing, page extracting, commenting, and more. Once the owner password is set, Acrobat will require this password to make any changes to the PDF document. Setting a PDF owner password further secures the PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Document security @@ -91,12 +91,12 @@ document.dispose(); ## Working with AES Encryption -You can encrypt PDF document using AES algorithm with 128bit or 256bit or 256bit Revision 6 key size. The following code snippet illustrates how to encrypt the PDF document with the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html). +You can encrypt PDF document using AES algorithm with 128bit, 256bit, or 256bit Revision 6 key size by setting the [`algorithm`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/algorithm.html) to the corresponding [`PdfEncryptionAlgorithm`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfEncryptionAlgorithm.html) value (`aesx128Bit`, `aesx256Bit`, or `aesx256BitRevision6`). The following code snippet illustrates how to encrypt the PDF document with the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html). {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Document security @@ -185,9 +185,9 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Changing the password of the PDF document +## Changing the user password of the PDF document -You can change the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) of the existing PDF document by using following code snippet. +You can change the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) of the existing PDF document by using the following code snippet. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -206,7 +206,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Remove password from the user password PDF document +## Remove the user password from a PDF document You can remove the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) from the encrypted PDF document by using the following code snippet. @@ -259,9 +259,9 @@ document.dispose(); ## How to determine whether the PDF document is protected by user or owner password? -Flutter PDF supports identifying the document whether it is protected by user or owner. +Flutter PDF supports identifying whether a document is protected by a user or owner password. -The following table shows the various combination for loading the secured document with user or owner password: +The following table shows the various combinations for loading a secured document with a user or owner password: @@ -338,4 +338,4 @@ Returns owner Password (owner password is same as the user password; it allows f -
+ \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md index 900fd82860..fd3d4f55c5 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md @@ -180,7 +180,7 @@ document.dispose(); ### Arc -You can draw an arc in PDF document by using the [`drawArc`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html) method of [`PdfGraphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html). The following code snippet explains how to draw an arc in the new PDF document. +You can draw an arc in PDF document by using the [`drawArc`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics/drawArc.html) method of [`PdfGraphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html). The following code snippet explains how to draw an arc in the new PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -248,4 +248,4 @@ File('Ellipse.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md index 0db94dc49a..4db03b733b 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md @@ -1,7 +1,7 @@ --- layout: post title: Tables in Flutter PDF library | Syncfusion -description: Learn here all about draw and customize cells, rows, and columns in Tables feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn here all about drawing and customizing cells, rows, and columns in Tables feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -13,7 +13,7 @@ The Syncfusion® Flutter PDF provides support for creating customi ## Creating a table -[`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) allows you to create table by entering the data manually. +[`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) allows you to create a table by entering the data manually. The following code example explains how to create a table directly using [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) with [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html), [`PdfGridColumn`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridColumn-class.html) and [`PdfGridRow`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridRow-class.html) classes. @@ -29,10 +29,10 @@ PdfGrid grid = PdfGrid(); //Add the columns to the grid grid.columns.add(count: 3); -//Add header to the grid +//Add a header to the grid grid.headers.add(1); -//Add the rows to the grid +//Add the header to the grid PdfGridRow header = grid.headers[0]; header.cells[0].value = 'Employee ID'; header.cells[1].value = 'Employee Name'; @@ -263,7 +263,7 @@ document.dispose(); ## Table customization in PdfGrid -Flutter PDF supports users to create a customizable PDF table like [`cellSpacing`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellSpacing.html), [`cellPadding`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellPadding.html), [`borderOverLapStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/borderOverlapStyle.html), and more. This can be achieved by using the [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html) class. +Flutter PDF supports users to create a customizable PDF table like [`cellSpacing`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellSpacing.html), [`cellPadding`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellPadding.html), [`borderOverlapStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/borderOverlapStyle.html), and more. This can be achieved by using the [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html) class. The following code snippet explains how to customize the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html). @@ -356,14 +356,14 @@ document.dispose(); ## Pagination in PdfGrid -Flutter PDF supports to paginate the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using the [`PdfLayoutFormat`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfLayoutFormat-class.html) class. +Flutter PDF supports paginating the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using the [`PdfLayoutFormat`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfLayoutFormat-class.html) class. The following sample explains how to allow [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) to flow across pages. {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Create a PdfGrid diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md index 8f7c0c0878..1ef5c03abd 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md @@ -1,7 +1,7 @@ --- layout: post title: Text extraction in Flutter PDF library | Syncfusion -description: Learn here all about different types of fonts and draw Text feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn how to extract or find text from PDF pages using the Syncfusion Flutter PDF library with simple, practical code examples and more. platform: document-processing control: PDF documentation: ug @@ -15,7 +15,7 @@ The Syncfusion® Flutter PDF allows you to extract or find the tex You can extract the text from pages using the extractText method in the PdfTextExtractor class. -The following code explains how to extract the text from the entire PDF document: +The following code sample explains how to extract the text from the entire PDF document: {% tabs %} {% highlight dart tabtitle="dart" %} @@ -33,7 +33,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -The following code sample explains how to extract the texts from a specific page: +The following code sample explains how to extract the text from a specific page: {% tabs %} {% highlight dart tabtitle="dart" %} @@ -51,7 +51,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -The following code sample explains how to extract the texts from a particular page range: +The following code sample explains how to extract the text from a particular page range: {% tabs %} {% highlight dart tabtitle="dart" %} @@ -114,7 +114,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -### Working with words +### Working with Words You can get a single word and its properties by using the TextWord. Refer to the following code sample. @@ -162,7 +162,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -### Working with characters +### Working with Characters You can get a single character and its properties by using the TextGlyph. Refer to the following code sample. @@ -213,7 +213,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Working with find text +## Working with Find Text You can find a collection of text from pages using the findText method in the PdfTextExtractor class. You can get the text and its properties using the MatchedItem. @@ -287,4 +287,4 @@ List textCollection = PdfTextExtractor(document).findText( document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md index 768dd4de82..51bfb5777e 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md @@ -1,7 +1,7 @@ --- layout: post title: Text drawing in Flutter PDF library | Syncfusion -description: Learn here all about Text extraction and find text feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn all about the text drawing feature of the Syncfusion Flutter PDF non-UI library with simple, practical code examples and more. platform: document-processing control: PDF documentation: ug @@ -71,9 +71,9 @@ The Syncfusion® Flutter PDF allows you to add text to the PDF doc ### Draw text using standard fonts -PDF has fourteen base fonts also known as standard fonts, which has special significance. The details can be referred from the link below. +PDF has fourteen base fonts also known as standard fonts, which have special significance. The details can be referred from the link below. -[`Standard type 1 fonts`](https://en.wikipedia.org/wiki/PDF#Standard_Type_1_Fonts_.28Standard_14_Fonts.29) +[`Standard type 1 fonts`](https://en.wikipedia.org/wiki/PDF#Standard_Type_1_Fonts_(Standard_14_Fonts)) You can add text using the standard PDF fonts, by initializing the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfStandardFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfStandardFont-class.html) class. The following code snippet explains this. @@ -99,7 +99,7 @@ document.dispose(); ### Draw text using TrueType fonts -You can add text using the font data, by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) class. The font data can be loaded from the disk. The font data can be initialized to [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) as a list of bytes or base64 string format. The following code snippet explains this. +You can add text using the font data, by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) class. The font data can be loaded from the disk. The font data can be initialized to [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) as a list of bytes or in base64 string format. The following code snippet explains this. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -123,7 +123,7 @@ document.dispose(); ### Draw text using CJK fonts -The Syncfusion® Flutter PDF provides support to draw a CJK (Chinese, Japanese, Korean) text using some of the standard CJK fonts. The font data can be initialized by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as PDF CJK StandardFont. The following code sample explains this. +The Syncfusion® Flutter PDF provides support to draw a CJK (Chinese, Japanese, Korean) text using some of the standard CJK fonts. The font data can be initialized by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfCjkStandardFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfCjkStandardFont-class.html). The following code sample explains this. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -147,7 +147,7 @@ document.dispose(); ## Measuring a string -The Syncfusion® Flutter PDF allows you to measure the size of a string which uses the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) using the [`measureString`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont/measureString.html) method of it and returns the size. Refer to the following code sample. +The Syncfusion® Flutter PDF allows you to measure the size of a string which uses the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) using the [`measureString`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont/measureString.html) method and returns the size. Refer to the following code sample. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -215,7 +215,7 @@ document.dispose(); ## Creating a multicolumn PDF document -Syncfusion® Flutter PDF allows you to create a multi-column text in PDF document by using [`PdfTextElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTextElement-class.html) class. The following code example explains the same. +Syncfusion® Flutter PDF allows you to create a multi-column text in a PDF document by using [`PdfTextElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTextElement-class.html) class. The following code example explains how to draw text in multiple columns. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -300,13 +300,13 @@ File('Output.pdf').writeAsBytes(await document.save()); //Disposes the document document.dispose(); - + {% endhighlight %} {% endtabs %} -## Draw text with Pens and Brushes +## Drawing text with pens and brushes -Pens and brushes are used to draw the content on PDF document with specific color and style. +Pens and brushes are used to draw the content on a PDF document with specific color and style. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -318,11 +318,11 @@ final PdfDocument document = PdfDocument(); document.pages.add().graphics.drawString( 'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 20), brush: PdfSolidBrush(PdfColor(0, 0, 0)), - pen: PdfPen(PdfColor(255, 0, 0), width : 0.5), + pen: PdfPen(PdfColor(255, 0, 0), width: 0.5), bounds: const Rect.fromLTWH(0, 0, 500, 50)); //Save the document -final List bytes =await document.save(); +File('Output.pdf').writeAsBytes(await document.save()); //Dispose the document document.dispose(); @@ -330,4 +330,4 @@ document.dispose(); {% endhighlight %} {% endtabs %} -The Syncfusion® Flutter PDF has [`Pens`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPens-class.html) and [`Brushes`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBrushes-class.html) with various built-in colors to draw the content on PDF document. \ No newline at end of file +The Syncfusion® Flutter PDF has [`Pens`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPens-class.html) and [`Brushes`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBrushes-class.html) with various built-in colors to draw the content on a PDF document. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md index aea556cd11..c647e4b57e 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md @@ -1,7 +1,7 @@ --- layout: post title: Watermarks in Flutter PDF library | Syncfusion -description: Learn here all about add text and image Watermarks feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn all about adding text and image watermarks feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -13,7 +13,7 @@ The Syncfusion® Flutter PDF provides support for adding watermark ## Adding text watermark to a PDF document -The Syncfusion® Flutter PDF allows you draw the text watermark to the PDF document using graphics elements. +The Syncfusion® Flutter PDF allows you to draw the text watermark to the PDF document using graphics elements. The following code example explains how to draw the text watermark to the PDF document. @@ -85,4 +85,4 @@ File('SampleOutput.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file From 36766d701369ef124048baf571d8fa570317b34d Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:42:34 +0530 Subject: [PATCH 027/127] Include code examples for comment panel visibility Added code snippets for showing the comment panel in PDF Viewer. --- .../PDF/PDF-Viewer/maui/Annotations-Comment.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md index 480e05b97c..5f81f1d590 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md @@ -20,6 +20,8 @@ The PDF Viewer control provides options to add, edit, and delete comments for th ## Showing or hiding the comment panel The built-in Comment Panel in the PDF Viewer displays annotation comments. You can show or hide this panel using the [IsCommentsPanelVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsCommentsPanelVisible) property. The default value of this property is false. +{% tabs %} +{% highlight c# %} // Show the comment panel in the PDF Viewer PdfViewer.IsCommentsPanelVisible = true; @@ -28,7 +30,7 @@ PdfViewer.IsCommentsPanelVisible = true; {% endtabs %} {% tabs %} -{% highlight xaml %} +{% highlight XAML %} From cdd7a0d6029fa1a79ce8a8e996a5f224fb45c297 Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:44:05 +0530 Subject: [PATCH 028/127] Update DocumentLoadNotifications.md to remove examples Removed code usage examples for document load events in SfPdfViewer. --- .../PDF-Viewer/maui/DocumentLoadNotifications.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md b/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md index ef0c01ff02..d2974239e9 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md @@ -12,22 +12,6 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) and [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) events to notify whether the document has been opened and displayed in the view or not. -To work with document load events in code, ensure the following namespace is imported in your C# file: - -{% tabs %} -{% highlight c# %} -using Syncfusion.Maui.PdfViewer; -{% endhighlight %} -{% endtabs %} - -To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: - -{% tabs %} -{% highlight XAML %} -xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" -{% endhighlight %} -{% endtabs %} - ## Document loaded event The [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event triggers after the document is loaded in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). Refer to the following code example: From f2bf9b0125eb2cb01b738a45428ec2eadcf176a9 Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:45:55 +0530 Subject: [PATCH 029/127] Update Form-Filling-Collection.md to remove code snippet Removed code snippet for importing namespaces in C#. --- .../PDF/PDF-Viewer/maui/Form-Filling-Collection.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md index b243fcd7c9..89a7226654 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md @@ -12,15 +12,6 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne The [SfPdfViewer.FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) property provides access to all form fields present in the loaded PDF document. The collection is available after the document finishes loading and can be accessed from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event. For a broader overview of form-filling support, see [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview). -To work with form fields in code, ensure the following namespaces are imported in your C# file: - -{% tabs %} -{% highlight c# %} -using Syncfusion.Maui.PdfViewer; -using System.Linq; -{% endhighlight %} -{% endtabs %} - ## Accessing the FormFields collection The following code snippet illustrates getting the total count of form fields in the PDF document. Call the `WireDocumentLoadedEvent` method from your page constructor or initialization logic so the `DocumentLoaded` handler is registered before a document is loaded. @@ -113,4 +104,4 @@ private void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChange - [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) - [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) - [Form Field Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) -- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) \ No newline at end of file +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) From 85d0bf39e176eb5e52f7400fd0aa7273658acc62 Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:47:26 +0530 Subject: [PATCH 030/127] Remove code examples for form field events Removed code usage examples for form field events in C# and XAML. --- .../PDF/PDF-Viewer/maui/Form-Filling-Events.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md index becd51ead7..a5433e61e1 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md @@ -17,22 +17,6 @@ The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer. | [FormFieldValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged) | Raised when the value of a form field changes. | | [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) | Raised when a text or signature field gains or loses focus. | -To work with form field events in code, ensure the following namespace is imported in your C# file: - -{% tabs %} -{% highlight c# %} -using Syncfusion.Maui.PdfViewer; -{% endhighlight %} -{% endtabs %} - -To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: - -{% tabs %} -{% highlight XAML %} -xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" -{% endhighlight %} -{% endtabs %} - ## Detect value changes The [FormFieldValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged) event is raised whenever the value of a form field changes. You can use the [OldValue](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldValueChangedEventArgs_OldValue) and [NewValue](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldValueChangedEventArgs_NewValue) properties of [FormFieldValueChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html) to read the before and after values. From 952ed68fa4ae3d5616d521e7dbc49863ab66e9b1 Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:48:36 +0530 Subject: [PATCH 031/127] Fix formatting issue in Form-Filling-Events.md --- Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md index a5433e61e1..8529a57802 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md @@ -46,7 +46,7 @@ private void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChange {% endhighlight %} {% endtabs %} -**Note:** The `OldValue` and `NewValue` types vary by field type. For a checkbox, cast them to `bool` to read the checked state. For a combo box or radio button, cast them to `string`. +N> The `OldValue` and `NewValue` types vary by field type. For a checkbox, cast them to `bool` to read the checked state. For a combo box or radio button, cast them to `string`. ## Detect focus changes From c46979b6c0e35be7e5db292644bd892b32c849e2 Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:49:41 +0530 Subject: [PATCH 032/127] Update Form-Filling-Import-Export.md to remove code details Removed code snippet and related information about namespaces and package requirements for form data import and export in .NET MAUI PDF Viewer. --- .../PDF-Viewer/maui/Form-Filling-Import-Export.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md index d0baac1db6..4a7fd81903 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md @@ -12,18 +12,6 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to import form data into a PDF document and export filled form data from it. This is useful for pre-populating forms, backing up responses, or transferring data between systems. -To work with form data import and export in code, ensure the following namespaces are imported in your C# file: - -{% tabs %} -{% highlight c# %} -using Syncfusion.Maui.PdfViewer; -using Syncfusion.Pdf.Parsing; -using System.IO; -{% endhighlight %} -{% endtabs %} - -The `DataFormat` enumeration used for import and export is part of the `Syncfusion.Pdf.NET` package. Ensure this package is installed alongside `Syncfusion.Maui.PdfViewer`. - ## Supported data formats The following formats are supported for both import and export: From 71263a101b53f6edff508d84d55c7c98c6e892b5 Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:50:37 +0530 Subject: [PATCH 033/127] Fix note formatting in Form-Filling-Import-Export.md Corrected formatting note regarding XFDF, FDF, JSON, and XML. --- .../PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md index 4a7fd81903..035ac03149 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md @@ -25,7 +25,7 @@ The following formats are supported for both import and export: The required format can be selected from the [DataFormat](https://help.syncfusion.com/cr/maui/Syncfusion.Pdf.Parsing.DataFormat.html) enumeration. -**Note:** XFDF and FDF are standard formats compatible with global PDF viewers. JSON and XML are Syncfusion-specific formats for cross-platform use within Syncfusion products only. +N> XFDF and FDF are standard formats compatible with global PDF viewers. JSON and XML are Syncfusion-specific formats for cross-platform use within Syncfusion products only. ## Import form data From 913a2850b3408964f5b2c8e82fca54e37768d146 Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:52:43 +0530 Subject: [PATCH 034/127] Update Form-Filling-Overview.md to remove code snippet Removed code snippet for importing namespace in C#. --- .../PDF/PDF-Viewer/maui/Form-Filling-Overview.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md index 3519b2abef..b495b3ea1b 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md @@ -14,14 +14,6 @@ The .NET MAUI PDF Viewer [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncf 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. For saving filled forms, see [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document). -To work with form fields in code, ensure the following namespace is imported in your C# file: - -{% tabs %} -{% highlight c# %} -using Syncfusion.Maui.PdfViewer; -{% endhighlight %} -{% endtabs %} - ## Supported form field types | Field Type | Description | @@ -67,4 +59,4 @@ Refer to [Handling document load failures](https://help.syncfusion.com/document- ## See Also - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) - [Electronic Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) -- [Document Load Notifications](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/documentloadnotifications) \ No newline at end of file +- [Document Load Notifications](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/documentloadnotifications) From 400c208b889a8d1cccf95199473d2acc44f03255 Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:53:18 +0530 Subject: [PATCH 035/127] Update Free Text annotations documentation Removed code snippet for importing namespaces in Free Text annotations section. --- Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md index 44f53e9a1b..1ace96104b 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md @@ -12,15 +12,6 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify free text annotations in the PDF document. This is useful for adding text notes, comments, or feedback to the PDF pages. This section explains the functions available in the PDF Viewer for working with free text annotations. -To work with free text annotations in code, ensure the following namespaces are imported in your C# file: - -{% tabs %} -{% highlight c# %} -using Syncfusion.Maui.PdfViewer; -using Microsoft.Maui.Graphics; -{% endhighlight %} -{% endtabs %} - ## Add free text annotations This section explains how to add free text annotations to a PDF page using the built-in toolbar as well as programmatically. From 9153f1d8fb78844c56eb428069e54986e9e1d70c Mon Sep 17 00:00:00 2001 From: KSilambharasanSF4548 <166014892+KSilambharasanSF4548@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:57:22 +0530 Subject: [PATCH 036/127] Fix formatting in Free-Text.md note section --- Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md index 1ace96104b..eff456741b 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md @@ -247,7 +247,7 @@ private void customDialogOkButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} -**Note:** For WinUI and MacCatalyst platforms, there is no separate modal view to receive text input from the users. As a result, the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) and [FreeTextModalViewDisappearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewDisappearing) events are not applicable for these platforms. +N> For WinUI and MacCatalyst platforms, there is no separate modal view to receive text input from the users. As a result, the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) and [FreeTextModalViewDisappearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewDisappearing) events are not applicable for these platforms. ## See Also From f5d8cd48afd45058b5e8aa39c9521d5f6a80646f Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Fri, 10 Jul 2026 17:24:17 +0530 Subject: [PATCH 037/127] Addressed all feedbacks --- .../maui/Form-Filling-Import-Export.md | 23 ++-- .../PDF/PDF-Viewer/maui/Redaction.md | 107 +++++++++--------- 2 files changed, 63 insertions(+), 67 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md index 035ac03149..86ce0c2546 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md @@ -69,25 +69,22 @@ First, wire the `DocumentLoaded` event after loading the document: {% tabs %} {% highlight c# %} -// Load the PDF document and add the viewer to the visual tree. + +SfPdfViewer PdfViewer = new SfPdfViewer(); PdfViewer.LoadDocumentAsync(PdfStream); -myGrid.Children.Add(PdfViewer); -// Subscribe to the DocumentLoaded event to export once the document is fully loaded. +// 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; -{% endhighlight %} -{% endtabs %} -Then, handle the event and export the form data: - -{% tabs %} -{% highlight c# %} -private void PdfViewer_DocumentLoaded(object sender, EventArgs e) +private void PdfViewer_DocumentLoaded(object? sender, EventArgs? e) { - string fileName = Path.Combine(FileSystem.Current.AppDataDirectory, "SavedForm.xfdf"); - using (var fileStream = File.Create(fileName)) + using (var fileStream = File.Create("D://SavedForm.json")) { - PdfViewer.ExportFormData(fileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf); + if(sender is SfPdfViewer pdfViewer) + pdfViewer.ExportFormData(fileStream, Syncfusion.Pdf.Parsing.DataFormat.Json); } } {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md b/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md index 6ebe255cdd..c3fb16a8c0 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md @@ -12,38 +12,22 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne Before sharing a PDF externally, use redaction to permanently remove sensitive data — such as personal details, financial figures, or confidential text — from the document. Unlike simply covering content with a shape or annotation, redaction in [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) eliminates the underlying content entirely once the document is saved, making recovery impossible. -## Types of redactions +## Types of Redactions The PDF Viewer provides multiple methods to apply redaction, allowing you to securely conceal sensitive content based on different requirements. The available redaction types include: -- **Text-based redaction**: Allows you to manually select the texts on a page and apply redaction to hide the texts. -- **Selected area redaction**: Allows you to manually select a rectangular area on a page and apply redaction to hide any content within that region. -- **Page-based redaction**: Enables you to redact entire pages of a PDF document, ensuring that all content on those pages is permanently removed. +- **Text-based Redaction** : Allows you to manually select the texts on a page and apply redaction to hide the texts. +- **Selected Area Redaction** : Allows you to manually select a rectangular area on a page and apply redaction to hide any content within that region. +- **Page-based Redaction** : Enables you to redact entire pages of a PDF document, ensuring that all content on those pages is permanently removed. -Text-based and selected-area redactions can be performed either with the built-in toolbar or with UI interaction using the `RedactionMode` property. Page-based redaction is available only programmatically via the `AddPageRedactionMarks` method. -## Customize the default redaction appearance - -In redaction mode, the redaction is applied with a default appearance and behavior. You can modify these settings before marking regions on the pages. To define the appearance and behavior, customize the default settings using the [RedactionSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). -The following example demonstrates how to obtain the default redaction settings and modify their appearance properties. Similarly, you can modify other available properties. +## Mark region to redact -{% tabs %} -{% highlight c# %} -void CustomizeDefaultRedactionSettings() -{ - // Access the default redaction settings from the SfPdfViewer instance and modify the default appearance properties. - PdfViewer.RedactionSettings.MarkerBorderColor = Colors.Blue; // Border color for the marked region. - PdfViewer.RedactionSettings.FillColor = Colors.Red; // Fill color after redaction is applied. - PdfViewer.RedactionSettings.FontColor = Colors.Black; // Font color for overlay text. - PdfViewer.RedactionSettings.OverlayText = "text"; // Text to display on the redacted area. - PdfViewer.RedactionSettings.IsRepeat = true; // Repeat overlay text across the redacted area. -} -{% endhighlight %} -{% endtabs %} +You need to mark the region for redaction by using one of the available methods such as text-based, selected-area or page-based redaction. -## Mark regions for redaction using the built-in toolbar +## Mark regions for redaction using toolbar -You need to mark the region for redaction by using one of the available methods such as text-based, selected-area, or page-based redaction. The built-in toolbar includes a redaction tool that allows you to redact text, specific areas, or entire pages by marking the desired region on the PDF document and clicking the Apply button. The toolbar also provides options to modify redaction properties, such as the color and the text to display in the redacted area. +The built-in toolbar includes a redaction tool that allows you to redact text, specific areas, or entire pages by marking the desired region on the PDF document and clicking the Apply button. The toolbar also provides options to modify redaction properties, such as the color and the text to display in the redacted area. The following image represents how to perform redactions using the toolbar on the desktop. @@ -55,14 +39,14 @@ The following image represents how to perform redactions using the toolbar on mo ## Mark regions for redaction without using the toolbar -You can mark the region for redaction in a PDF document with UI interaction (touch or mouse) by setting the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to mark the region on a PDF. +You can mark the region for redaction in a PDF document with UI interaction using touch or mouse using the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to mark the region on a PDF. -1. Set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to Text or Rect. It activates the text-based or selected-area redaction mode on the control. -2. Place your finger (or mouse) over the text in the PDF document where you want to start redaction. +1. Set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to Text or Rect. It activates the text-based or selected-area Redaction mode on the control. +2. Place your finger (or mouse) on the text in the PDF document, where you want to start redaction. 3. Drag the finger (or cursor) across the text to select. 4. Complete adding the region to the selected text or area by releasing the finger (or cursor). -5. Once you have finished marking regions, set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) to None. It will disable the redaction mode. The marked regions will be retained for redaction. -6. You can later redact the marked regions using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method. +5. Once you have done that, set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) to None. It will disable the redaction mode and save the marked region for redaction. +6. You can later redact the marked regions using [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method. The following code explains how to enable the text-based redaction mode. @@ -99,7 +83,7 @@ void DisableRedactionMode() ## How to perform redaction programmatically -### Add a redaction mark to the PDF +### Add redaction mark on the PDF You can mark regions for text or specific areas programmatically using the [AddRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), and redact entire pages using the [AddPageRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddPageRedactionMarks_System_Collections_Generic_List_System_Int32__) method. The following example demonstrates how to mark regions for redaction, such as a specific area and page in the PDF document. @@ -118,31 +102,17 @@ void AddRedactionMarkOnSpecificRegionAndPages() PdfViewer.AddRedactionMark(redactionMark); // Add redaction marks to specific pages (pages 3, 5, and 1). - PdfViewer.AddPageRedactionMarks(new List { 3, 5, 1 }); + PdfViewer.AddPageRedactionMarks(new List([3, 5, 1])); } {% endhighlight %} {% endtabs %} -### Redact the marked region - -After marking the regions, you can redact them by using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This method redacts all marked regions and saves the document, making the changes irreversible. The following example demonstrates how to redact a marked region or page in a PDF document. - -{% tabs %} -{% highlight c# %} -private async void RedactMarkedRegion() -{ - // Apply redaction to all marked regions in the PDF document. - await PdfViewer.RedactAsync(); -} -{% endhighlight %} -{% endtabs %} - -### Remove the selected redaction mark +### Remove the selected redaction mark on the PDF -You can remove a redaction mark for text, a specific area, or a page programmatically using the [SelectedRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectedRedactionMark) property and the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of the SfPdfViewer. To remove a redaction mark, select the specific mark you want to delete and pass it to the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method. The following example demonstrates how to remove a selected redaction mark from the PDF document. +You can remove a redaction mark for text, a specific area, or a page programmatically using the [SelectedRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectedRedactionMark) property and the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of SfPdfViewer. To remove a redaction mark, select the specific mark you want to delete and pass it to the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method. The following example demonstrates how to remove a selected redaction mark from the PDF document. {% tabs %} -{% highlight c# %} +{% highlight C# %} void RemoveSelectedRedactionMark() { // Check if any redaction mark is currently selected. @@ -155,12 +125,12 @@ void RemoveSelectedRedactionMark() {% endhighlight %} {% endtabs %} -### Remove all redaction marks +### Remove all the redaction marks in the PDF You can remove all redaction marks from a document programmatically by calling the [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method. The following example demonstrates how to remove all redaction marks from a PDF document. {% tabs %} -{% highlight c# %} +{% highlight C# %} void RemoveAllRedactionMarksDrawn() { // Removes all the redaction marks from a PDF document using [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). @@ -169,12 +139,41 @@ void RemoveAllRedactionMarksDrawn() {% endhighlight %} {% endtabs %} -## See Also +### Redact the marked region +You can redact the marked regions by using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This method redacts all marked regions and saves the document, making the changes irreversible. The following example demonstrates how to redact a marked region or page in a PDF document. + +{% tabs %} +{% highlight C# %} +private async void RedactMarkedRegion() +{ + // Apply redaction to all marked regions in the PDF document. + await PdfViewer.RedactAsync(); +} +{% endhighlight %} +{% endtabs %} + +## Customize the default redaction appearance + +In redaction mode, the redaction is applied with a default appearance and behavior. You can modify these settings before marking regions on the pages. To define the appearance and behavior, customize the default settings using the [RedactionSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +The following example demonstrates how to obtain the default redaction settings and modify their appearance properties. Similarly, you can modify other available properties. + +{% tabs %} +{% highlight C# %} +void CustomizeDefaultRedactionSettings() +{ + // Access the default redaction settings from the SfPdfViewer instance and modify the default appearance properties. + PdfViewer.RedactionSettings.MarkerBorderColor = Colors.Blue; // Border color for the marked region. + PdfViewer.RedactionSettings.FillColor = Colors.Red; // Fill color after redaction is applied. + PdfViewer.RedactionSettings.FontColor = Colors.Black; // Font color for overlay text. + PdfViewer.RedactionSettings.OverlayText = "text"; // Text to display on the redacted area. + PdfViewer.RedactionSettings.IsRepeat = true; // Repeat overlay text across the redacted area. +} +{% endhighlight %} +{% endtabs %} + +## See Also - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) - [Text Search](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-search) - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) - [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) -- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) -- [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) -- [Print a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/print-a-document) From 184f7f007f7b3fb833589dffd9c00c21d9ad508d Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Fri, 10 Jul 2026 17:24:51 +0530 Subject: [PATCH 038/127] Addressed feedbacks --- Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md b/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md index 6cdc2dd2df..29274fba30 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md @@ -117,7 +117,7 @@ private void PdfViewer_PropertyChanged(object sender, On Android and iOS platforms, the scroll head offers a quick way to move through pages. Users can drag the thumb indicator to scroll within the PDF document. -![Scroll head](Images/ScrollHead.png) +![Scroll head](Images\ScrollHead.png) ### Show or Hide the Scroll Head From 389ded3272600c83728cafc6956f05259f6a2052 Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Mon, 13 Jul 2026 11:18:33 +0530 Subject: [PATCH 039/127] =?UTF-8?q?Task(1040469):=20Need=20to=20improve=20?= =?UTF-8?q?UG=20documentation=20for=20UWP=20PDFViewer=20usi=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bookmark-navigation.md | 10 +++-- .../Creating-custom-toolbar.md | 16 +++---- .../uwp/Concepts-and-Features/Hyperlink.md | 39 ++++++++-------- .../uwp/Concepts-and-Features/Printing-PDF.md | 44 ++++++++++--------- .../Working-with-annotations.md | 14 +++--- .../Working-with-text-search.md | 26 ++++++----- .../PDF/PDF-Viewer/uwp/Getting-Started.md | 33 ++++++++------ .../uwp/How-to/Customize-the-scrollbar.md | 14 +++--- .../PDF/PDF-Viewer/uwp/Overview.md | 2 +- 9 files changed, 106 insertions(+), 92 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Bookmark-navigation.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Bookmark-navigation.md index eb2d22607a..175ecd81c2 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Bookmark-navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Bookmark-navigation.md @@ -7,9 +7,9 @@ control: SfPdfViewerControl documentation: ug --- -# Bookmark navigation in UWP PDF Viewer (SfPdfViewer) +# Bookmark Navigation in UWP PDF Viewer (SfPdfViewer) -PDF Viewer allows users to navigate to the bookmarks present in the loaded PDF document. +The SfPdfViewer control allows users to navigate to the bookmarks present in the loaded PDF document. This section covers programmatic navigation using the `GoToBookmark` method. ## Programmatically navigate to a bookmark destination @@ -24,13 +24,15 @@ PdfLoadedDocument loadedDocument = new PdfLoadedDocument(documentStream); //Retrieves the bookmark collection from the loaded PDF document PdfBookmarkBase bookmark = loadedDocument.Bookmarks; -//Navigate to the specified bookmark destination offset +//Navigates to the specified bookmark destination pdfViewerControl.GoToBookmark(bookmark[0]); {% endhighlight %} {% endtabs %} ## See Also +- [UWP PDF Viewer Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/overview) - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-page-navigation) - [Hyperlink](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/hyperlink) -- [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) \ No newline at end of file +- [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) +- [GoToBookmark API Reference](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Creating-custom-toolbar.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Creating-custom-toolbar.md index 5ea10fee45..82400b464c 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Creating-custom-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Creating-custom-toolbar.md @@ -9,33 +9,33 @@ documentation: ug # Creating a custom toolbar in UWP PDF Viewer (SfPdfViewer) -PdfViewer does not have a toolbar by default. But a custom toolbar can be designed at the sample with its buttons wired to the PdfViewer APIs. +The SfPdfViewer control does not include a built-in toolbar by default; however, a custom toolbar can be designed at the application level, with its buttons wired to the SfPdfViewer APIs. ## Creating separate UIs for desktop and mobile -Create a new UWP project (the name "PdfViewerCustomToolbar" is used here). It will by default have a MainPage.xaml file, a MainPage.xaml.cs file. Create a new folder in the project with name "DeviceFamily-Mobile" and create another XAML file with the same name MainPage.xaml in this folder. Open this file and set the class property to MainPage.xaml.cs. +Create a new UWP project (the name "PdfViewerCustomToolbar" is used here). By default, the project will contain a `MainPage.xaml` file and a `MainPage.xaml.cs` code-behind file. Create a new folder in the project with the name "DeviceFamily-Mobile", and create another XAML file named `MainPage.xaml` in this folder. Open this file and set the `x:Class` attribute to `MainPage.xaml.cs`. {% tabs %} {% highlight xaml %} -x:Class="PdfViewerCustomToolbar.MainPage"; +x:Class="PdfViewerCustomToolbar.MainPage" {% endhighlight %} {% endtabs %} -Make sure that both the xaml files are in the same namespace "PdfViewerCustomToolbar" +Make sure that both XAML files are in the same namespace, "PdfViewerCustomToolbar". {%tabs%} {%highlight xaml%} -xmlns:local="using:PdfViewerCustomToolbar"; +xmlns:local="using:PdfViewerCustomToolbar" {%endhighlight%} {%endtabs%} -The reason for two XAML files is that same UI design cannot be used for both desktop and mobile. So, one XAML file is used for desktop UI and the other is for mobile UI. The MainPage.xaml.cs file serve as the common code behind for both XAML pages. +Two XAML files are used because the same UI design cannot be shared between desktop and mobile. One XAML file is used for the desktop UI, while the other is used for the mobile UI. The `MainPage.xaml.cs` file serves as the common code-behind for both XAML pages. -In the constructor of MainPage set the DataContext to PdfViewer. +In the constructor of `MainPage`, set the `DataContext` to the SfPdfViewer instance. {%tabs%} {%highlight c#%} @@ -45,7 +45,7 @@ this.DataContext = pdfViewer; {%endhighlight%} {%endtabs%} -The UI design of the application for desktop and mobile is illustrated in the following documentation pages. The link to the common sample can be found at the ends of both the documentation pages. +The UI design of the application for desktop and mobile is illustrated in the following documentation pages. The link to the common sample can be found at the end of each documentation page. 1. [Desktop design](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/ui-design-for-desktop) 2. [Mobile design](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/ui-design-for-mobile) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md index a1d72a5939..475ef823ae 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md @@ -9,15 +9,15 @@ documentation: ug # Hyperlink in UWP PDF Viewer (SfPdfViewer) -PDF Viewer supports hyperlink navigation which detects document link and web link present in the pages of the PDF document. Tapping on the TOC and hyperlink will behave in the following manner. +The PdfViewer control supports hyperlink navigation that detects document links and web links present in the PDF document pages. Tapping a table of contents (TOC) entry or hyperlink behaves as follows: -1) If the tapped text contains web link, then the URI associated with the hyperlink will be opened in the default browser. +1) If the tapped text contains a web link, the URI associated with the hyperlink is opened in the default browser. -2) If the tapped text contains document link, then the PDF Viewer navigates to the destination page index which is associated with it. +2) If the tapped text contains a document link, the PDF Viewer navigates to the associated destination page index. ## How to disable hyperlink navigation in PDF document using PDF Viewer control? -You can disable the hyperlink navigation by setting the “AllowHyperlinkNavigation” property of PDF Viewer to false. By default, hyperlink navigation will be enabled in PDF Viewer. +You can disable hyperlink navigation by setting the `AllowHyperlinkNavigation` property of the PDF Viewer to `false`. By default, hyperlink navigation is enabled in the PDF Viewer. {% tabs %} {% highlight xaml %} @@ -29,7 +29,7 @@ You can disable the hyperlink navigation by setting the “AllowHyperlinkNavigat ## How to acquire the properties of clicked URI from PDF Viewer? -You can acquire the details of the hyperlink that is tapped in the PDF Viewer control from the HyperlinkEventArgs of HyperlinkPointerPressed event. Refer to the following code example for more details. +You can acquire the details of the hyperlink that is tapped in the PDF Viewer control from the `HyperlinkEventArgs` of the `HyperlinkPointerPressed` event. Refer to the following code example for more details. {% tabs %} {% highlight xaml %} @@ -44,7 +44,7 @@ You can acquire the details of the hyperlink that is tapped in the PDF Viewer co public void pdfViewerControl_HyperlinkPointerPressed(object sender,HyperlinkEventArgs args) { - // Gets or sets a value indicating whether the hyperlink navigation was handled. + // Gets or sets a value indicating whether the hyperlink navigation was handled. args.Handled = false; // Gets the hyperlink being clicked. @@ -53,15 +53,14 @@ You can acquire the details of the hyperlink that is tapped in the PDF Viewer co // Gets the current page index of the hyperlink. int pageIndex = args.PageIndex; - //Gets the destination page index of the hyperlink. + // Gets the destination page index of the hyperlink. int destinationPageIndex = args.DestinationPageIndex; - //Gets the bounds of the hyperlink is being clicked. + // Gets the bounds of the hyperlink being clicked. RectangleF hyperlinkBound = args.Bounds; - //Gets the whether the tapped hyper link is a Web Link or Document Link. - HyperlinkType linkType = args.HyperlinkType - + // Gets whether the tapped hyperlink is a Web Link or Document Link. + HyperlinkType linkType = args.HyperlinkType; } @@ -70,7 +69,7 @@ You can acquire the details of the hyperlink that is tapped in the PDF Viewer co ## How to detect whether the mouse pointer is over the hyperlink text? -The event `HyperlinkPointerMoved` will be raised when the mouse pointer is moved over the hyperlink text. Refer to the following code example for more details. +The `HyperlinkPointerMoved` event is raised when the mouse pointer is moved over the hyperlink text. Refer to the following code example for more details. {% tabs %} {% highlight xaml %} @@ -85,19 +84,19 @@ The event `HyperlinkPointerMoved` will be raised when the mouse pointer is moved public void pdfViewerControl_HyperlinkPointerMoved(object sender,HyperlinkEventArgs args) { - // Gets or sets a value indicating whether the hyperlink navigation was handled. + // Gets or sets a value indicating whether the hyperlink navigation was handled. args.Handled = false; - // Gets the hyperlink being clicked. + // Gets the hyperlink under the pointer. string uri = args.URI; // Gets the current page index of the hyperlink. int pageIndex = args.PageIndex; - //Gets the destination page index of the hyperlink. + // Gets the destination page index of the hyperlink. int destinationPageIndex = args.DestinationPageIndex; - //Gets the bounds of the hyperlink is being clicked. + // Gets the bounds of the hyperlink under the pointer. RectangleF hyperlinkBound = args.Bounds; //Gets the whether the tapped hyper link is a Web Link or Document Link. @@ -110,21 +109,21 @@ The event `HyperlinkPointerMoved` will be raised when the mouse pointer is moved ## How to restrict the URI navigation from the PDF Viewer? -By default, web link or document link navigation is performed on tapping the hyperlink text. This navigation can be restricted using the property 'Handled' of the `HyperlinkEventArgs`. Refer to the following code snippet for more details. +By default, web link or document link navigation is performed on tapping the hyperlink text. This navigation can be restricted using the `Handled` property of the `HyperlinkEventArgs`. Refer to the following code snippet for more details. {% tabs %} {% highlight c# %} public void pdfViewerControl_HyperlinkPointerPressed(object sender,HyperlinkEventArgs args) { - // Setting the property to true will restrict the URI navigation inside the PDF Viewer control. In default, the value is false. - args.Handled = false; + // Setting the property to true will restrict the URI navigation inside the PDF Viewer control. By default, the value is false. + args.Handled = true; } {% endhighlight %} {% endtabs %} ## See Also -- [Bookmark](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/bookmark-navigation) +- [Bookmark Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/bookmark-navigation) - [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-page-navigation) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Printing-PDF.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Printing-PDF.md index 718243b1a3..5bb717e661 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Printing-PDF.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Printing-PDF.md @@ -9,9 +9,9 @@ documentation: ug # Printing PDF in UWP PDF Viewer (SfPdfViewer) -Printing can be done using the Print method or by using the Print command. +Printing can be done using the `Print` method or by using the `PrintCommand`. This section covers synchronous printing, asynchronous printing with cancellation, exception handling, quality factor configuration, and print preview customization. -The following code shows how to perform the print operation using Print method. Here 'buffer' is the byte array read from the PDF file either using FileOpenPicker or from Assets folder, as illustrated in the [Viewing PDF](https://help.syncfusion.com/uwp/pdf-viewer/concepts-and-features/viewing-pdf) section. +The following code shows how to perform the print operation using the `Print` method. Here, `buffer` is the byte array read from the PDF file either using `FileOpenPicker` or from the Assets folder, as illustrated in the [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) section. {% tabs %} {% highlight c# %} @@ -40,7 +40,7 @@ End Sub {% endhighlight %} {% endtabs %} -The following code shows how to bind the PrintCommand to a Button +The following code shows how to bind the `PrintCommand` to a Button. {% tabs %} {% highlight xaml %} @@ -58,17 +58,17 @@ The PDF Viewer allows you to print the PDF document asynchronously using the `Pr {% tabs %} {% highlight c# %} -//Asynchronously prints the document loaded in the PDF viewer +// Asynchronously prints the document loaded in the PDF viewer. pdfViewer.PrintAsync(cancellationTokenSource); {% endhighlight %} {% endtabs %} -In the above code sample, the `cancellationTokenSource` enables you to cancel the asynchronous printing when it is in progress +In the above code sample, the `cancellationTokenSource` enables you to cancel the asynchronous printing when it is in progress. ### Cancel the asynchronous PDF printing -You can raise the cancel request when printing is in progress +You can raise the cancel request when printing is in progress. {% tabs %} {% highlight c# %} @@ -81,13 +81,13 @@ private void cancelButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} - In the above code sample, the cancellationTokenSource instance is the same as the one given as the argument when printing the PDF document asynchronously. + In the above code sample, the `cancellationTokenSource` instance is the same as the one given as the argument when printing the PDF document asynchronously. - N> Calling the above method will not have any effect once the printing is complete. It will stop the printing process only when it is in progress. + N> Calling this method has no effect once printing is complete. It stops the printing process only when it is in progress. ### Handling exceptions while performing the asynchronous print -When the `PrintAsync` is called, the PDF Viewer will show the print previewer. Exceptions will be thrown if the print cannot be performed. The exceptions will be propagated back to the caller of this method. We recommend catching these exceptions as follows. +When the `PrintAsync` method is called, the PDF Viewer will show the print previewer. Exceptions will be thrown if the print cannot be performed. The exceptions will be propagated back to the caller of this method. Catch these exceptions as follows. {% tabs %} {% highlight c# %} @@ -97,13 +97,13 @@ When the `PrintAsync` is called, the PDF Viewer will show the print previewer. E try { - //Sets the name of the printed document. - pdfViewer.PrinterSettings.DocumentName = “PdfFileName.pdf”; + // Sets the name of the printed document. + pdfViewer.PrinterSettings.DocumentName = "PdfFileName.pdf"; - //Asynchronously prints the document loaded in the PDF viewer - await pdfViewerControl.PrintAsync(cancellationToken); + // Asynchronously prints the document loaded in the PDF viewer. + await pdfViewer.PrintAsync(cancellationToken); } - catch (Exception e) + catch (Exception ex) { ContentDialog printErrorDialog = new ContentDialog() { @@ -126,23 +126,25 @@ N> The [`SfPdfViewer`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.Pdf The PDF Viewer allows the user to set and retrieve the quality factor for print by using the [`QualityFactor`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.PrinterSettings.html#Syncfusion_Windows_PdfViewer_PrinterSettings_QualityFactor) property. The default value of this API is set to 1, and the values are restricted between 1 and 5. The values falling below the range are taken as 1, which represents the lowest page quality, and those above the range are taken as 5, which represents the highest page quality. Refer to the following code sample to set the quality factor for the print. +{% tabs %} {% highlight c# %} -//Sets the quality factor for the print. +// Sets the quality factor for the print. pdfViewer.PrinterSettings.QualityFactor = 2; {% endhighlight %} +{% endtabs %} N> Printing with quality factors higher than 2 will work as expected in the x64 configuration but may cause `System.OutOfMemoryException` in the x86 configuration due to the limited memory capacity of this architecture. ## Customizing the print previewer -You can customize the print options displayed in the print previewer while performing a print operation in the PDF Viewer control. The event `PrintTaskRequested` will be raised when you call the Print method to print a PDF document. +You can customize the print options displayed in the print previewer while performing a print operation in the PDF Viewer control. The `PrintTaskRequested` event will be raised when you call the `Print` method to print a PDF document. {% tabs %} {% highlight c# %} -//Wire up the PrintTaskRequested event with the PdfViewer_PrintTaskRequested +// Wire up the PrintTaskRequested event with the PdfViewer_PrintTaskRequested. pdfViewer.PrintTaskRequested += PdfViewer_PrintTaskRequested; {% endhighlight %} @@ -157,20 +159,20 @@ private void PdfViewer_PrintTaskRequested(object sender, SfPdfViewerPrintTaskReq { PrintTask printTask = null; - //Create a print task to customize the print options + // Create a print task to customize the print options. printTask = e.Request.CreatePrintTask("Printing", sourceRequested => { PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(printTask.Options); IList displayedOptions = printDetailedOptions.DisplayedOptions; - //Allows to add the required print options + // Allows adding the required print options. displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.CustomPageRanges); printTask.Options.PageRangeOptions.AllowCurrentPage = true; printTask.Options.PageRangeOptions.AllowAllPages = true; printTask.Options.PageRangeOptions.AllowCustomSetOfPages = true; - // Set the pdfViewerControl�s print document source + // Sets the pdfViewerControl's print document source. sourceRequested.SetSource(e.PrintDocumentSource); e.PrintTask = printTask; @@ -204,7 +206,7 @@ pdfViewerControl.PrintTaskRequested+= PrintTaskRequested; {% endhighlight %} {% endtabs %} -N>Though if you specify any print options to be displayed, only those that are supported by the selected printer are shown in the print preview UI. The print UI won't show options that the selected printer doesn't support. The print options will appear in the order in which they are added. +N> Even if you specify print options to be displayed, only those supported by the selected printer are shown in the print preview UI. The print UI will not show options that the selected printer does not support. Print options will appear in the order in which they are added. ## See Also - [Export Pages](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/exporting-pages-as-image) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-annotations.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-annotations.md index 3174881c70..92d7ef69c0 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-annotations.md @@ -7,7 +7,7 @@ control: PDF viewer documentation: ug --- -# Working with annotations in UWP PDF Viewer +# Working with Annotations in UWP PDF Viewer PDF Viewer allows user to include annotations in PDF files and provides options to modify or remove the existing annotations. The supported annotations are below. @@ -32,9 +32,9 @@ PDF viewer provides the following events. 5. AnnotationRemoved 6. AnnotationMovedOrResized -The properties of the annotation involved in the event can be obtained from the `AnnotationProperties` property of the event args parameter of each event except AnnotationMovedOrResized. Since the annotation properties are obtained from the same `AnnotationProperties` instance for all events except AnnotationMovedOrResized, only the AnnotationAdded event is illustrated below. +The properties of the annotation involved in an event can be obtained from the `AnnotationProperties` property of the event args parameter. This pattern is shared by all events except `AnnotationMovedOrResized`, so only the `AnnotationAdded` event is illustrated below. -The properties of the included annotation can be obtained by casting the `AnnotationAddedEventArgs` parameter's AnnotationProperties property to the property of corresponding annotation type. +To obtain properties for a specific annotation type, cast `AnnotationProperties` to the corresponding type (for example, `TextMarkupProperties`). {% highlight c# %} @@ -93,7 +93,7 @@ private void PdfViewer_AnnotationAdded(object sender, AnnotationMovedOrResizedEv ## Enable and disable selection of annotations -By default, PdfViewer allows the user to select the annotations by tapping on it, this action is followed by the appearance of the selector around the selected annotation. The selection of annotations can be disabled by setting `IsReadOnly` property of `AnnotationSettings` class to true. The default value of this API will be false. +By default, the SfPdfViewer control allows users to select annotations by tapping on them, and a selector appears around the selected annotation. The selection of annotations can be disabled by setting the `IsReadOnly` property of the `AnnotationSettings` class to `true`. The default value of this property is `false`. {% highlight c# %} @@ -128,7 +128,7 @@ The PDF viewer supports removing a single annotation and all the annotations in ### Remove a selected annotation -The following code snippet illustrates removing a selected annotation from the PDF document. +The following code snippet removes a selected annotation from the PDF document. {% tabs %} {% highlight xaml %} @@ -158,7 +158,7 @@ private void deleteAnnotationButton_clicked(object sender, RoutedEventArgs e) ### Remove all annotations -The following code snippet illustrates removing all annotations from the PDF. +The following code snippet removes all annotations from the PDF. {% highlight c# %} @@ -179,7 +179,7 @@ var annotations = pdfViewer.AnnotationCollection; ## How to show or hide the annotations present in the PDF? -Use the [`AnnotationVisibility`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_AnnotationVisibility) property to change the visibility of the annotations present in a PDF document. By default, the visibility of the annotation is `Visibility.Visible`. +Use the [`AnnotationVisibility`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_AnnotationVisibility) property to change the visibility of the annotations present in a PDF document. By default, the visibility of annotations is `Visibility.Visible`. {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-text-search.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-text-search.md index d1add11d73..cf7e7bf768 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-text-search.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-text-search.md @@ -13,7 +13,7 @@ Text search can be done in two ways, by using the SearchText method or by using In all code snippets found below, 'buffer' is the byte array read from the PDF file either using FileOpenPicker or from Assets folder, as illustrated in the [Viewing PDF](https://help.syncfusion.com/uwp/pdf-viewer/concepts-and-features/viewing-pdf) section. -**Using search methods** +## Using Search Methods The following code shows how to initiate the text search using the method. {% tabs %} @@ -26,7 +26,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchText("the"); } {% endhighlight %} @@ -53,7 +53,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchNextText("the"); } {% endhighlight %} @@ -80,7 +80,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchPrevText("the"); } {% endhighlight %} @@ -97,9 +97,9 @@ End Sub {% endhighlight %} {% endtabs %} -**Using search commands** +## Using Search Commands -The following code shows how to search for the next instance using SearchNextCommand. +The following code shows how to search for the next instance using `SearchNextCommand`. {% tabs %} {% highlight xaml %} @@ -109,17 +109,19 @@ The following code shows how to search for the next instance using SearchNextCom {% endhighlight %} {% endtabs %} -The following code shows how to search for the previous instance using SearchPreviousCommand. + +The following code shows how to search for the previous instance using `SearchPreviousCommand`. + {% tabs %} {% highlight xaml %} - + {% endhighlight %} {% endtabs %} -**Using asynchronous search methods** +## Using Asynchronous Search Methods The PDF viewer allows the users to perform text search asynchronously using the [SearchTextAsync](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_SearchTextAsync_System_String_System_Threading_CancellationToken_) method. The user can also cancel the asynchronous text search when it is in progress. @@ -135,7 +137,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void SearchButton_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchTextAsync(targetText, cts.Token); } @@ -158,7 +160,7 @@ CancellationTokenSource cts = new CancellationTokenSource(); private void SearchNextButton_Click(object sender, RoutedEventArgs e) { - //Searches for the next text instance in the PDF Document. + // Searches for the next text instance in the PDF document. pdfViewer.SearchNextTextAsync(targetText, cts.Token); } @@ -179,7 +181,7 @@ CancellationTokenSource cts = new CancellationTokenSource(); private void SearchPreviousButton_Click(object sender, RoutedEventArgs e) { - //Searches for the previous instance of the text in the PDF Document. + // Searches for the previous instance of the text in the PDF document. pdfViewer.SearchPreviousTextAsync(targetText, cts.Token); } diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md index 8fc9a60c41..bc70d6b7cd 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md @@ -19,14 +19,14 @@ You can create a **UWP Application** using Visual Studio via [Microsoft Template ## Assemblies Deployment -You can add a UWP PdfViewer component to your application by installing it via NuGet packages (recommended) or by manually adding the required assemblies to the project. +You can add a UWP PDF Viewer component to your application by installing it via NuGet packages (recommended) or by manually adding the required assemblies to the project. {% tabcontents %} {% tabcontent NuGet Package %} -### Install Syncfusion® UWP PdfViewer NuGet Package +### Install Syncfusion® UWP PDF Viewer NuGet Package -To add **UWP PdfViewer** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: +To add the **UWP PDF Viewer** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: • [Syncfusion.SfPdfViewer.UWP](https://www.nuget.org/packages/Syncfusion.SfPdfViewer.UWP) @@ -34,9 +34,9 @@ To add **UWP PdfViewer** component in the application, open the NuGet package ma {% tabcontent Assemblies (.dll) %} -### Add Syncfusion® UWP PdfViewer Assemblies +### Add Syncfusion® UWP PDF Viewer Assemblies -Below table describes, list of assemblies required to be added in project when the UWP PdfViewer control is used in your application. +The following table lists the assemblies required when the UWP PDF Viewer control is used in your application. @@ -69,21 +69,25 @@ Below table describes, list of assemblies required to be added in project when t
-Each assembly must be placed together with its corresponding resource files (i.e., the resource files for an assembly should reside in the same folder as that assembly). The assemblies do not all have to be in a single folder — each assembly may live in its own folder so long as its resource files are kept alongside it. The screenshot shows only the SfPdfViewer assembly for brevity. +Each assembly must be placed together with its corresponding resource files; that is, the resource files for an assembly should reside in the same folder as that assembly. + +The assemblies do not all have to be in a single folder. Each assembly may live in its own folder, as long as its resource files are kept alongside it. The screenshot shows only the SfPdfViewer assembly for brevity. ![Dependent assemblies needed for SfPdfViewerControl](Getting-Started_images/Getting-Started_img3.jpeg) This co-location matters only if you move assemblies out of their installed location. If you relocate an assembly, be sure to move its resource files with it and place them in the same folder as that assembly. -N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your UWP application to use our components. - {% endtabcontent %} {% endtabcontents %} -## Add UWP PdfViewer component +## Licensing + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to register the Syncfusion® license key in your UWP application to use our components. + +## Add UWP PDF Viewer component -UWP PdfViewer control can be added to an application either through the designer (XAML) or programmatically using code. +UWP PDF Viewer control can be added to an application either through the designer (XAML) or programmatically using code. Use the **Via Designer** tab if you prefer a drag-and-drop workflow; use the **Via Coding** tab if you want to add the control directly in XAML or C#. {% tabcontents %} @@ -95,7 +99,7 @@ UWP PdfViewer control can be added to an application either through the designer ![SfPdfViewerControl in visual studio toolbox](Getting-Started_images/Getting-Started_img1.jpeg) -3. Drag `SfPdfViewerControl`(https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) and drop in to the Designer area from the Toolbox. +3. Drag the [`SfPdfViewerControl`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) and drop it into the Designer area from the Toolbox. When you drag the SfPdfViewerControl toolbox item to the window, it automatically adds the required assembly references to the current application. @@ -103,9 +107,9 @@ When you drag the SfPdfViewerControl toolbox item to the window, it automaticall {% tabcontent Via Coding %} -The SfPdfViewerControl is available in the following namespace [_Syncfusion.Windows.PdfViewer_](https://help.syncfusion.com/cr/UWP/Syncfusion.Windows.PdfViewer.html) and it can be created using XAML or programmatically using C#. +The SfPdfViewerControl is available in the [`Syncfusion.Windows.PdfViewer`](https://help.syncfusion.com/cr/UWP/Syncfusion.Windows.PdfViewer.html) namespace and can be created using XAML or programmatically using C#. -1. Add the Syncfusion PdfViewer namespace +1. Add the Syncfusion PDF Viewer namespace. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} xmlns:syncfusion="using:Syncfusion.Windows.PdfViewer" @@ -131,6 +135,7 @@ After adding the `SfPdfViewerControl`, you can load a PDF document using data bi 2. Create a simple class (`PdfReport.cs`) that provides the PDF stream. +N> Replace `PdfViewerExample` in the manifest resource path below with your project's default namespace. {% tabs %} {% highlight c# tabtitle="PdfReport.cs" %} @@ -245,4 +250,6 @@ Press Ctrl+F5 (Windows) or +F5 (m - [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) - [UWP PDF Viewer Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/overview) - [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-magnification) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-page-navigation) +- [Text Search](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-text-search) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md b/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md index 4dda7479f4..8350a61188 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md @@ -7,11 +7,13 @@ control: PDF viewer documentation: ug --- -# Customize the scrollbar in UWP PDF Viewer +# Customize the Scrollbar in UWP PDF Viewer + +This section explains how to customize the scrollbar appearance and width in the SfPdfViewer control. ## Customize the color of the scrollbar thumb -The PDF viewer uses the [ScrollViewer] (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-19041) control to scroll the pages of a PDF. The color of the vertical and horizontal scrollbar thumbs can be customized using the following code. +The PDF Viewer uses the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-19041) control to scroll the pages of a PDF. The color of the vertical and horizontal scrollbar thumbs can be customized using the following code. {% tabs %} {% highlight xaml %} @@ -28,14 +30,14 @@ The PDF viewer uses the [ScrollViewer] (https://docs.microsoft.com/en-us/uwp/api ## Customize the width of the vertical scrollbar -The width of the vertical scrollbar of the [ScrollViewer](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) can be modified by using the [VerticalScrollBarWidth](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_VerticalScrollBarWidth) property. The default value of the API is as same as the default width of the vertical scrollbar of the [ScrollViewer](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) control. +The width of the vertical scrollbar of the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) can be modified by using the [`VerticalScrollBarWidth`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_VerticalScrollBarWidth) property. The default value of this property matches the default width of the vertical scrollbar of the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) control. {% tabs %} {% highlight c# %} -//Sets the width of the vertical scrollbar in the PDF Viewer. -pdfViewerControl.VerticalScrollBarWidth = 100; -//Gets the width of the vertical scrollbar in the PDF Viewer. +// Sets the width of the vertical scrollbar in the PDF Viewer. +pdfViewerControl.VerticalScrollBarWidth = 100; +// Gets the width of the vertical scrollbar in the PDF Viewer. double verticalScrollBarWidth = pdfViewerControl.VerticalScrollBarWidth; {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md b/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md index 92c2810dcd..753e2303d6 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md @@ -9,7 +9,7 @@ documentation: ug # UWP PDF Viewer (SfPdfViewer) Overview -The [PDF viewer](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) for Universal Windows Platform is a native control for viewing and printing PDF documents. The control internally makes use of the Windows rendering engine (Windows.Data.Pdf) for rendering the pages of the PDF document. +The [PDF viewer](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) for Universal Windows Platform is a native control for viewing and printing PDF documents. The control uses the Windows rendering engine (`Windows.Data.Pdf`) to render the pages of the PDF document. ## In This Section From 56ba4ffbf9c95df9e3efa21b801d62616247977c Mon Sep 17 00:00:00 2001 From: Mugesh Date: Mon, 13 Jul 2026 17:20:21 +0530 Subject: [PATCH 040/127] Updated Documentation Licensing Page --- .../Licensing/how-to-generate.md | 11 +- .../licensing-faq/CI-license-validation.md | 118 +++++++++++------- 2 files changed, 84 insertions(+), 45 deletions(-) diff --git a/Document-Processing/Licensing/how-to-generate.md b/Document-Processing/Licensing/how-to-generate.md index 3ed184b9af..c7ac4764d9 100644 --- a/Document-Processing/Licensing/how-to-generate.md +++ b/Document-Processing/Licensing/how-to-generate.md @@ -13,8 +13,15 @@ License keys for Document Processing can be generated from the [License & Downlo ![Get License Key](licensing-images/generate-license.png) -I> * Syncfusion® license keys are **version and platform specific**, refer to the [KB](https://www.syncfusion.com/kb/8976/how-to-generate-license-key-for-licensed-products) to generate the license key for the required version and platform. -* Refer this [KB](https://www.syncfusion.com/kb/8951/which-version-syncfusion-license-key-should-i-use-in-my-application) to know about which version of the Syncfusion® license key should be used in the application. +I> * Syncfusion® license keys are **version‑specific and edition‑specific**, refer to the [KB](https://www.syncfusion.com/kb/8976/how-to-generate-license-key-for-licensed-products) to generate the license key for the required version and platform. +* **Starting from v31.1.17 (2025 Volume 3 release)**, Syncfusion® introduced a new licensing model where license keys are generated **per edition rather than per platform.** The editions include: + - **Essential Studio UI Edition** + - **Essential Studio Document SDK** + - **Essential Studio PDF Viewer SDK** + - **Essential Studio DOCX Editor SDK** + - **Essential Studio Spreadsheet Editor SDK** + - **Essential Studio Enterprise Edition** (includes all the above) +* **Previously (before v31.x)**, Syncfusion® generated license keys **per platform** (e.g., File Formats). ## Claim License key diff --git a/Document-Processing/Licensing/licensing-faq/CI-license-validation.md b/Document-Processing/Licensing/licensing-faq/CI-license-validation.md index f393b77a33..d81dba9fff 100644 --- a/Document-Processing/Licensing/licensing-faq/CI-license-validation.md +++ b/Document-Processing/Licensing/licensing-faq/CI-license-validation.md @@ -1,7 +1,7 @@ --- layout: post title: Overview of Syncfusion license validation in CI services - Syncfusion -description: Learn here about how to register Syncfusion license key for Syncfusion application for license validation. +description: Learn how to register and validate the Syncfusion license key for your application in CI services. platform: file-formats control: Essential Studio documentation: ug @@ -17,18 +17,27 @@ margin-top: 1.5em; margin-bottom: 1.5em; -# Syncfusion® license key validation in CI services +# Overview of Syncfusion license validation in CI services -Syncfusion® license key validation in CI services ensures that Syncfusion® Essential Studio components are properly licensed during CI processes. Validating the license key at the CI level can prevent licensing errors during deployment. Set up the continuous integration process to fail in case the license key validation fails. Validate the passed parameters and the registered license key again to resolve the issue. +Validating the Syncfusion® license key as part of your CI pipeline ensures that Syncfusion® Essential Studio components are properly licensed before deployment and helps prevent licensing errors in production. The following sections describe how to validate the license key in Azure Pipelines, GitHub Actions, and Jenkins, and how to validate it programmatically using the `ValidateLicense()` method or a unit test project. The following section shows how to validate the Syncfusion® license key in CI services. * Download and extract the LicenseKeyValidator.zip utility from the following link: [LicenseKeyValidator](https://s3.amazonaws.com/files2.syncfusion.com/Installs/LicenseKeyValidation/LicenseKeyValidator.zip). -* Open the LicenseKeyValidation.ps1 PowerShell script in a text\code editor as shown in the below example. +* Open the LicenseKeyValidation.ps1 PowerShell script in a text or code editor as shown in the following example. + {% tabs %} -{% highlight c# tabtitle="PowerShell" %} +{% highlight c# tabtitle="v34.1.29 and later" %} +# Replace the parameters with the desired platform, version, and actual license key. + +$result = & $PSScriptRoot"\LicenseKeyValidatorConsole.exe" /platform:"WordToPDF" /version:"34.1.29" /licensekey:"Your License Key" + +Write-Host $result +{% endhighlight %} + +{% highlight c# tabtitle="Before v34.1.29" %} # Replace the parameters with the desired platform, version, and actual license key. $result = & $PSScriptRoot"\LicenseKeyValidatorConsole.exe" /platform:"FileFormats" /version:"26.2.4" /licensekey:"Your License Key" @@ -37,28 +46,28 @@ Write-Host $result {% endhighlight %} {% endtabs %} -![LicenseKeyValidation script](licensing-images/license-validation.png) +* Update the parameters in the script: + + **Platform:** Set /platform:"**WordToPDF**" for v34.1.29 and later, or /platform:"**FileFormats**" for earlier versions (use the relevant Syncfusion platform as needed). -* Update the parameters in the LicenseKeyValidation.ps1 script file as described below. + **Version:** Change the value for `/version:` to the required version (for example, `26.2.4`). - **Platform:** Modify the value for /platform: to the actual platform "FileFormats". - - **Version:** Change the value for /version: to the required version (e.g., "26.2.4"). - - **License Key:** Replace the value for /licensekey: with your actual license key (e.g., "Your License Key"). - - N> This feature is supported only from the 16.2.0.41 version of the Essential Studio®. + **License Key:** Replace the value for `/licensekey:` with your actual license key (for example, `Your License Key`). To keep the key out of source control, store it as a CI secret and read it in the script (for example, `$env:SYNCFUSION_LICENSE_KEY`). + + N> This feature is supported starting with version 16.2.0.41 of Essential Studio®. + + N> On Windows agents, if script execution is blocked by policy, run the script with `-ExecutionPolicy Bypass` (for example, `powershell -ExecutionPolicy Bypass -File .\LicenseKeyValidation.ps1`). The script returns a non-zero exit code when validation fails so the pipeline step fails. ## Azure Pipelines (YAML) -* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1). +* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as the value (for example, `D:\LicenseKeyValidator\LicenseKeyValidation.ps1`). -* Integrate the PowerShell task in the pipeline and execute the script to validate the license key. +Integrate the PowerShell task in the pipeline and execute the script to validate the license key. The following example shows the syntax for Windows build agents. {% tabs %} -{% highlight c# tabtitle="YAML" %} +{% highlight yaml tabtitle="YAML" %} pool: vmImage: 'windows-latest' @@ -75,21 +84,21 @@ steps: ## Azure Pipelines (Classic) -* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1). +* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as the value (for example, `D:\LicenseKeyValidator\LicenseKeyValidation.ps1`). Store the license key as a secret variable (for example, `SYNCFUSION_LICENSE_KEY`). -* Include the PowerShell task in the pipeline and execute the script to validate the license key. +* Add a PowerShell task that runs the script. Mark the build to fail when the script's exit code is non-zero so the pipeline reflects validation failures. ![LicenseKeyValidation script](licensing-images/license-validation-classic.png) -## GitHub actions +## GitHub Actions -* To execute the script in PowerShell as part of a GitHub Actions workflow, include a step in the configuration file and update the path of the LicenseKeyValidation.ps1 script file (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1). +* To execute the script in PowerShell as part of a GitHub Actions workflow, add a step in the workflow YAML file. Update the path of the LicenseKeyValidation.ps1 script file (for example, `./path/LicenseKeyValidator/LicenseKeyValidation.ps1`) and store the license key in a repository or organization secret named `SYNCFUSION_LICENSE_KEY`. -The following example shows the syntax for validating the Syncfusion® license key in GitHub actions. +The following example shows the syntax for validating the Syncfusion® license key in GitHub Actions. {% tabs %} -{% highlight c# tabtitle="YAML" %} - steps: +{% highlight yaml tabtitle="YAML" %} +steps: - name: Syncfusion License Validation shell: pwsh run: | @@ -99,9 +108,9 @@ The following example shows the syntax for validating the Syncfusion®® license key in the Jenkins pipeline. @@ -125,41 +134,64 @@ pipeline { ## Validate the License Key By Using the ValidateLicense() Method -* Register the license key properly by calling RegisterLicense("License Key") method with the license key. +* Register the license key by calling `SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY")` before any Syncfusion control is instantiated. -* Once the license key is registered, it can be validated by using the ValidateLicense("Platform.FileFormats") method. This ensures that the license key is valid for the platform and version you are using. For reference, please check the following example. +* After registration, validate the key with `SyncfusionLicenseProvider.ValidateLicense(Platform.FileFormats)`, passing the `Platform` enum value that matches your application. This confirms the license is valid for the platform and version in use. The method returns `true` on success and `false` on failure; in overloads that include an `out string validationMessage` parameter, the message describes the failure reason. See the following examples for the correct signature by version. {% tabs %} -{% highlight c# %} +{% highlight csharp tabtitle="v34.1.29 and later" %} +using Syncfusion.Licensing; + +// Register the Syncfusion license key +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +// Validate the registered license key. +// The array overload allows validating against multiple platforms in a single call. +bool isValid = SyncfusionLicenseProvider.ValidateLicense(new[] { Platform.WordToPDF }); +{% endhighlight %} + +{% highlight csharp tabtitle="v31.1.17 to v33.2.3" %} using Syncfusion.Licensing; -//Register Syncfusion license key -Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); +// Register the Syncfusion license key +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); -//Validate the registered license key +// Validate the registered license key +bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.WordToPDF); +{% endhighlight %} + +{% highlight csharp tabtitle="Before v31.1.17" %} +using Syncfusion.Licensing; + +// Register the Syncfusion license key +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +// Validate the registered license key bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.FileFormats); {% endhighlight %} {% endtabs %} -![LicenseKeyValidationMethod](licensing-images/license-validation-method.png) +N> Use the specific platform enum (`PDF`, `Word`, `Excel`, `PowerPoint`, `WordToPDF`, `ExcelToPDF`, `PowerPointToPDF`, `PDFViewer`, `WordEditor`, or `SpreadsheetEditor`) for license validation from v31.1.17 and later. `Platform.FileFormats` is not supported from v31.1.17 onwards. + +* If the `ValidateLicense()` method returns `true`, the registered license key is valid and the build can proceed with deployment. -* If the ValidateLicense() method returns true, registered license key is valid and can proceed with deployment. +* If the `ValidateLicense()` method returns `false`, the build produces invalid license errors. Validation fails when the license key is invalid or the referenced Syncfusion assembly or package versions do not match the version of the license key. Ensure that all referenced Syncfusion® assemblies or NuGet packages share the same version as the license key before deployment. -* If the ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion® assemblies or NuGet packages are all on the same version as the license key’s version before deployment. +## Validate the License Key By Using the Unit Test Project -## Validate the License Key By Using the Unit Test Project +* To create a unit test project in Visual Studio, choose **File -> New -> Project** from the menu. This opens a new dialog for creating a new project. Filter the project type by Test, or type **Test** as a keyword in the search option, to find available unit test projects. Select the appropriate test framework (such as MSTest, NUnit, or xUnit) that best suits your need. -* To create a unit test project in Visual Studio, choose **File -> New -> Project** from the menu. This opens a new dialog for creating a new project. Filtering the project type by Test or typing Test as a keyword in the search option can help you to find available unit test projects. Select the appropriate test framework (such as MSTest, NUnit, or xUnit) that best suits your need. +* Add the required Syncfusion references to the test project. The example below uses NUnit, so install the NUnit and NUnit3TestAdapter NuGet packages, then add the `Syncfusion.Licensing` package and the File-Formats platform package (for example, `Syncfusion.PdfToPdfAConverter` or the platform package relevant to your project) at the same version as your license key. ![Unit Test Projects](licensing-images/unit-test-projects.png) * For more details on creating unit test projects in Visual Studio, refer to the [Getting Started with Unit Testing guide](https://learn.microsoft.com/en-us/visualstudio/test/getting-started-with-unit-testing?view=vs-2022&tabs=dotnet%2Cmstest#create-unit-tests). -* Register the license key by calling the RegisterLicense("Your License Key") method with the license key in the unit test project. +* Register the license key by calling `SyncfusionLicenseProvider.RegisterLicense("Your License Key")` in the unit test project. Register the key before any Syncfusion control is instantiated so the validation reflects the runtime configuration. -N> * Place the license key between double quotes. Also, ensure that Syncfusion.Licensing.dll is referenced in your project where the license key is being registered. +N> Enclose the license key in double quotes. Also, ensure that `Syncfusion.Licensing` (the `Syncfusion.Licensing.dll` assembly) is referenced in the project where the license key is registered. For .NET Core/5+ projects, add the `Syncfusion.Licensing` NuGet package; for .NET Framework projects, reference `Syncfusion.Licensing.dll` from the installed Essential Studio assemblies. -* Once the license key is registered, it can be validated by using the ValidateLicense("Platform.FileFormats", out var validationMessage) method. This ensures that the license key is valid for the platform and version you are using. +* Once the license key is registered, it can be validated by using the `ValidateLicense(Platform.FileFormats, out string validationMessage)` method. The `validationMessage` out parameter describes the failure reason when the result is `false`, which makes troubleshooting easier in unit-test output. * For reference, please check the following example that demonstrates how to register and validate the license key in the unit test project. @@ -183,12 +215,12 @@ public void TestSyncfusionFileFormatsLicense() {% endhighlight %} {% endtabs %} -* Once the unit test is executed, if the license key validation passes for the specified platform, the output similar to the following will be displayed in the Test Explorer window. +* Once the unit test is executed, if the license key validation passes for the specified platform, output similar to the following is displayed in the **Test Explorer** window. ![License Validation Success Message](licensing-images/unit-test-success-message.png) -* If the license validation fails during unit testing, the following output will be displayed in the Test Explorer window. +* If the license validation fails during unit testing, output similar to the following is displayed in the **Test Explorer** window. ![License Validation Failure Message](licensing-images/unit-test-failure-message.png) -* License validation fails due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. In such cases, verify that you are using the valid license key for the platform, and ensure the assembly or package versions referenced in the project match the version of the license key. \ No newline at end of file +* Validation fails when the license key is invalid or the referenced Syncfusion assembly or package versions do not match the version of the license key. Verify that you are using a valid key for the platform and that all referenced Syncfusion packages share the same version as the license key. \ No newline at end of file From 03c9bf05c2dcd93ea7a1252c78dfe9bb18e5b647 Mon Sep 17 00:00:00 2001 From: Deepak Raj Sundar Date: Mon, 13 Jul 2026 23:14:20 +0530 Subject: [PATCH 041/127] Added the release notes MD file and corresponding node entry in the TOC.html file --- Document-Processing-toc.html | 78 +++++++------------ Document-Processing/Release-Notes/v34.1.31.md | 38 +++++++++ .../angular/document-editor-toc.html | 2 +- .../ej2-javascript-document-editor-toc.html | 2 +- .../ej2-typescript-document-editor-toc.html | 2 +- .../react/document-editor-toc.html | 2 +- .../vue/document-editor-toc.html | 2 +- 7 files changed, 71 insertions(+), 55 deletions(-) create mode 100644 Document-Processing/Release-Notes/v34.1.31.md diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index cdaa98df84..05800dad94 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -1,8 +1,6 @@ -
  • - API Reference -
  • +
  • @@ -742,9 +738,7 @@
  • Document Loading Issues in Version 23.1 or Newer
  • -
  • - API Reference -
  • +
  • @@ -1051,7 +1045,7 @@
  • Failed to execute 'importScripts' on 'WorkerGlobalScope'
  • -
  • API Reference
  • +
  • @@ -1296,9 +1290,7 @@
  • How to Extract Particular Text and Highlight
  • -
  • - API Reference -
  • +
  • @@ -1619,7 +1611,7 @@
  • Troubleshoot ERR_OSSL_EVP_UNSUPPORTED Error
  • -
  • API Reference
  • +
  • @@ -1843,7 +1835,7 @@
  • Document Loading Issues in Version 23.1 or Newer
  • -
  • API Reference
  • +
  • @@ -2110,7 +2102,7 @@
  • Style and Appearance in Form Field module
  • -
  • API Reference
  • +
  • @@ -2367,7 +2359,7 @@
  • Document Loading Issues in Version 23.1 or Newer
  • -
  • API Reference
  • +
  • @@ -2922,9 +2914,7 @@
  • How to clear the Web-service is not listening error
  • -
  • - API Reference -
  • + @@ -2970,9 +2960,7 @@
  • How to refer the SfSmartPdfViewer script file in application
  • -
  • - API Reference -
  • + @@ -3738,9 +3726,7 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • - API Reference -
  • +
  • @@ -3855,9 +3841,7 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • - API Reference -
  • +
  • @@ -4001,7 +3985,7 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • +
  • @@ -4074,9 +4058,7 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • - API Reference -
  • +
  • @@ -4222,7 +4204,7 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • +
  • @@ -4367,7 +4349,7 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • +
  • @@ -4511,7 +4493,7 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • +
  • @@ -4654,7 +4636,7 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • +
  • @@ -5547,9 +5529,7 @@
  • Mobile Responsiveness
  • Features Availability
  • -
  • - API Reference -
  • +
  • @@ -5604,9 +5584,7 @@
  • Mobile Responsiveness
  • Features Availability
  • -
  • - API Reference -
  • +
  • @@ -5663,7 +5641,7 @@
  • Mobile Responsiveness
  • -
  • API Reference
  • +
  • @@ -5698,7 +5676,7 @@
  • Performance Metrics
  • Accessibility
  • Events
  • -
  • API Reference
  • +
  • @@ -5872,7 +5850,7 @@
  • Features Availability
  • Events
  • -
  • API Reference
  • +
  • @@ -5928,7 +5906,7 @@
  • Mobile Responsiveness
  • Features Availability
  • -
  • API Reference
  • +
  • @@ -5983,7 +5961,7 @@
  • Mobile Responsiveness
  • -
  • API Reference
  • +
  • @@ -6039,7 +6017,7 @@
  • Mobile Responsiveness
  • -
  • API Reference
  • +
  • @@ -8441,7 +8419,7 @@
  • Release Notes -
    • 2026 Volume 2 - v34.*
    • +
      • 2026 Volume 2 - v34.*
      • 2026 Volume 1 - v33.*
        • Weekly Nuget Release diff --git a/Document-Processing/Release-Notes/v34.1.31.md b/Document-Processing/Release-Notes/v34.1.31.md new file mode 100644 index 0000000000..afc078159a --- /dev/null +++ b/Document-Processing/Release-Notes/v34.1.31.md @@ -0,0 +1,38 @@ +--- +title : Essential Studio® for Document Processing Release Notes - v34.1.31 +description : Learn here about the controls in the Essential Studio® for Document Processing Weekly Nuget Release - Release Notes - v34.1.31 +platform : document-processing +documentation: ug +--- + +# Essential Studio® for Document Processing - v34.1.31 Release Notes + +{% include release-info.html date="July 14, 2026" version="v34.1.31" passed="236416" failed="0" %} + +{% directory path: _includes/release-notes/v34.1.31 %} + +{% include {{file.url}} %} + +{% enddirectory %} + +## Test Results + +| Component Name | Platform | Test Cases | Passed | Failed | Remarks | +|----------------|----------|------------|--------|--------|---------| +| Calculate Library | .NET | 145 | 145 | 0 | All Passed | +| DOCX Editor | Blazor | 2004 | 2004 | 0 | All Passed | +| DOCX Editor | Web(Javascript, Angular, React, Vue, ASP.NET Core & MVC) | 5294 | 5294 | 0 | All Passed | +| Excel Library | .NET | 37994 | 37994 | 0 | All Passed | +| Metafile Renderer | .NET | 897 | 897 | 0 | All Passed | +| PDF Library | .NET | 14150 | 14150 | 0 | All Passed | +| PDF Viewer | .NET MAUI | 15368 | 15368 | 0 | All Passed | +| PDF Viewer | Blazor | 16908 | 16908 | 0 | All Passed | +| PDF Viewer | Web(Javascript, Angular, React, Vue, ASP.NET Core & MVC) | 21897 | 21897 | 0 | All Passed | +| PDF Viewer | Windows Forms | 209 | 209 | 0 | All Passed | +| PDF Viewer | WPF | 3040 | 3040 | 0 | All Passed | +| PowerPoint Library | .NET | 54557 | 54557 | 0 | All Passed | +| Spreadsheet | Blazor | 5094 | 5094 | 0 | All Passed | +| Spreadsheet | Web(Javascript, Angular, React, Vue, ASP.NET Core & MVC) | 10887 | 10887 | 0 | All Passed | +| Spreadsheet | WPF | 2717 | 2717 | 0 | All Passed | +| Word Library | .NET | 41176 | 41176 | 0 | All Passed | +| Word Library | Java | 4079 | 4079 | 0 | All Passed | \ No newline at end of file diff --git a/Document-Processing/Word/Word-Processor/angular/document-editor-toc.html b/Document-Processing/Word/Word-Processor/angular/document-editor-toc.html index 24c8d6354a..321a39d553 100644 --- a/Document-Processing/Word/Word-Processor/angular/document-editor-toc.html +++ b/Document-Processing/Word/Word-Processor/angular/document-editor-toc.html @@ -138,6 +138,6 @@
        • Unsupported Warning Message When Opening a Document
      • -
      • API Reference
      • +
      diff --git a/Document-Processing/Word/Word-Processor/javascript-es5/ej2-javascript-document-editor-toc.html b/Document-Processing/Word/Word-Processor/javascript-es5/ej2-javascript-document-editor-toc.html index f3195a87d3..a8e4653c94 100644 --- a/Document-Processing/Word/Word-Processor/javascript-es5/ej2-javascript-document-editor-toc.html +++ b/Document-Processing/Word/Word-Processor/javascript-es5/ej2-javascript-document-editor-toc.html @@ -139,6 +139,6 @@
    • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • + diff --git a/Document-Processing/Word/Word-Processor/javascript-es6/ej2-typescript-document-editor-toc.html b/Document-Processing/Word/Word-Processor/javascript-es6/ej2-typescript-document-editor-toc.html index 95e44f65d8..9d641e6183 100644 --- a/Document-Processing/Word/Word-Processor/javascript-es6/ej2-typescript-document-editor-toc.html +++ b/Document-Processing/Word/Word-Processor/javascript-es6/ej2-typescript-document-editor-toc.html @@ -139,6 +139,6 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • + diff --git a/Document-Processing/Word/Word-Processor/react/document-editor-toc.html b/Document-Processing/Word/Word-Processor/react/document-editor-toc.html index 9b70a9b051..de49254ed8 100644 --- a/Document-Processing/Word/Word-Processor/react/document-editor-toc.html +++ b/Document-Processing/Word/Word-Processor/react/document-editor-toc.html @@ -138,6 +138,6 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • + diff --git a/Document-Processing/Word/Word-Processor/vue/document-editor-toc.html b/Document-Processing/Word/Word-Processor/vue/document-editor-toc.html index fbd6607776..a1e9de45f1 100644 --- a/Document-Processing/Word/Word-Processor/vue/document-editor-toc.html +++ b/Document-Processing/Word/Word-Processor/vue/document-editor-toc.html @@ -140,6 +140,6 @@
  • Unsupported Warning Message When Opening a Document
  • -
  • API Reference
  • + From c3329f6b94bec884af2cee56a02c7c00c7e5f2b2 Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Mon, 13 Jul 2026 11:18:33 +0530 Subject: [PATCH 042/127] =?UTF-8?q?Task(1040469):=20Need=20to=20improve=20?= =?UTF-8?q?UG=20documentation=20for=20UWP=20PDFViewer=20usi=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bookmark-navigation.md | 10 +++-- .../Creating-custom-toolbar.md | 16 +++---- .../uwp/Concepts-and-Features/Hyperlink.md | 39 ++++++++-------- .../uwp/Concepts-and-Features/Printing-PDF.md | 44 ++++++++++--------- .../Working-with-annotations.md | 14 +++--- .../Working-with-text-search.md | 26 ++++++----- .../PDF/PDF-Viewer/uwp/Getting-Started.md | 33 ++++++++------ .../uwp/How-to/Customize-the-scrollbar.md | 14 +++--- .../PDF/PDF-Viewer/uwp/Overview.md | 2 +- 9 files changed, 106 insertions(+), 92 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Bookmark-navigation.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Bookmark-navigation.md index eb2d22607a..175ecd81c2 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Bookmark-navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Bookmark-navigation.md @@ -7,9 +7,9 @@ control: SfPdfViewerControl documentation: ug --- -# Bookmark navigation in UWP PDF Viewer (SfPdfViewer) +# Bookmark Navigation in UWP PDF Viewer (SfPdfViewer) -PDF Viewer allows users to navigate to the bookmarks present in the loaded PDF document. +The SfPdfViewer control allows users to navigate to the bookmarks present in the loaded PDF document. This section covers programmatic navigation using the `GoToBookmark` method. ## Programmatically navigate to a bookmark destination @@ -24,13 +24,15 @@ PdfLoadedDocument loadedDocument = new PdfLoadedDocument(documentStream); //Retrieves the bookmark collection from the loaded PDF document PdfBookmarkBase bookmark = loadedDocument.Bookmarks; -//Navigate to the specified bookmark destination offset +//Navigates to the specified bookmark destination pdfViewerControl.GoToBookmark(bookmark[0]); {% endhighlight %} {% endtabs %} ## See Also +- [UWP PDF Viewer Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/overview) - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-page-navigation) - [Hyperlink](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/hyperlink) -- [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) \ No newline at end of file +- [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) +- [GoToBookmark API Reference](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Creating-custom-toolbar.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Creating-custom-toolbar.md index 5ea10fee45..82400b464c 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Creating-custom-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Creating-custom-toolbar.md @@ -9,33 +9,33 @@ documentation: ug # Creating a custom toolbar in UWP PDF Viewer (SfPdfViewer) -PdfViewer does not have a toolbar by default. But a custom toolbar can be designed at the sample with its buttons wired to the PdfViewer APIs. +The SfPdfViewer control does not include a built-in toolbar by default; however, a custom toolbar can be designed at the application level, with its buttons wired to the SfPdfViewer APIs. ## Creating separate UIs for desktop and mobile -Create a new UWP project (the name "PdfViewerCustomToolbar" is used here). It will by default have a MainPage.xaml file, a MainPage.xaml.cs file. Create a new folder in the project with name "DeviceFamily-Mobile" and create another XAML file with the same name MainPage.xaml in this folder. Open this file and set the class property to MainPage.xaml.cs. +Create a new UWP project (the name "PdfViewerCustomToolbar" is used here). By default, the project will contain a `MainPage.xaml` file and a `MainPage.xaml.cs` code-behind file. Create a new folder in the project with the name "DeviceFamily-Mobile", and create another XAML file named `MainPage.xaml` in this folder. Open this file and set the `x:Class` attribute to `MainPage.xaml.cs`. {% tabs %} {% highlight xaml %} -x:Class="PdfViewerCustomToolbar.MainPage"; +x:Class="PdfViewerCustomToolbar.MainPage" {% endhighlight %} {% endtabs %} -Make sure that both the xaml files are in the same namespace "PdfViewerCustomToolbar" +Make sure that both XAML files are in the same namespace, "PdfViewerCustomToolbar". {%tabs%} {%highlight xaml%} -xmlns:local="using:PdfViewerCustomToolbar"; +xmlns:local="using:PdfViewerCustomToolbar" {%endhighlight%} {%endtabs%} -The reason for two XAML files is that same UI design cannot be used for both desktop and mobile. So, one XAML file is used for desktop UI and the other is for mobile UI. The MainPage.xaml.cs file serve as the common code behind for both XAML pages. +Two XAML files are used because the same UI design cannot be shared between desktop and mobile. One XAML file is used for the desktop UI, while the other is used for the mobile UI. The `MainPage.xaml.cs` file serves as the common code-behind for both XAML pages. -In the constructor of MainPage set the DataContext to PdfViewer. +In the constructor of `MainPage`, set the `DataContext` to the SfPdfViewer instance. {%tabs%} {%highlight c#%} @@ -45,7 +45,7 @@ this.DataContext = pdfViewer; {%endhighlight%} {%endtabs%} -The UI design of the application for desktop and mobile is illustrated in the following documentation pages. The link to the common sample can be found at the ends of both the documentation pages. +The UI design of the application for desktop and mobile is illustrated in the following documentation pages. The link to the common sample can be found at the end of each documentation page. 1. [Desktop design](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/ui-design-for-desktop) 2. [Mobile design](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/ui-design-for-mobile) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md index a1d72a5939..475ef823ae 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md @@ -9,15 +9,15 @@ documentation: ug # Hyperlink in UWP PDF Viewer (SfPdfViewer) -PDF Viewer supports hyperlink navigation which detects document link and web link present in the pages of the PDF document. Tapping on the TOC and hyperlink will behave in the following manner. +The PdfViewer control supports hyperlink navigation that detects document links and web links present in the PDF document pages. Tapping a table of contents (TOC) entry or hyperlink behaves as follows: -1) If the tapped text contains web link, then the URI associated with the hyperlink will be opened in the default browser. +1) If the tapped text contains a web link, the URI associated with the hyperlink is opened in the default browser. -2) If the tapped text contains document link, then the PDF Viewer navigates to the destination page index which is associated with it. +2) If the tapped text contains a document link, the PDF Viewer navigates to the associated destination page index. ## How to disable hyperlink navigation in PDF document using PDF Viewer control? -You can disable the hyperlink navigation by setting the “AllowHyperlinkNavigation” property of PDF Viewer to false. By default, hyperlink navigation will be enabled in PDF Viewer. +You can disable hyperlink navigation by setting the `AllowHyperlinkNavigation` property of the PDF Viewer to `false`. By default, hyperlink navigation is enabled in the PDF Viewer. {% tabs %} {% highlight xaml %} @@ -29,7 +29,7 @@ You can disable the hyperlink navigation by setting the “AllowHyperlinkNavigat ## How to acquire the properties of clicked URI from PDF Viewer? -You can acquire the details of the hyperlink that is tapped in the PDF Viewer control from the HyperlinkEventArgs of HyperlinkPointerPressed event. Refer to the following code example for more details. +You can acquire the details of the hyperlink that is tapped in the PDF Viewer control from the `HyperlinkEventArgs` of the `HyperlinkPointerPressed` event. Refer to the following code example for more details. {% tabs %} {% highlight xaml %} @@ -44,7 +44,7 @@ You can acquire the details of the hyperlink that is tapped in the PDF Viewer co public void pdfViewerControl_HyperlinkPointerPressed(object sender,HyperlinkEventArgs args) { - // Gets or sets a value indicating whether the hyperlink navigation was handled. + // Gets or sets a value indicating whether the hyperlink navigation was handled. args.Handled = false; // Gets the hyperlink being clicked. @@ -53,15 +53,14 @@ You can acquire the details of the hyperlink that is tapped in the PDF Viewer co // Gets the current page index of the hyperlink. int pageIndex = args.PageIndex; - //Gets the destination page index of the hyperlink. + // Gets the destination page index of the hyperlink. int destinationPageIndex = args.DestinationPageIndex; - //Gets the bounds of the hyperlink is being clicked. + // Gets the bounds of the hyperlink being clicked. RectangleF hyperlinkBound = args.Bounds; - //Gets the whether the tapped hyper link is a Web Link or Document Link. - HyperlinkType linkType = args.HyperlinkType - + // Gets whether the tapped hyperlink is a Web Link or Document Link. + HyperlinkType linkType = args.HyperlinkType; } @@ -70,7 +69,7 @@ You can acquire the details of the hyperlink that is tapped in the PDF Viewer co ## How to detect whether the mouse pointer is over the hyperlink text? -The event `HyperlinkPointerMoved` will be raised when the mouse pointer is moved over the hyperlink text. Refer to the following code example for more details. +The `HyperlinkPointerMoved` event is raised when the mouse pointer is moved over the hyperlink text. Refer to the following code example for more details. {% tabs %} {% highlight xaml %} @@ -85,19 +84,19 @@ The event `HyperlinkPointerMoved` will be raised when the mouse pointer is moved public void pdfViewerControl_HyperlinkPointerMoved(object sender,HyperlinkEventArgs args) { - // Gets or sets a value indicating whether the hyperlink navigation was handled. + // Gets or sets a value indicating whether the hyperlink navigation was handled. args.Handled = false; - // Gets the hyperlink being clicked. + // Gets the hyperlink under the pointer. string uri = args.URI; // Gets the current page index of the hyperlink. int pageIndex = args.PageIndex; - //Gets the destination page index of the hyperlink. + // Gets the destination page index of the hyperlink. int destinationPageIndex = args.DestinationPageIndex; - //Gets the bounds of the hyperlink is being clicked. + // Gets the bounds of the hyperlink under the pointer. RectangleF hyperlinkBound = args.Bounds; //Gets the whether the tapped hyper link is a Web Link or Document Link. @@ -110,21 +109,21 @@ The event `HyperlinkPointerMoved` will be raised when the mouse pointer is moved ## How to restrict the URI navigation from the PDF Viewer? -By default, web link or document link navigation is performed on tapping the hyperlink text. This navigation can be restricted using the property 'Handled' of the `HyperlinkEventArgs`. Refer to the following code snippet for more details. +By default, web link or document link navigation is performed on tapping the hyperlink text. This navigation can be restricted using the `Handled` property of the `HyperlinkEventArgs`. Refer to the following code snippet for more details. {% tabs %} {% highlight c# %} public void pdfViewerControl_HyperlinkPointerPressed(object sender,HyperlinkEventArgs args) { - // Setting the property to true will restrict the URI navigation inside the PDF Viewer control. In default, the value is false. - args.Handled = false; + // Setting the property to true will restrict the URI navigation inside the PDF Viewer control. By default, the value is false. + args.Handled = true; } {% endhighlight %} {% endtabs %} ## See Also -- [Bookmark](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/bookmark-navigation) +- [Bookmark Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/bookmark-navigation) - [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-page-navigation) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Printing-PDF.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Printing-PDF.md index 718243b1a3..5bb717e661 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Printing-PDF.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Printing-PDF.md @@ -9,9 +9,9 @@ documentation: ug # Printing PDF in UWP PDF Viewer (SfPdfViewer) -Printing can be done using the Print method or by using the Print command. +Printing can be done using the `Print` method or by using the `PrintCommand`. This section covers synchronous printing, asynchronous printing with cancellation, exception handling, quality factor configuration, and print preview customization. -The following code shows how to perform the print operation using Print method. Here 'buffer' is the byte array read from the PDF file either using FileOpenPicker or from Assets folder, as illustrated in the [Viewing PDF](https://help.syncfusion.com/uwp/pdf-viewer/concepts-and-features/viewing-pdf) section. +The following code shows how to perform the print operation using the `Print` method. Here, `buffer` is the byte array read from the PDF file either using `FileOpenPicker` or from the Assets folder, as illustrated in the [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) section. {% tabs %} {% highlight c# %} @@ -40,7 +40,7 @@ End Sub {% endhighlight %} {% endtabs %} -The following code shows how to bind the PrintCommand to a Button +The following code shows how to bind the `PrintCommand` to a Button. {% tabs %} {% highlight xaml %} @@ -58,17 +58,17 @@ The PDF Viewer allows you to print the PDF document asynchronously using the `Pr {% tabs %} {% highlight c# %} -//Asynchronously prints the document loaded in the PDF viewer +// Asynchronously prints the document loaded in the PDF viewer. pdfViewer.PrintAsync(cancellationTokenSource); {% endhighlight %} {% endtabs %} -In the above code sample, the `cancellationTokenSource` enables you to cancel the asynchronous printing when it is in progress +In the above code sample, the `cancellationTokenSource` enables you to cancel the asynchronous printing when it is in progress. ### Cancel the asynchronous PDF printing -You can raise the cancel request when printing is in progress +You can raise the cancel request when printing is in progress. {% tabs %} {% highlight c# %} @@ -81,13 +81,13 @@ private void cancelButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} - In the above code sample, the cancellationTokenSource instance is the same as the one given as the argument when printing the PDF document asynchronously. + In the above code sample, the `cancellationTokenSource` instance is the same as the one given as the argument when printing the PDF document asynchronously. - N> Calling the above method will not have any effect once the printing is complete. It will stop the printing process only when it is in progress. + N> Calling this method has no effect once printing is complete. It stops the printing process only when it is in progress. ### Handling exceptions while performing the asynchronous print -When the `PrintAsync` is called, the PDF Viewer will show the print previewer. Exceptions will be thrown if the print cannot be performed. The exceptions will be propagated back to the caller of this method. We recommend catching these exceptions as follows. +When the `PrintAsync` method is called, the PDF Viewer will show the print previewer. Exceptions will be thrown if the print cannot be performed. The exceptions will be propagated back to the caller of this method. Catch these exceptions as follows. {% tabs %} {% highlight c# %} @@ -97,13 +97,13 @@ When the `PrintAsync` is called, the PDF Viewer will show the print previewer. E try { - //Sets the name of the printed document. - pdfViewer.PrinterSettings.DocumentName = “PdfFileName.pdf”; + // Sets the name of the printed document. + pdfViewer.PrinterSettings.DocumentName = "PdfFileName.pdf"; - //Asynchronously prints the document loaded in the PDF viewer - await pdfViewerControl.PrintAsync(cancellationToken); + // Asynchronously prints the document loaded in the PDF viewer. + await pdfViewer.PrintAsync(cancellationToken); } - catch (Exception e) + catch (Exception ex) { ContentDialog printErrorDialog = new ContentDialog() { @@ -126,23 +126,25 @@ N> The [`SfPdfViewer`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.Pdf The PDF Viewer allows the user to set and retrieve the quality factor for print by using the [`QualityFactor`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.PrinterSettings.html#Syncfusion_Windows_PdfViewer_PrinterSettings_QualityFactor) property. The default value of this API is set to 1, and the values are restricted between 1 and 5. The values falling below the range are taken as 1, which represents the lowest page quality, and those above the range are taken as 5, which represents the highest page quality. Refer to the following code sample to set the quality factor for the print. +{% tabs %} {% highlight c# %} -//Sets the quality factor for the print. +// Sets the quality factor for the print. pdfViewer.PrinterSettings.QualityFactor = 2; {% endhighlight %} +{% endtabs %} N> Printing with quality factors higher than 2 will work as expected in the x64 configuration but may cause `System.OutOfMemoryException` in the x86 configuration due to the limited memory capacity of this architecture. ## Customizing the print previewer -You can customize the print options displayed in the print previewer while performing a print operation in the PDF Viewer control. The event `PrintTaskRequested` will be raised when you call the Print method to print a PDF document. +You can customize the print options displayed in the print previewer while performing a print operation in the PDF Viewer control. The `PrintTaskRequested` event will be raised when you call the `Print` method to print a PDF document. {% tabs %} {% highlight c# %} -//Wire up the PrintTaskRequested event with the PdfViewer_PrintTaskRequested +// Wire up the PrintTaskRequested event with the PdfViewer_PrintTaskRequested. pdfViewer.PrintTaskRequested += PdfViewer_PrintTaskRequested; {% endhighlight %} @@ -157,20 +159,20 @@ private void PdfViewer_PrintTaskRequested(object sender, SfPdfViewerPrintTaskReq { PrintTask printTask = null; - //Create a print task to customize the print options + // Create a print task to customize the print options. printTask = e.Request.CreatePrintTask("Printing", sourceRequested => { PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(printTask.Options); IList displayedOptions = printDetailedOptions.DisplayedOptions; - //Allows to add the required print options + // Allows adding the required print options. displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.CustomPageRanges); printTask.Options.PageRangeOptions.AllowCurrentPage = true; printTask.Options.PageRangeOptions.AllowAllPages = true; printTask.Options.PageRangeOptions.AllowCustomSetOfPages = true; - // Set the pdfViewerControl�s print document source + // Sets the pdfViewerControl's print document source. sourceRequested.SetSource(e.PrintDocumentSource); e.PrintTask = printTask; @@ -204,7 +206,7 @@ pdfViewerControl.PrintTaskRequested+= PrintTaskRequested; {% endhighlight %} {% endtabs %} -N>Though if you specify any print options to be displayed, only those that are supported by the selected printer are shown in the print preview UI. The print UI won't show options that the selected printer doesn't support. The print options will appear in the order in which they are added. +N> Even if you specify print options to be displayed, only those supported by the selected printer are shown in the print preview UI. The print UI will not show options that the selected printer does not support. Print options will appear in the order in which they are added. ## See Also - [Export Pages](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/exporting-pages-as-image) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-annotations.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-annotations.md index 3174881c70..92d7ef69c0 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-annotations.md @@ -7,7 +7,7 @@ control: PDF viewer documentation: ug --- -# Working with annotations in UWP PDF Viewer +# Working with Annotations in UWP PDF Viewer PDF Viewer allows user to include annotations in PDF files and provides options to modify or remove the existing annotations. The supported annotations are below. @@ -32,9 +32,9 @@ PDF viewer provides the following events. 5. AnnotationRemoved 6. AnnotationMovedOrResized -The properties of the annotation involved in the event can be obtained from the `AnnotationProperties` property of the event args parameter of each event except AnnotationMovedOrResized. Since the annotation properties are obtained from the same `AnnotationProperties` instance for all events except AnnotationMovedOrResized, only the AnnotationAdded event is illustrated below. +The properties of the annotation involved in an event can be obtained from the `AnnotationProperties` property of the event args parameter. This pattern is shared by all events except `AnnotationMovedOrResized`, so only the `AnnotationAdded` event is illustrated below. -The properties of the included annotation can be obtained by casting the `AnnotationAddedEventArgs` parameter's AnnotationProperties property to the property of corresponding annotation type. +To obtain properties for a specific annotation type, cast `AnnotationProperties` to the corresponding type (for example, `TextMarkupProperties`). {% highlight c# %} @@ -93,7 +93,7 @@ private void PdfViewer_AnnotationAdded(object sender, AnnotationMovedOrResizedEv ## Enable and disable selection of annotations -By default, PdfViewer allows the user to select the annotations by tapping on it, this action is followed by the appearance of the selector around the selected annotation. The selection of annotations can be disabled by setting `IsReadOnly` property of `AnnotationSettings` class to true. The default value of this API will be false. +By default, the SfPdfViewer control allows users to select annotations by tapping on them, and a selector appears around the selected annotation. The selection of annotations can be disabled by setting the `IsReadOnly` property of the `AnnotationSettings` class to `true`. The default value of this property is `false`. {% highlight c# %} @@ -128,7 +128,7 @@ The PDF viewer supports removing a single annotation and all the annotations in ### Remove a selected annotation -The following code snippet illustrates removing a selected annotation from the PDF document. +The following code snippet removes a selected annotation from the PDF document. {% tabs %} {% highlight xaml %} @@ -158,7 +158,7 @@ private void deleteAnnotationButton_clicked(object sender, RoutedEventArgs e) ### Remove all annotations -The following code snippet illustrates removing all annotations from the PDF. +The following code snippet removes all annotations from the PDF. {% highlight c# %} @@ -179,7 +179,7 @@ var annotations = pdfViewer.AnnotationCollection; ## How to show or hide the annotations present in the PDF? -Use the [`AnnotationVisibility`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_AnnotationVisibility) property to change the visibility of the annotations present in a PDF document. By default, the visibility of the annotation is `Visibility.Visible`. +Use the [`AnnotationVisibility`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_AnnotationVisibility) property to change the visibility of the annotations present in a PDF document. By default, the visibility of annotations is `Visibility.Visible`. {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-text-search.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-text-search.md index d1add11d73..cf7e7bf768 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-text-search.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Working-with-text-search.md @@ -13,7 +13,7 @@ Text search can be done in two ways, by using the SearchText method or by using In all code snippets found below, 'buffer' is the byte array read from the PDF file either using FileOpenPicker or from Assets folder, as illustrated in the [Viewing PDF](https://help.syncfusion.com/uwp/pdf-viewer/concepts-and-features/viewing-pdf) section. -**Using search methods** +## Using Search Methods The following code shows how to initiate the text search using the method. {% tabs %} @@ -26,7 +26,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchText("the"); } {% endhighlight %} @@ -53,7 +53,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchNextText("the"); } {% endhighlight %} @@ -80,7 +80,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchPrevText("the"); } {% endhighlight %} @@ -97,9 +97,9 @@ End Sub {% endhighlight %} {% endtabs %} -**Using search commands** +## Using Search Commands -The following code shows how to search for the next instance using SearchNextCommand. +The following code shows how to search for the next instance using `SearchNextCommand`. {% tabs %} {% highlight xaml %} @@ -109,17 +109,19 @@ The following code shows how to search for the next instance using SearchNextCom {% endhighlight %} {% endtabs %} -The following code shows how to search for the previous instance using SearchPreviousCommand. + +The following code shows how to search for the previous instance using `SearchPreviousCommand`. + {% tabs %} {% highlight xaml %} - + {% endhighlight %} {% endtabs %} -**Using asynchronous search methods** +## Using Asynchronous Search Methods The PDF viewer allows the users to perform text search asynchronously using the [SearchTextAsync](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_SearchTextAsync_System_String_System_Threading_CancellationToken_) method. The user can also cancel the asynchronous text search when it is in progress. @@ -135,7 +137,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void SearchButton_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchTextAsync(targetText, cts.Token); } @@ -158,7 +160,7 @@ CancellationTokenSource cts = new CancellationTokenSource(); private void SearchNextButton_Click(object sender, RoutedEventArgs e) { - //Searches for the next text instance in the PDF Document. + // Searches for the next text instance in the PDF document. pdfViewer.SearchNextTextAsync(targetText, cts.Token); } @@ -179,7 +181,7 @@ CancellationTokenSource cts = new CancellationTokenSource(); private void SearchPreviousButton_Click(object sender, RoutedEventArgs e) { - //Searches for the previous instance of the text in the PDF Document. + // Searches for the previous instance of the text in the PDF document. pdfViewer.SearchPreviousTextAsync(targetText, cts.Token); } diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md index 8fc9a60c41..bc70d6b7cd 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md @@ -19,14 +19,14 @@ You can create a **UWP Application** using Visual Studio via [Microsoft Template ## Assemblies Deployment -You can add a UWP PdfViewer component to your application by installing it via NuGet packages (recommended) or by manually adding the required assemblies to the project. +You can add a UWP PDF Viewer component to your application by installing it via NuGet packages (recommended) or by manually adding the required assemblies to the project. {% tabcontents %} {% tabcontent NuGet Package %} -### Install Syncfusion® UWP PdfViewer NuGet Package +### Install Syncfusion® UWP PDF Viewer NuGet Package -To add **UWP PdfViewer** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: +To add the **UWP PDF Viewer** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: • [Syncfusion.SfPdfViewer.UWP](https://www.nuget.org/packages/Syncfusion.SfPdfViewer.UWP) @@ -34,9 +34,9 @@ To add **UWP PdfViewer** component in the application, open the NuGet package ma {% tabcontent Assemblies (.dll) %} -### Add Syncfusion® UWP PdfViewer Assemblies +### Add Syncfusion® UWP PDF Viewer Assemblies -Below table describes, list of assemblies required to be added in project when the UWP PdfViewer control is used in your application. +The following table lists the assemblies required when the UWP PDF Viewer control is used in your application. @@ -69,21 +69,25 @@ Below table describes, list of assemblies required to be added in project when t
    -Each assembly must be placed together with its corresponding resource files (i.e., the resource files for an assembly should reside in the same folder as that assembly). The assemblies do not all have to be in a single folder — each assembly may live in its own folder so long as its resource files are kept alongside it. The screenshot shows only the SfPdfViewer assembly for brevity. +Each assembly must be placed together with its corresponding resource files; that is, the resource files for an assembly should reside in the same folder as that assembly. + +The assemblies do not all have to be in a single folder. Each assembly may live in its own folder, as long as its resource files are kept alongside it. The screenshot shows only the SfPdfViewer assembly for brevity. ![Dependent assemblies needed for SfPdfViewerControl](Getting-Started_images/Getting-Started_img3.jpeg) This co-location matters only if you move assemblies out of their installed location. If you relocate an assembly, be sure to move its resource files with it and place them in the same folder as that assembly. -N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your UWP application to use our components. - {% endtabcontent %} {% endtabcontents %} -## Add UWP PdfViewer component +## Licensing + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to register the Syncfusion® license key in your UWP application to use our components. + +## Add UWP PDF Viewer component -UWP PdfViewer control can be added to an application either through the designer (XAML) or programmatically using code. +UWP PDF Viewer control can be added to an application either through the designer (XAML) or programmatically using code. Use the **Via Designer** tab if you prefer a drag-and-drop workflow; use the **Via Coding** tab if you want to add the control directly in XAML or C#. {% tabcontents %} @@ -95,7 +99,7 @@ UWP PdfViewer control can be added to an application either through the designer ![SfPdfViewerControl in visual studio toolbox](Getting-Started_images/Getting-Started_img1.jpeg) -3. Drag `SfPdfViewerControl`(https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) and drop in to the Designer area from the Toolbox. +3. Drag the [`SfPdfViewerControl`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) and drop it into the Designer area from the Toolbox. When you drag the SfPdfViewerControl toolbox item to the window, it automatically adds the required assembly references to the current application. @@ -103,9 +107,9 @@ When you drag the SfPdfViewerControl toolbox item to the window, it automaticall {% tabcontent Via Coding %} -The SfPdfViewerControl is available in the following namespace [_Syncfusion.Windows.PdfViewer_](https://help.syncfusion.com/cr/UWP/Syncfusion.Windows.PdfViewer.html) and it can be created using XAML or programmatically using C#. +The SfPdfViewerControl is available in the [`Syncfusion.Windows.PdfViewer`](https://help.syncfusion.com/cr/UWP/Syncfusion.Windows.PdfViewer.html) namespace and can be created using XAML or programmatically using C#. -1. Add the Syncfusion PdfViewer namespace +1. Add the Syncfusion PDF Viewer namespace. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} xmlns:syncfusion="using:Syncfusion.Windows.PdfViewer" @@ -131,6 +135,7 @@ After adding the `SfPdfViewerControl`, you can load a PDF document using data bi 2. Create a simple class (`PdfReport.cs`) that provides the PDF stream. +N> Replace `PdfViewerExample` in the manifest resource path below with your project's default namespace. {% tabs %} {% highlight c# tabtitle="PdfReport.cs" %} @@ -245,4 +250,6 @@ Press Ctrl+F5 (Windows) or +F5 (m - [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) - [UWP PDF Viewer Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/overview) - [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-magnification) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-page-navigation) +- [Text Search](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-text-search) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md b/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md index 4dda7479f4..8350a61188 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md @@ -7,11 +7,13 @@ control: PDF viewer documentation: ug --- -# Customize the scrollbar in UWP PDF Viewer +# Customize the Scrollbar in UWP PDF Viewer + +This section explains how to customize the scrollbar appearance and width in the SfPdfViewer control. ## Customize the color of the scrollbar thumb -The PDF viewer uses the [ScrollViewer] (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-19041) control to scroll the pages of a PDF. The color of the vertical and horizontal scrollbar thumbs can be customized using the following code. +The PDF Viewer uses the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-19041) control to scroll the pages of a PDF. The color of the vertical and horizontal scrollbar thumbs can be customized using the following code. {% tabs %} {% highlight xaml %} @@ -28,14 +30,14 @@ The PDF viewer uses the [ScrollViewer] (https://docs.microsoft.com/en-us/uwp/api ## Customize the width of the vertical scrollbar -The width of the vertical scrollbar of the [ScrollViewer](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) can be modified by using the [VerticalScrollBarWidth](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_VerticalScrollBarWidth) property. The default value of the API is as same as the default width of the vertical scrollbar of the [ScrollViewer](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) control. +The width of the vertical scrollbar of the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) can be modified by using the [`VerticalScrollBarWidth`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_VerticalScrollBarWidth) property. The default value of this property matches the default width of the vertical scrollbar of the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) control. {% tabs %} {% highlight c# %} -//Sets the width of the vertical scrollbar in the PDF Viewer. -pdfViewerControl.VerticalScrollBarWidth = 100; -//Gets the width of the vertical scrollbar in the PDF Viewer. +// Sets the width of the vertical scrollbar in the PDF Viewer. +pdfViewerControl.VerticalScrollBarWidth = 100; +// Gets the width of the vertical scrollbar in the PDF Viewer. double verticalScrollBarWidth = pdfViewerControl.VerticalScrollBarWidth; {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md b/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md index 92c2810dcd..753e2303d6 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md @@ -9,7 +9,7 @@ documentation: ug # UWP PDF Viewer (SfPdfViewer) Overview -The [PDF viewer](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) for Universal Windows Platform is a native control for viewing and printing PDF documents. The control internally makes use of the Windows rendering engine (Windows.Data.Pdf) for rendering the pages of the PDF document. +The [PDF viewer](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) for Universal Windows Platform is a native control for viewing and printing PDF documents. The control uses the Windows rendering engine (`Windows.Data.Pdf`) to render the pages of the PDF document. ## In This Section From ed97d62c4488d661b0c702e104823c9401e41974 Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Wed, 8 Jul 2026 19:05:21 +0530 Subject: [PATCH 043/127] UG Document correction using Code-Studio AI --- .../maui/Add-Remove-Modify-Annotations.md | 32 ++++-- .../PDF-Viewer/maui/Annotation-Collection.md | 29 +++-- .../PDF-Viewer/maui/Annotations-Comment.md | 71 ++++++++---- .../PDF-Viewer/maui/Annotations-Overview.md | 37 +++--- .../PDF-Viewer/maui/Coordinates-Conversion.md | 46 +++++--- .../PDF/PDF-Viewer/maui/Custom-Bookmark.md | 60 +++++++--- .../maui/Document-Link-Annotations.md | 18 ++- .../PDF/PDF-Viewer/maui/Document-Outline.md | 36 ++++-- .../maui/DocumentLoadNotifications.md | 38 +++++-- .../maui/Form-Filling-Collection.md | 39 ++++--- .../maui/Form-Filling-Customization.md | 36 +++--- .../PDF/PDF-Viewer/maui/Form-Filling-Edit.md | 47 ++++---- .../PDF-Viewer/maui/Form-Filling-Events.md | 62 ++++++---- .../maui/Form-Filling-Import-Export.md | 73 ++++++++---- .../PDF-Viewer/maui/Form-Filling-Overview.md | 18 ++- .../PDF/PDF-Viewer/maui/Free-Text.md | 58 ++++++---- .../PDF/PDF-Viewer/maui/Getting-Started.md | 54 +++++---- .../PDF/PDF-Viewer/maui/Magnification.md | 32 ++++-- .../PDF/PDF-Viewer/maui/Overview.md | 68 +++++++---- .../PDF/PDF-Viewer/maui/Redaction.md | 107 +++++++++--------- .../PDF/PDF-Viewer/maui/Scrolling.md | 40 +++---- .../PDF/PDF-Viewer/maui/Shapes.md | 106 ++++++++--------- .../PDF/PDF-Viewer/maui/Undo-Redo.md | 27 +++-- .../PDF/PDF-Viewer/maui/ui-builder-skill.md | 81 ++++++------- 24 files changed, 758 insertions(+), 457 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md b/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md index 0091ebbe08..6612caba95 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md @@ -10,15 +10,23 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Add, Remove, and Edit Annotations -This section will review the various functions in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for adding, removing, and editing annotations in a PDF document. +This section explains the various functions in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for adding, removing, and editing annotations in a PDF document. ## Add annotations to a PDF document -This section will go through how to add annotations to a PDF document programmatically. +This section explains how to add annotations to a PDF document programmatically. ### Add annotations programmatically -You can add a new annotation to the PDF document programmatically by creating an annotation instance and providing it as a parameter to the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The following example shows how to create an instance of a circle annotation and add it to the PDF document. Similarly, you can create and add other types of annotations. +You can add a new annotation to the PDF document programmatically by creating an annotation instance and providing it as a parameter to the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The following example shows how to create an instance of a circle annotation and add it to the PDF document. Similarly, you can create and add other types of annotations. For more information on the available annotation types, refer to the [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview). + +To work with annotations, ensure the following namespaces are imported in your code file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} {% tabs %} {% highlight c# %} @@ -65,7 +73,7 @@ private void OnAnnotationAdded(object sender, AnnotationEventArgs e) ## Remove annotations from the PDF document -This section will go through different methods of removing annotations from a PDF document. +This section explains different methods of removing annotations from a PDF document. ### Remove a specific annotation @@ -123,7 +131,7 @@ private void OnAnnotationRemoved(object sender, AnnotationEventArgs e) ## Edit annotations -This section will go through different methods of editing annotations in a PDF document programmatically. +This section explains different methods of editing annotations in a PDF document programmatically. The `AddAnnotation`, `RemoveAnnotation`, and property modifications on the annotations each raise their respective events: [AnnotationAdded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded), [AnnotationRemoved](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved), and [AnnotationEdited](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited). ### Edit a specific annotation @@ -174,14 +182,14 @@ private void OnAnnotationEdited(object sender, AnnotationEventArgs e) {% endhighlight %} {% endtabs %} -### Adding custom information to an annotation +## Adding custom information to an annotation -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to assign custom information to annotations. The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property is utilized to store additional information about each annotation instance for reference. However, it's essential to note that these data are solely intended for reference purposes and will not be displayed in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) interface. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to assign custom information to annotations. The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property is utilized to store additional information about each annotation instance for reference. However, it's essential to note that this data is solely intended for reference purposes and will not be displayed in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) interface. -The provided code sample illustrates how to set the [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property for an annotation. Within this code sample, we set the custom data to represent the creation date of the annotation. +The provided code sample illustrates how to set the [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property for an annotation. In this code sample, the custom data is set to represent the creation date of the annotation. {% tabs %} -{% highlight C# %} +{% highlight c# %} private void OnAnnotationAdded(object sender, AnnotationEventArgs e) { @@ -196,3 +204,9 @@ private void OnAnnotationAdded(object sender, AnnotationEventArgs e) - [Select and Deselect Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/select-deselect-annotations) - [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) - [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) +- [Shapes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/shapes) +- [Text Markups](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups) +- [Ink](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink) +- [Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) +- [Stamps](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/stamps) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md index d0fd992116..0d1e0eeeb2 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md @@ -10,7 +10,19 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Annotation Collection in .NET MAUI PDF Viewer (SfPdfViewer) -The existing annotations in a PDF document can be accessed using the [Annotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This read only property will have the annotation collection information as soon as the document is loaded into the PDF Viewer. The following example explains how to use the property to obtain information about a square annotation that is the first on a specific document. +The existing annotations in a PDF document can be accessed using the [Annotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This read-only property will have the annotation collection information as soon as the document is loaded into the PDF Viewer. + +To work with the annotation collection, ensure the following namespaces are imported in your code file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using Microsoft.Maui.Graphics; +using System.Collections.ObjectModel; +{% endhighlight %} +{% endtabs %} + +The following example explains how to use the property to obtain information about the first annotation in a specific document. {% tabs %} {% highlight c# %} @@ -42,7 +54,8 @@ private void OnDocumentLoaded(object sender, EventArgs e) {% endtabs %} ## AnnotationsLoaded event -The [AnnotationsLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationsLoaded) event occurs after all annotations in the PDF have finished loading, either when the document is opened or when annotations are imported. You can use this event to perform actions once annotations are fully available in the viewer. + +The [AnnotationsLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationsLoaded) event occurs after all annotations in the PDF have finished loading, either when the document is opened or when annotations are imported. The `AnnotationsLoaded` event fires after the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event, once all annotations are fully available in the viewer. You can use this event to perform actions once annotations are fully available in the viewer. The following example explains how to wire and handle the event. {% tabs %} @@ -51,10 +64,10 @@ The following example explains how to wire and handle the event. void WireAnnotationsLoadedEvent() { // Wire the annotations loaded event of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). - pdfViewer.AnnotationsLoaded += OnAnnotationsLoaded; + PdfViewer.AnnotationsLoaded += OnAnnotationsLoaded; } -private void OnAnnotationsLoaded(object? sender, EventArgs e) +private void OnAnnotationsLoaded(object sender, EventArgs e) { Debug.WriteLine("All annotations have been loaded."); } @@ -63,6 +76,8 @@ private void OnAnnotationsLoaded(object? sender, EventArgs e) {% endtabs %} ## See Also -- [Add, Remove, and Modify Annotations](../add-remove-modify-annotations) -- [Annotations Overview](../annotations-overview) -- [Select and Deselect Annotations](../select-deselect-annotations) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) +- [Select and Deselect Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/select-deselect-annotations) +- [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) +- [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md index 23efabc7cb..f1dbf26573 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md @@ -9,6 +9,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne --- # Comments in .NET MAUI PDF Viewer (SfPdfViewer) + The PDF Viewer control provides options to add, edit, and delete comments for the following annotations in PDF documents: 1. Ink annotation 2. Shape annotation @@ -18,8 +19,25 @@ The PDF Viewer control provides options to add, edit, and delete comments for th 6. Free text annotation 7. Signature annotation -## Showing/Hiding the Comment panel +## Showing or hiding the comment panel The built-in Comment Panel in the PDF Viewer displays annotation comments. You can show or hide this panel using the [IsCommentsPanelVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsCommentsPanelVisible) property. The default value of this property is false. + +To work with the PDF Viewer and comments in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: + +{% tabs %} +{% highlight xml %} +xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} + {% tabs %} {% highlight c# %} @@ -30,7 +48,7 @@ PdfViewer.IsCommentsPanelVisible = true; {% endtabs %} {% tabs %} -{% highlight XAML %} +{% highlight xaml %} @@ -40,7 +58,8 @@ PdfViewer.IsCommentsPanelVisible = true; ## Comment panel -Annotation comments can be added to the PDF using the comment panel. Comment panel can be opened by using Built-in toolbar, In the toolbar you can see the comments button in the primary toolbar for desktop and top toolbar for mobile. The comment panel displays all annotations in the document along with their comments and replies, allowing you to add comments to any annotation and reply to existing comments or annotations. + +Annotation comments can be added to the PDF using the comment panel. The comment panel can be opened using the built-in toolbar. In the toolbar, you can find the Comments button in the primary toolbar for desktop and in the top toolbar for mobile. The comment panel displays all annotations in the document along with their comments and replies, allowing you to add comments to any annotation and reply to existing comments or annotations. The following image represents how to add the comments using the toolbar on the desktop. ![Annotations comments Built-in toolbar](Images/Annotations/desktop-comment.gif) @@ -50,16 +69,18 @@ The following image represents how to add comments using the toolbar on mobile. ![Annotations comments Built-in toolbar](Images/Annotations/mobile-comment.gif) ## Adding comments or replies -Follow these steps to add comments or replies : + +Follow these steps to add comments or replies: 1. Select the annotation in the PDF document and open the comment panel. 2. The corresponding comment thread is highlighted in the comment panel. -3. Add comments and replies using the comment panel. -4. Using the reply button in the comment panel, you can add a comment directly to a specific annotation, ensuring the discussion stays linked to that annotation. +3. Add a comment using the comment input area. +4. To reply to an existing comment or annotation, use the Reply button in the comment panel. This keeps the discussion linked to that annotation. 5. Multiple replies can be added to a comment. ## Add comments or replies programmatically -These can add comments or replies to existing annotations programmatically by accessing the specific annotation from the Annotations collection. This allows you to enhance collaboration and provide feedback directly within the PDF. -The following example explains how to add comments or replies to specific annotations in the PDF document. + +You can add comments or replies to existing annotations programmatically by accessing the specific annotation from the Annotations collection. This allows you to enhance collaboration and provide feedback directly within the PDF. +The following example explains how to add comments or replies to a specific annotation in the PDF document. {% tabs %} {% highlight c# %} @@ -77,22 +98,32 @@ annotation.Comments.Add(comment); {% endhighlight %} {% endtabs %} -## Editing the comments and comments replies of the annotations -Comments and replies can be edited through the context menu available under the More Options in the Comment Panel. Follow the steps below: -Select the annotation comment in the comment panel. +## Editing comments and replies + +Comments and replies can be edited through the context menu available under More Options in the Comment Panel. Follow the steps below: +1. Select the annotation comment in the comment panel. +2. Click More Options in the comment or reply container. +3. Select Edit from the context menu. +4. An editable text box appears. Change the content of the comment or reply. -1. Click More options in the comment or reply to container. -2. Select Edit from the context menu. -3. An editable text box appears. Change the content of the comment or reply. +## Deleting comments and replies -## Delete Comment or Comment Replies -Comments and replies can be deleted through the context menu available under the More Options in the Comment Panel. Follow the steps below: +Comments and replies can be deleted through the context menu available under More Options in the Comment Panel. Follow the steps below: 1. Select the annotation comment in the comment panel. -2. Click More options in the comment or reply to container. +2. Click More Options in the comment or reply container. 3. Select Delete from the context menu. -**Note :** Deleting the root comment from the comment panel also deletes the associated annotation. +**Note:** Deleting the root comment from the comment panel also deletes the associated annotation. ## See Also -- [Add, Remove, and Modify Annotations](../add-remove-modify-annotations) -- [Annotations Overview](../annotations-overview) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) +- [Annotation Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotation-collection) +- [Ink](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink) +- [Shapes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/shapes) +- [Stamps](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/stamps) +- [Sticky Notes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/sticky-notes) +- [Free Text](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/free-text) +- [Text Markups](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups) +- [Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md index 81f8f00195..8efeadc59e 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md @@ -18,11 +18,11 @@ To learn how to work with annotations, you can also check out our video tutorial -## Supported Annotation Types +## Supported annotation types The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the following annotation types, grouped by category. -### Text Markup Annotations +### Text markup annotations Use these annotations to mark up text content within the PDF document. @@ -35,7 +35,7 @@ Use these annotations to mark up text content within the PDF document. For more information, see [Text Markup Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups). -### Shape Annotations +### Shape annotations Use these annotations to draw geometric shapes over PDF content. @@ -50,7 +50,9 @@ Use these annotations to draw geometric shapes over PDF content. For more information, see [Shape Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/shapes). -### Freehand and Rich Content Annotations +### Freehand and rich content annotations + +Use these annotations to draw freehand strokes or add rich content such as text boxes, stamps, and notes over PDF content. | Annotation | Description | |---|---| @@ -62,35 +64,24 @@ For more information, see [Shape Annotations](https://help.syncfusion.com/docume For more information, see [Ink Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink), [Free Text Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/free-text), [Stamps](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/stamps), and [Sticky Notes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/sticky-notes). -## In This Section - -### Annotation Types - -| Topic | Description | -|---|---| -| [Text Markup Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups) | Highlight, underline, strikeout, and squiggly annotations on selected text. | -| [Shape Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/shapes) | Draw arrows, circles, lines, polygons, polylines, and rectangles over pages. | -| [Ink Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink) | Draw freehand strokes over any page area. | -| [Ink Eraser](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink-eraser) | Erase portions of existing ink annotations. | -| [Free Text Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/free-text) | Place a text box directly on the page. | -| [Stamps](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/stamps) | Apply predefined or custom image stamps on a page. | -| [Sticky Notes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/sticky-notes) | Attach pop-up notes to specific locations on a page. | +## Common annotation operations -### Common Annotation Operations +The following topics describe common operations that apply across annotation types. | Topic | Description | |---|---| -| [Add, Remove, and Modify Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) | Programmatically add, update, and delete any annotation type. | +| [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) | Programmatically add, update, and delete any annotation type. | | [Annotation Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotation-collection) | Access and iterate the full annotation collection. | | [Select and Deselect Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/select-deselect-annotations) | Select one or more annotations programmatically. | | [Lock and Unlock Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/lock-unlock) | Prevent annotations from being edited or deleted. | | [Show and Hide Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/show-hide) | Toggle visibility of annotations without removing them. | | [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) | Import/export annotation data in XFDF, FDF, JSON, and XML formats. | | [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) | Reverse or reapply recent annotation changes. | -| [Annotation Comments](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-comment) | Add review comments and status to annotations. | +| [Comments](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-comment) | Add review comments and replies to annotations. | ## See Also -- [Add, Remove, and Modify Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) -- [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) + - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) -- [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [Keyboard Shortcuts](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/keyboard-shortcuts) +- [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md b/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md index 8802bc9bf6..d7237b396f 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md @@ -12,11 +12,21 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne PDF Viewer allows users to obtain the PDF page coordinates relative to the PDF Viewer’s client coordinates and vice versa. It also allows you to obtain the scroll point relative to the PDF page coordinates and bring the given region into view. +To work with coordinate conversions, ensure the following namespaces are imported in your code file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using Microsoft.Maui.Graphics; +using System.Collections.ObjectModel; +{% endhighlight %} +{% endtabs %} + ## Client rectangle -The [ClientRectangle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) in the MAUI PdfViewer control is a rectangular area that represents the dimensions of the client area or viewport. The client area denotes the visible portion of the PDF document within the control. In the MAUI PDF Viewer, this client rectangle is illustrated by the red rectangle in the following figure. +The [ClientRectangle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) in the MAUI PdfViewer control is a rectangular area that represents the dimensions of the client area or viewport. The client area denotes the visible portion of the PDF document within the control. In the MAUI PDF Viewer, this client rectangle is illustrated by the red rectangle in the following figure. -![Client rectangle in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Client-Rectangle.png) +![Client rectangle in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Client-Rectangle.png) The client rectangle can be obtained by the [ClientRectangle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) property of the PDF Viewer. The following code sample explains the same. @@ -29,9 +39,9 @@ Rect clientRectangle = PdfViewer.ClientRectangle; ## Client coordinates -The MAUI PDF Viewer specifies the position of points in the client area(viewport) using client coordinates. The upper-left corner of the client area (viewport) of the control is the origin for client coordinates. The client coordinates in the MAUI PDF Viewer are shown in the following figure. +The MAUI PDF Viewer specifies the position of points in the client area (viewport) using client coordinates. The upper-left corner of the client area (viewport) of the control is the origin for client coordinates. The client coordinates in the MAUI PDF Viewer are shown in the following figure. -![Client coordinates in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Client-Coordinates.png) +![Client coordinates in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Client-Coordinates.png) ### Get the page number from a client point @@ -55,15 +65,15 @@ private void PdfViewer_Tapped(object sender, GestureEventArgs e) ## PDF page coordinates -PDF page coordinates are represented in terms of a device-independent coordinate system called user space, which is independent of the output device that will be used for printing or display. The user space coordinates system is initialized to a default state for each page of a PDF document. The length of a unit is 1/72 inch, which is approximately the same as a unit of point(pt). As an example, the dimensions of a letter-sized paper in PDF page coordinates are shown in the diagram below. +PDF page coordinates are represented in terms of a device-independent coordinate system called user space, which is independent of the output device that will be used for printing or display. The user space coordinates system is initialized to a default state for each page of a PDF document. The length of a unit is 1/72 inch, which is equivalent to one point (pt). As an example, the dimensions of a letter-sized paper in PDF page coordinates are shown in the diagram below. -![Page coordinates in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Page-Coordinates.png) +![Page coordinates in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Page-Coordinates.png) ## Scroll coordinates -Scroll coordinates in the MAUI PdfViewer denote pixel-based positions as pages are scrolled, indicating precise locations within the entire document. The coordinate system originates from the top-left corner of the visible area. +Scroll coordinates in the MAUI PDF Viewer denote pixel-based positions as pages are scrolled. They indicate precise locations within the entire document. The coordinate system originates from the top-left corner of the visible area. -## Convert PDF Viewer’s coordinates to PDF page coordinates +## Convert PDF Viewer's coordinates to PDF page coordinates You can obtain the PDF page coordinates using the [ConvertClientPointToPagePoint(clientPoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertClientPointToPagePoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the client point and page number as input parameters. The following code sample explains how to convert a tapped client area position to a page point. @@ -85,9 +95,9 @@ private void PdfViewer_Tapped(object sender, GestureEventArgs e) {% endhighlight %} {% endtabs %} -## Convert PDF page coordinates to PDF Viewer’s coordinates +## Convert PDF page coordinates to PDF Viewer's coordinates -You can obtain the PDF Viewer’s coordinates using the [ConvertPagePointToClientPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToClientPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code sample explains how to convert a square annotation’s position in the page coordinates to a client point. +You can obtain the PDF Viewer's coordinates using the [ConvertPagePointToClientPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToClientPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code sample explains how to convert a square annotation's position in the page coordinates to a client point. {% tabs %} {% highlight c# %} @@ -100,7 +110,7 @@ Annotation annotation = annotations[0]; // Type cast to the specific annotation type. Here, the first annotation is a square annotation. if (annotation is SquareAnnotation squareAnnotation) { - //Get the annotation’s page number. + //Get the annotation's page number. int pageNumber = squareAnnotation.PageNumber; //Get the annotation bounds. RectF annotationBounds = squareAnnotation.Bounds; @@ -114,7 +124,7 @@ if (annotation is SquareAnnotation squareAnnotation) ## Convert PDF page coordinates to scroll coordinates -You can obtain the PDF Viewer’s scroll coordinates using the [ConvertPagePointToScrollPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToScrollPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code example explains how to convert a square annotation’s position in the page coordinates to a scroll point. +You can obtain the PDF Viewer's scroll coordinates using the [ConvertPagePointToScrollPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToScrollPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code example explains how to convert a square annotation's position in the page coordinates to a scroll point. {% tabs %} {% highlight c# %} @@ -129,7 +139,7 @@ if (annotation is SquareAnnotation squareAnnotation) { //Get the annotation bounds. RectF annotationBounds = squareAnnotation.Bounds; - //Get the annotation’s page number. + //Get the annotation's page number. int pageNumber = squareAnnotation.PageNumber; //Find the position of the annotation in page coordinates. Point pagePoint = new Point(annotationBounds.X, annotationBounds.Y); @@ -140,7 +150,11 @@ if (annotation is SquareAnnotation squareAnnotation) {% endtabs %} ## See Also -- [Annotations Overview](../annotations-overview) -- [Page Navigation](../page-navigation) -- [Scrolling](../scrolling) + +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) +- [Scrolling](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/scrolling) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Annotation Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotation-collection) +- [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/magnification) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md b/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md index 743750bcbb..70f7c4d901 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md @@ -12,12 +12,32 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne PDF documents can include custom bookmarks that allow the user to bookmark pages and navigate to them. The PDF viewer control displays these custom bookmarks in outline view. -## Showing/Hiding the Custom Bookmarks Pane +To work with custom bookmarks in code, ensure the following namespaces are imported in your C# file: -The built-in custom bookmark view of the PDF Viewer displays the custom bookmarks, can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Linq; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: {% tabs %} -{% highlight XAML %} +{% highlight xml %} +xmlns:pdfViewer="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} + +## Showing or hiding the custom bookmarks pane + +The built-in custom bookmark view of the PDF Viewer displays the custom bookmarks and can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. + +{% tabs %} +{% highlight xml %} @@ -41,11 +61,11 @@ var customBookmarks = pdfViewer.CustomBookmarks; {% endhighlight %} {% endtabs %} -## Add, Edit, and Remove Custom Bookmarks +## Add, rename, and remove custom bookmarks -You can manage custom bookmarks in the PDF viewer using the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. This property allows you to add, edit, or remove bookmarks that appear in the viewer’s bookmark pane. +You can manage custom bookmarks in the PDF viewer using the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. This property allows you to add, rename, or remove bookmarks that appear in the viewer's bookmark pane. -### Add Custom Bookmarks +### Add custom bookmarks You can add custom bookmarks either through the UI or programmatically. You can also track additions using event handlers. @@ -108,11 +128,11 @@ private void Bookmarks_CollectionChanged(object? sender, NotifyCollectionChanged {% endhighlight %} {% endtabs %} -### Rename Custom Bookmarks +### Rename custom bookmarks You can rename custom bookmarks either through the UI or programmatically. You can also track rename changes using event handlers. -#### Rename via Context Menu +#### Rename via context menu To rename a custom bookmark from the UI: 1. Tap the context menu button on the desired custom bookmark. @@ -208,11 +228,11 @@ private void Bookmark_PropertyChanged(object? sender, PropertyChangedEventArgs e {% endhighlight %} {% endtabs %} -### Remove Custom Bookmarks +### Remove custom bookmarks You can remove custom bookmarks either through the UI or programmatically. You can also track bookmark removal using event handlers. -#### Remove via Context Menu +#### Remove via context menu To remove a custom bookmark from the UI: 1. Tap the context menu button on the custom bookmark you want to delete. @@ -245,9 +265,9 @@ To track when a custom bookmark is removed, handle the [CollectionChanged](https private void Bookmarks_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { // Check if the change action is 'Remove' - else if (e.Action == NotifyCollectionChangedAction.Remove && e.OldItems != null) + if (e.Action == NotifyCollectionChangedAction.Remove && e.OldItems != null) { - // Iterate through reomoved bookmarks + // Iterate through removed bookmarks foreach (Bookmark bookmark in e.OldItems) { Debug.WriteLine($"Removed bookmark: {bookmark.Name} at page {bookmark.PageNumber}"); @@ -262,7 +282,7 @@ private void Bookmarks_CollectionChanged(object? sender, NotifyCollectionChanged You can navigate to custom bookmarks either through the UI or programmatically using the PDF viewer's built-in features. -### Navigate Using UI +### Navigate using UI To navigate using the UI: 1. Ensure the outline view is visible by setting the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property to `true`. @@ -270,8 +290,9 @@ 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 +**Note:** 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. @@ -288,6 +309,9 @@ if (customBookmark != null) {% endtabs %} ## See Also -- [Document Outline](../document-outline) -- [Page Navigation](../page-navigation) -- [Hyperlink Navigation](../hyperlink-navigation) + +- [Document Outline](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/document-outline) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) +- [Hyperlink Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/hyperlink-navigation) +- [Annotation Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotation-collection) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md b/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md index b368ca412a..e68ec702fb 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md @@ -10,13 +10,21 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Document Link Navigation in .NET MAUI PDF Viewer (SfPdfViewer) -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. +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. + +To work with document link navigation in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} ![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. +**Note:** 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 +## Enable or disable document link navigation The document link navigation can be turned on or off using the [EnableDocumentLinkNavigation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableDocumentLinkNavigation) property. The default value of this property is `true`. The code snippet below illustrates disabling the document link navigation. @@ -29,6 +37,10 @@ pdfViewer.EnableDocumentLinkNavigation = false; {% endtabs %} ## See Also + - [Hyperlink Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/hyperlink-navigation) - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) - [Document Outline (Bookmarks)](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/document-outline) +- [Custom Bookmarks](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/custom-bookmark) +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md b/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md index d0ad9cc1c3..449a9bcdda 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md @@ -12,9 +12,26 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne A PDF document may optionally have a document outline (also called bookmarks) which allows the user to navigate from one part of the document to another. The PDF viewer control displays the document outline in a tree-structured hierarchy of outline elements. -## Showing/hiding the outline view +To work with the document outline in code, ensure the following namespaces are imported in your C# file: -The PDF viewer’s built-in outline view that displays the document outline in a tree like structure can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using System.Linq; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: + +{% tabs %} +{% highlight xml %} +xmlns:pdfViewer="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} + +## Showing / hiding the outline view + +The PDF Viewer's built-in outline view, which displays the document outline in a tree-like structure, can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. {% tabs %} {% highlight XAML %} @@ -43,7 +60,7 @@ var documentOutline = pdfViewer.DocumentOutline; ## Accessing nested child elements -The outline elements nested within each outline element can be accessed from the [OutlineElement.Children](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.OutlineElement.html#Syncfusion_Maui_PdfViewer_OutlineElement_Children) property. Below code snippet illustrates accessing the 2nd element in the document outline. And then accessing its 3rd child. +The outline elements nested within each outline element can be accessed from the [OutlineElement.Children](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.OutlineElement.html#Syncfusion_Maui_PdfViewer_OutlineElement_Children) property. The following code snippet illustrates accessing the third element in the document outline and then accessing its fourth child (using zero-based indexing). {% tabs %} {% highlight c# %} @@ -56,15 +73,15 @@ OutlineElement nestedElement = outlineElement.Children[3]; ## Navigating to outline elements -### Navigating using UI +### Navigating using the UI -As mentioned above, you can show the outline view by setting the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property to `true`. When the outline view is showing, you can tap on any element to navigate to the destination pointed by that element. +After showing the outline view using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property as described above, you can tap on any element to navigate to the destination pointed to by that element. -![Document outline in .NET MAUI PDF Viewer](Images\outline-view.png) +![Document outline in .NET MAUI PDF Viewer](Images/outline-view.png) ### Navigating programmatically -The PDF viewer allows the users to navigate to an outline element using the [GoToOutlineElement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToOutlineElement_Syncfusion_Maui_PdfViewer_OutlineElement_) method. The below code snippet illustrates the same. +The PDF Viewer allows users to navigate to an outline element using the [GoToOutlineElement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToOutlineElement_Syncfusion_Maui_PdfViewer_OutlineElement_) method. The following code snippet illustrates how to navigate to an outline element. {% tabs %} {% highlight c# %} @@ -79,6 +96,9 @@ if (outlineElement != null) {% endtabs %} ## See Also + - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) - [Document Link Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/document-link-annotations) -- [Custom Bookmark](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/custom-bookmark) +- [Custom Bookmarks](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/custom-bookmark) +- [Hyperlink Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/hyperlink-navigation) +- [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md b/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md index cc3c1cd34c..ef0c01ff02 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md @@ -12,6 +12,22 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) and [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) events to notify whether the document has been opened and displayed in the view or not. +To work with document load events in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: + +{% tabs %} +{% highlight XAML %} +xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} + ## Document loaded event The [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event triggers after the document is loaded in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). Refer to the following code example: @@ -24,7 +40,7 @@ The [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfView DocumentLoaded="PdfViewer_DocumentLoaded"/> {% endhighlight %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_DocumentLoaded(object sender, EventArgs e) { @@ -37,11 +53,11 @@ The [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfView If you want to perform any operation immediately after the document has loaded, you can handle the operations in this event. For example, if you want to initially open a document with a specific page number or zoom factor, then call the respective APIs in this event handler. The following code example explains opening a document with a specified page number of 4. {% tabs %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_DocumentLoaded(object sender, EventArgs e) { - pdfViewer.GoToPage(4); + PdfViewer.GoToPage(4); } {% endhighlight %} @@ -49,18 +65,18 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs e) ## Document load failures -When a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), users are notified with a context-specific error message via the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event. This event helps developers identify the cause of the failure and implement custom error handling for a smoother user experience. +When a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event notifies the application with a context-specific error message. This event helps developers identify the cause of the failure and implement custom error handling for a smoother user experience. ### Document load failed event The [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event alerts users when a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) due to one of the following conditions: * A corrupted document is loaded. * A password-protected document is provided with an invalid or empty password. -* A non-PDF file is attempted to be loaded. +* A non-PDF file is loaded. * The document contains an XFA form, which is currently unsupported. * Exceptions occur during PDF loading or page rendering due to limitations or issues in platform-specific native PDF renderers. -The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) will return the error [Message](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Message) and [Exception](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Exception) details for the failure. The following code example explains the same. +The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) returns the error [Message](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Message) and [Exception](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Exception) details for the failure. The following code example explains how to handle the event. {% tabs %} {% highlight XAML hl_lines="3" %} @@ -70,7 +86,7 @@ The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion DocumentLoadFailed="PdfViewer_DocumentLoadFailed"/> {% endhighlight %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e) { @@ -82,7 +98,7 @@ private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEvent ### Handling document load failures -The [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event allows you to handle the load failures at the application level in your own way. Set the [Handled](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Handled) property of the [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) to `true` to disable the control’s default error messages and handle your logic with the error information. +By default, the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) displays its own error message when a document fails to load. If you prefer to handle the failure at the application level with custom logic instead, set the [Handled](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Handled) property of the [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) to `true` to suppress the control's default error messages and implement your own handling using the error information. {% tabs %} {% highlight XAML hl_lines="3" %} @@ -92,7 +108,7 @@ The [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Pdf DocumentLoadFailed="PdfDocumentLoadFailed"/> {% endhighlight %} -{% highlight C# hl_lines="4" %} +{% highlight c# hl_lines="4" %} public MainPage() { @@ -110,6 +126,10 @@ private void PdfDocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e) {% endtabs %} ## See Also + - [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) +- [Open a Password Protected Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-password-protected-document) - [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) +- [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/magnification) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md index 3a1774c759..b243fcd7c9 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md @@ -10,21 +10,30 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Form Fields Collection in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer.FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) property provides access to all form fields present in the loaded PDF document. The collection is available after the document finishes loading and can be accessed from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event. +The [SfPdfViewer.FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) property provides access to all form fields present in the loaded PDF document. The collection is available after the document finishes loading and can be accessed from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event. For a broader overview of form-filling support, see [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview). + +To work with form fields in code, ensure the following namespaces are imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using System.Linq; +{% endhighlight %} +{% endtabs %} ## Accessing the FormFields collection -The following code snippet illustrates getting the total count of form fields in the PDF document. +The following code snippet illustrates getting the total count of form fields in the PDF document. Call the `WireDocumentLoadedEvent` method from your page constructor or initialization logic so the `DocumentLoaded` handler is registered before a document is loaded. {% tabs %} -{% highlight C# %} +{% highlight c# %} public void WireDocumentLoadedEvent() { // Wire the document loaded event to occur when a PDF document is loaded. PdfViewer.DocumentLoaded += OnDocumentLoaded; } -private void OnDocumentLoaded(object? sender, EventArgs? e) +private void OnDocumentLoaded(object sender, EventArgs e) { // Get the form field count. int fieldCount = PdfViewer.FormFields.Count; @@ -34,10 +43,10 @@ private void OnDocumentLoaded(object? sender, EventArgs? e) ## Retrieve a specific form field by name -You can retrieve a specific form field from the collection by filtering on the [Name](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_Name) property. The following example retrieves a text form field named `"name"`. +You can retrieve a specific form field from the collection by filtering on the [Name](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_Name) property. The following example retrieves a text form field whose name is `name`. {% tabs %} -{% highlight C# %} +{% highlight c# %} FormField formField = PdfViewer.FormFields.Where(x => x.Name == "name").FirstOrDefault(); if (formField is TextFormField nameTextBox) @@ -52,7 +61,7 @@ if (formField is TextFormField nameTextBox) Form fields can be prevented from being modified by setting the [ReadOnly](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_ReadOnly) property to `true`. The following example makes all form fields read-only. {% tabs %} -{% highlight C# %} +{% highlight c# %} // Restrict editing of all form fields. foreach (FormField formField in PdfViewer.FormFields) { @@ -66,7 +75,7 @@ foreach (FormField formField in PdfViewer.FormFields) The [ClearFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClearFormData_System_Int32_) method clears the data in all form fields in the PDF document. {% tabs %} -{% highlight C# %} +{% highlight c# %} // Clear all form field data in the document. PdfViewer.ClearFormData(); {% endhighlight %} @@ -75,7 +84,7 @@ PdfViewer.ClearFormData(); To clear form data on a specific page, pass the page number to the method. {% tabs %} -{% highlight C# %} +{% highlight c# %} // Clear all form field data on page 2. PdfViewer.ClearFormData(2); {% endhighlight %} @@ -83,12 +92,12 @@ PdfViewer.ClearFormData(2); ## Attach custom data to a form field -The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_CustomData) property allows you to store additional reference information on any form field instance. This data is for application use only and is not displayed or saved in the PDF document. +The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_CustomData) property allows you to store additional reference information for any form field instance. This data is for application use only and is not displayed or saved in the PDF document. To use this example, wire the `FormFieldValueChanged` event of the `SfPdfViewer` (for more details, see [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events)). -The following example stores the modification timestamp on a form field whenever its value changes. +The following example stores the modification timestamp for a form field whenever its value changes. {% tabs %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChangedEventArgs e) { e.FormField.CustomData = "Modified: " + DateTime.Now.ToString(); @@ -97,7 +106,11 @@ private void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChange {% endtabs %} ## See Also + - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) - [Edit Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-edit) - [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) -- [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) \ No newline at end of file +- [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) +- [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) +- [Form Field Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md index a81ae9514f..d7d7ac2eaa 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md @@ -8,20 +8,21 @@ documentation: ug keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .net maui open pdf, maui pdf viewer, maui pdf view --- -# Customize Form Fields in .NET MAUI PDF Viewer (SfPdfViewer) +# Customize form fields in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to customize the visual appearance of form fields by modifying properties on their [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) objects. You can change the background color, text (foreground) color, border color, and border width. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to customize the visual appearance of form fields by modifying properties on their [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) objects. A form field can have one or more `Widget` instances (the visual representations of the field on the page). You can change the background color, foreground (text) color, border color, and border width. -N> * Appearance customizations support undo and redo. -N> * Customizations cannot be applied when a form field is locked. -N> * Customized colors and border width are preserved during import, export, printing, and saving. +**Note:** +* Appearance customizations support undo and redo. +* Customizations cannot be applied when a form field is locked. For details, see [Lock and Unlock Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/lock-unlock). +* Customized colors and border width are preserved during import, export, printing, and saving. For more information, see [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) and [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document). ## Customize the background color The [BackgroundColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html#Syncfusion_Maui_PdfViewer_Widget_BackgroundColor) property sets the fill color behind the field content. The following example applies a uniform background color to all form fields in the document. {% tabs %} -{% highlight C# %} +{% highlight c# %} foreach (FormField formField in PdfViewer.FormFields) { foreach (Widget widget in formField.Widgets) @@ -33,12 +34,12 @@ foreach (FormField formField in PdfViewer.FormFields) {% endhighlight %} {% endtabs %} -## Customize the text color +## Customize the foreground (text) color -The `ForegroundColor` property sets the text color inside the form field. The following example applies a red text color to all text form fields. +The `ForegroundColor` property sets the color of the text inside the form field. The following example applies a red text color to all text form fields. {% tabs %} -{% highlight C# %} +{% highlight c# %} foreach (FormField formField in PdfViewer.FormFields) { if (formField is TextFormField textBoxField) @@ -57,7 +58,7 @@ foreach (FormField formField in PdfViewer.FormFields) The `BorderColor` property sets the color of the border drawn around the form field. The following example applies a red border to all text form fields. {% tabs %} -{% highlight C# %} +{% highlight c# %} foreach (FormField formField in PdfViewer.FormFields) { if (formField is TextFormField textBoxField) @@ -76,7 +77,7 @@ foreach (FormField formField in PdfViewer.FormFields) The `BorderWidth` property sets the thickness of the border around the form field. The following example sets a border width of `2.0` on all text form fields. {% tabs %} -{% highlight C# %} +{% highlight c# %} foreach (FormField formField in PdfViewer.FormFields) { if (formField is TextFormField textBoxField) @@ -92,13 +93,13 @@ foreach (FormField formField in PdfViewer.FormFields) ## Detect widget property changes -The `PropertyChanged` event on a [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) fires whenever a widget property — such as `BorderColor`, `BackgroundColor`, `BorderWidth`, or `ForegroundColor` — changes. Subscribe to this event after the document loads. +In addition to setting widget properties, you can also track when a widget property changes at runtime. The `PropertyChanged` event on a [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) fires whenever a widget property — such as `BorderColor`, `BackgroundColor`, `BorderWidth`, or `ForegroundColor` — changes. Subscribe to this event after the document loads. {% tabs %} -{% highlight C# %} +{% highlight c# %} void SubscribeToWidgetPropertyChanges() { - foreach (FormField formField in pdfViewer.FormFields) + foreach (FormField formField in PdfViewer.FormFields) { foreach (var widget in formField.Widgets) { @@ -107,7 +108,7 @@ void SubscribeToWidgetPropertyChanges() } } -private void Widget_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) +private void Widget_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (sender is Widget widget) { @@ -122,7 +123,12 @@ private void Widget_PropertyChanged(object? sender, System.ComponentModel.Proper {% endtabs %} ## See Also + - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) - [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) - [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection) - [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) +- [Edit Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-edit) +- [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) +- [Lock and Unlock](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/lock-unlock) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md index 8fe6013bba..35c06bcda9 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Edit.md @@ -14,7 +14,7 @@ The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer. ## Editing form fields programmatically -All form field edits shown below should be placed in your page's code-behind (`MainPage.xaml.cs`). The document must be fully loaded before accessing [FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) — call these from the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded") event handler or a button click after the document is open. +All form field edits shown below should be placed in your page's code-behind (`MainPage.xaml.cs`). The document must be fully loaded before accessing [FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) — call these from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler or a button click handler after the document is open. ### Editing text form fields @@ -23,8 +23,8 @@ A text form field can be modified using the [Text](https://help.syncfusion.com/c {% tabs %} {% highlight C# tabtitle="MainPage.xaml.cs" %} -// Call after DocumentLoaded fires, or from a button_Clicked handler. -FormField formField = pdfViewer.FormFields.Where(x => x.Name == "name").FirstOrDefault(); +// Call after the DocumentLoaded event fires, or from an OnEditButtonClicked handler. +FormField formField = PdfViewer.FormFields.Where(x => x.Name == "name").FirstOrDefault(); if (formField is TextFormField nameTextBox) { @@ -124,7 +124,7 @@ if (formField is RadioButtonFormField radioButton) ### Editing signature form fields -Programmatically, add a signature to an unsigned signature field by creating and assigning an ink annotation to the [SignatureFormField.Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature) property. The following code snippet illustrates retrieving a signature form field named "signature" from the PDF Viewer. +You can programmatically add a signature to an unsigned signature field by creating and assigning an ink annotation to the [SignatureFormField.Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature) property. The following code snippet illustrates retrieving a signature form field named "signature" from the PDF Viewer. {% tabs %} {% highlight C# %} @@ -143,21 +143,21 @@ if (signature != null) {% endhighlight %} {% endtabs %} -The [Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature) property is of type [InkAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html) and it will behave like an ink after signing. If the PDF document is saved, the signature will be preserved as an ink annotation in the saved document. +The [Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature) property is of type [InkAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html) and it behaves like an ink annotation after signing. If the PDF document is saved, the signature will be preserved as an ink annotation in the saved document. #### Suppressing the signature modal view -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the signature modal view and use your own UI in its place. This can be achieved by setting the `FormFieldModalViewAppearingEventArgs.Cancel` property to `true` in the [SignatureModalViewAppearing](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SignatureModalViewAppearing) event handler. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the signature modal view and use your own UI in its place. This can be achieved by setting the `FormFieldModalViewAppearingEventArgs.Cancel` property to `true` in the [SignatureModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SignatureModalViewAppearing) event handler. -The below code snippet illustrates suppressing the signature modal view and using a UI implemented in the app in its place. In this illustration, it is assumed that the signature is produced in the form of an image stream when the user completes drawing the signature in the custom dialog. When the signing is completed using the custom dialog, a stamp annotation is created and assigned as the signature of the form field. +The following code snippet illustrates suppressing the signature modal view and using a UI implemented in the app in its place. In this illustration, it is assumed that the signature is produced in the form of an image stream when the user completes drawing the signature in the custom dialog. When the signing is completed using the custom dialog, a stamp annotation is created and assigned as the signature of the form field. {% tabs %} {% highlight c# %} SignatureFormField? signatureFormField; -pdfviewer.SignatureModalViewAppearing += PdfViewer_SignatureModalViewAppearing; +PdfViewer.SignatureModalViewAppearing += PdfViewer_SignatureModalViewAppearing; -private void PdfViewer_SignatureModalViewAppearing(object? Sender, FormFieldModalViewAppearingEventArgs e) +private void PdfViewer_SignatureModalViewAppearing(object? sender, FormFieldModalViewAppearingEventArgs e) { e.Cancel = true; signatureFormField = e.FormField as SignatureFormField; @@ -166,10 +166,10 @@ private void PdfViewer_SignatureModalViewAppearing(object? Sender, FormFieldModa ShowCustomDialog(); } -Private void customDialogOkButton_Clicked(object sender, EventArgs e) +private void customDialogOkButton_Clicked(object sender, EventArgs e) { //Get the signature in the form of a Stream instance (possibly converted from an image of the user's freehand drawing) - signatureImageStream = GetSignatureImageStream(); + Stream signatureImageStream = GetSignatureImageStream(); // Create a stamp annotation. The bounds values are not necessary since the stamp will be automatically fit over the signature form field. StampAnnotation signatureStamp = new StampAnnotation(signatureImageStream, signatureFormField.PageNumber, new RectF(0, 0, 0, 0)); @@ -180,13 +180,13 @@ Private void customDialogOkButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} -### Button form fields +### Button form fields behavior -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. +Button form fields will be rendered in the PDF Viewer. The PDF Viewer supports only the `GoTo` actions that navigate to a particular location in the PDF document. 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. +The [FlattenOnSave](https://help.syncfusion.com/cr/maui/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 @@ -195,7 +195,7 @@ You can selectively flatten specific form fields, such as signature fields, by i {% tabs %} {% highlight c# %} -foreach (var item in pdfViewer.FormFields) +foreach (var item in PdfViewer.FormFields) { //Iterate Only signature form field and flatten it if (item is SignatureFormField signature) @@ -215,7 +215,7 @@ To flatten all form fields in the document, set the FlattenOnSave property for e {% highlight c# %} //Iterate all the form fields and set flatten -foreach (var item in pdfViewer.FormFields) +foreach (var item in PdfViewer.FormFields) { item.FlattenOnSave = true; } @@ -223,7 +223,7 @@ foreach (var item in pdfViewer.FormFields) {% endhighlight %} {% endtabs %} -## Controlling form field editing at the viewer Level +## Controlling form field editing at the viewer level The `AllowEditFormFields` property is used to control form field editing at the viewer level. By default, editing is enabled, allowing users to interact with all supported form fields. When this property is set to false, all form fields become non-editable, making the document effectively read-only without modifying individual field properties. This behavior applies to all form field types and takes effect immediately on the loaded document. @@ -238,15 +238,16 @@ You can disable editing programmatically using the following: {% highlight c# %} // Disable form field editing -pdfViewer.AllowEditFormFields = false; +PdfViewer.AllowEditFormFields = false; {% endhighlight %} {% endtabs %} This property supports dynamic changes at runtime, meaning you can enable or disable form field editing at the viewer level based on requirements, and the changes will be applied instantly. -N>Setting AllowEditFormFields to false does not modify the ReadOnly property of individual form fields. It acts as an additional layer of control, and a field remains non-editable if either its ReadOnly property is true or viewer-level editing is disabled +**Note:** Setting `AllowEditFormFields` to false does not modify the `ReadOnly` property of individual form fields. It acts as an additional layer of control, and a field remains non-editable if either its `ReadOnly` property is true or viewer-level editing is disabled. ## 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) - [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) @@ -254,3 +255,11 @@ N>Setting AllowEditFormFields to false does not modify the ReadOnly property of - [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) - [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) - [Electronic Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) +- [Form Field Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) +- [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection) +- [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) +- [Customize Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-customization) +- [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) +- [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) +- [Electronic Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md index 8dff6e7771..becd51ead7 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md @@ -10,7 +10,28 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Form Field Events in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) exposes events that allow you to track and respond to user interactions with form fields, such as value changes and focus changes. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) exposes events that allow you to track and respond to user interactions with form fields. The following table summarizes the available events: + +| Event | Description | +|---|---| +| [FormFieldValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged) | Raised when the value of a form field changes. | +| [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) | Raised when a text or signature field gains or loses focus. | + +To work with form field events in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} + +To use the `SfPdfViewer` control in XAML, add the following namespace declaration to your XAML page: + +{% tabs %} +{% highlight XAML %} +xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +{% endhighlight %} +{% endtabs %} ## Detect value changes @@ -20,7 +41,7 @@ Subscribe to the event in XAML: {% tabs %} {% highlight XAML %} - {% endhighlight %} {% endtabs %} @@ -28,30 +49,30 @@ Subscribe to the event in XAML: Handle the event in code: {% tabs %} -{% highlight C# %} -private void PdfViewer_FormFieldValueChanged(object? sender, FormFieldValueChangedEventArgs? e) +{% highlight c# %} +private void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChangedEventArgs e) { - if (e != null && e.FormField is TextFormField textFormField) + if (e.FormField is TextFormField textFormField) { // Read the previous and current values. - string? oldText = e.OldValue?.ToString(); - string? newText = e.NewValue?.ToString(); + string oldText = e.OldValue?.ToString(); + string newText = e.NewValue?.ToString(); } } {% endhighlight %} {% endtabs %} -N> The `OldValue` and `NewValue` types vary by field type. For a checkbox, cast them to `bool` to read the checked state. For a combo box or radio button, cast them to `string`. +**Note:** The `OldValue` and `NewValue` types vary by field type. For a checkbox, cast them to `bool` to read the checked state. For a combo box or radio button, cast them to `string`. -## Detect focus and unfocus +## Detect focus changes -The [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) event is raised when a text or signature field gains or loses focus. Use the `HasFocus` property to determine whether the field is being focused or unfocused. +The [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) event is raised when a text or signature field gains or loses focus. This event is raised only for text and signature form fields. Use the [HasFocus](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldFocusChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldFocusChangedEventArgs_HasFocus) property of the [FormFieldFocusChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldFocusChangedEventArgs.html) to determine whether the field is being focused or unfocused. Subscribe to the event in XAML: {% tabs %} {% highlight XAML %} - {% endhighlight %} {% endtabs %} @@ -59,22 +80,21 @@ Subscribe to the event in XAML: Handle the event in code: {% tabs %} -{% highlight C# %} -private void PdfViewer_FormFieldFocusChanged(object? sender, FormFieldFocusChangedEvenArgs? e) +{% highlight c# %} +private void PdfViewer_FormFieldFocusChanged(object sender, FormFieldFocusChangedEventArgs e) { - if (e != null) - { - FormField? field = e.FormField; - bool hasFocus = e.HasFocus; - } + FormField field = e.FormField; + bool hasFocus = e.HasFocus; } {% endhighlight %} {% endtabs %} -N> `FormFieldFocusChanged` is raised only for text and signature form fields. - ## See Also + - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) - [Edit Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-edit) -- [Form Data Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) +- [Form Filling Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) - [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection) +- [Show and Hide Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-show-hide) +- [Customize Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-customization) +- [Import and Export Form Data](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-import-export) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md index a237239651..d0baac1db6 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md @@ -12,6 +12,18 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to import form data into a PDF document and export filled form data from it. This is useful for pre-populating forms, backing up responses, or transferring data between systems. +To work with form data import and export in code, ensure the following namespaces are imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using Syncfusion.Pdf.Parsing; +using System.IO; +{% endhighlight %} +{% endtabs %} + +The `DataFormat` enumeration used for import and export is part of the `Syncfusion.Pdf.NET` package. Ensure this package is installed alongside `Syncfusion.Maui.PdfViewer`. + ## Supported data formats The following formats are supported for both import and export: @@ -20,12 +32,12 @@ The following formats are supported for both import and export: |---|---| | XFDF | XML Forms Data Format — standard format compatible with most PDF viewers. | | FDF | Forms Data Format — standard format compatible with most PDF viewers. | -| JSON | Custom format, compatible with PDF Viewers (WPF, Flutter, JavaScript, etc.). | -| XML | Custom format, compatible with PDF Viewers (WPF, Flutter, JavaScript, etc.). | +| JSON | Syncfusion-specific format for structured form data exchange across Syncfusion PDF viewers (WPF, Flutter, JavaScript, etc.). | +| XML | Syncfusion-specific format for hierarchical form data exchange across Syncfusion PDF viewers (WPF, Flutter, JavaScript, etc.). | -The required format can be selected from the [DataFormat](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Parsing.DataFormat.html) enumeration. +The required format can be selected from the [DataFormat](https://help.syncfusion.com/cr/maui/Syncfusion.Pdf.Parsing.DataFormat.html) enumeration. -N> XFDF and FDF are standard formats compatible with global PDF viewers. JSON and XML are Syncfusion-specific formats for cross-platform use within Syncfusion products only. +**Note:** XFDF and FDF are standard formats compatible with global PDF viewers. JSON and XML are Syncfusion-specific formats for cross-platform use within Syncfusion products only. ## Import form data @@ -34,14 +46,13 @@ Use the [ImportFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Pdf The following example imports form data from an XFDF file stored in the application's data directory. {% tabs %} -{% highlight C# %} +{% highlight c# %} void ImportFormData() { string fileName = Path.Combine(FileSystem.Current.AppDataDirectory, "FormDataInfo.xfdf"); Stream inputFileStream = File.OpenRead(fileName); - inputFileStream.Position = 0; - pdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf); + PdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf); } {% endhighlight %} {% endtabs %} @@ -49,8 +60,14 @@ void ImportFormData() To continue importing even if the file contains errors, pass `true` for the `continueImportOnError` parameter. {% tabs %} -{% highlight C# %} -pdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf, true); +{% highlight c# %} +void ImportFormDataWithOnError() +{ + string fileName = Path.Combine(FileSystem.Current.AppDataDirectory, "FormDataInfo.xfdf"); + Stream inputFileStream = File.OpenRead(fileName); + + PdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf, true); +} {% endhighlight %} {% endtabs %} @@ -58,32 +75,42 @@ pdfViewer.ImportFormData(inputFileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf Use the [ExportFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportFormData_System_IO_Stream_Syncfusion_Pdf_Parsing_DataFormat_) method to write the current form field values to a file. Pass an empty writable stream and the desired format. -The following example exports form data to an XFDF file in the application's data directory. +The following example exports form data to an XFDF file in the application's data directory. Ensure the PDF document is loaded before exporting — call `ExportFormData` from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler. + +First, wire the `DocumentLoaded` event after loading the document: {% tabs %} -{% highlight C# %} +{% highlight c# %} +// Load the PDF document and add the viewer to the visual tree. +PdfViewer.LoadDocumentAsync(PdfStream); +myGrid.Children.Add(PdfViewer); + +// Subscribe to the DocumentLoaded event to export once the document is fully loaded. +PdfViewer.DocumentLoaded += PdfViewer_DocumentLoaded; +{% endhighlight %} +{% endtabs %} -SfPdfViewer PdfViewer = new SfPdfViewer(); - PdfViewer.LoadDocumentAsync(PdfStream); +Then, handle the event and export the form data: -// 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) +{% tabs %} +{% highlight c# %} +private void PdfViewer_DocumentLoaded(object sender, EventArgs e) { - using (var fileStream = File.Create("D://SavedForm.json")) + string fileName = Path.Combine(FileSystem.Current.AppDataDirectory, "SavedForm.xfdf"); + using (var fileStream = File.Create(fileName)) { - if(sender is SfPdfViewer pdfViewer) - pdfViewer.ExportFormData(fileStream, Syncfusion.Pdf.Parsing.DataFormat.Json); + PdfViewer.ExportFormData(fileStream, Syncfusion.Pdf.Parsing.DataFormat.XFdf); } } {% endhighlight %} {% endtabs %} ## See Also + - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) -- [Form Data Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) +- [Form Filling Validation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-validation) - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) - [Import and Export Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/import-export-annotations) +- [Form Fields Collection](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-collection) +- [Edit Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-edit) +- [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md index 66daff411d..3519b2abef 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md @@ -10,9 +10,17 @@ 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](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_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/maui/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. +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. For saving filled forms, see [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document). + +To work with form fields in code, ensure the following namespace is imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +{% endhighlight %} +{% endtabs %} ## Supported form field types @@ -26,12 +34,12 @@ The viewer supports saving filled forms, flattening form fields to make them non | Signature | Captures a handwritten, text, or image signature. | | Button | Renders a button; supports `GoTo` navigation actions only. | -## XFA forms are not supported +## XFA forms -The PDF viewer supports only Acroforms. PDF documents that contain an XFA form cannot be loaded in the PDF Viewer. When a PDF with an XFA form is attempted to be loaded, the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event is raised. +The PDF Viewer supports only AcroForms. PDF documents that contain an XFA form cannot be loaded in the PDF Viewer. When you attempt to load a PDF with an XFA form, the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event is raised. {% tabs %} -{% highlight C# %} +{% highlight c# %} private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e) { if (e.Message == "This PDF cannot be loaded because it contains XFA form.") diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md index f3d1b59dd1..44f53e9a1b 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md @@ -10,15 +10,24 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Free Text Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify free text annotation in the PDF document. This is useful for adding text notes, comments, or feedback to the PDF pages. This section will go through the functions available in PDF Viewer for working with free text annotations. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify free text annotations in the PDF document. This is useful for adding text notes, comments, or feedback to the PDF pages. This section explains the functions available in the PDF Viewer for working with free text annotations. + +To work with free text annotations in code, ensure the following namespaces are imported in your C# file: + +{% tabs %} +{% highlight c# %} +using Syncfusion.Maui.PdfViewer; +using Microsoft.Maui.Graphics; +{% endhighlight %} +{% endtabs %} ## Add free text annotations -This section will go through how to add free text annotations to a PDF page using toolbar as well as programmatically. +This section explains how to add free text annotations to a PDF page using the built-in toolbar as well as programmatically. -### Add the free text annotations using the toolbar +### Add free text annotations using the built-in toolbar -On the built-in toolbar, a free text annotation tool is available. Using that, you can add the free text annotation to the tapped position. Additionally, the toolbar shows the option to modify the properties of existing or new free text annotations. +On the built-in toolbar, a free text annotation tool is available. Using that, you can add the free text annotation to the tapped position. Additionally, the built-in toolbar shows the option to modify the properties of existing or new free text annotations. The following image represents how to add the free text annotations using the toolbar on the desktop. @@ -28,7 +37,7 @@ The following image represents how to add the free text annotation using the too ![Free text Built-in toolbar](Images/mobilefreetext.gif) -### Add free text annotation without using the toolbar +### Add a free text annotation without using the toolbar You can add free text annotation to a PDF document by tapping with a touch (or mouse down) on a PDF page. The following steps explain how to add free text annotation in a PDF. @@ -64,9 +73,9 @@ void DisableFreetextMode() {% endhighlight %} {% endtabs %} -### Adding Annotations Programmatically +### Add annotations programmatically -You can create and add a free Text annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a free text annotation and add it to the first page of a PDF document. +You can create and add a free text annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a free text annotation and add it to the first page of a PDF document. {% tabs %} {% highlight C# %} @@ -124,7 +133,7 @@ void CustomizeDefaultFreeTextSettings() {% endhighlight %} {% endtabs %} -### How to create a free text annotation without a border? +### Create a free text annotation without a border The PDF Viewer allows you to customize annotation properties using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property. By default, free text annotations include a visible border. To create a free text annotation without a border, set the [BorderWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FreeTextAnnotationSettings.html#Syncfusion_Maui_PdfViewer_FreeTextAnnotationSettings_BorderWidth) property to 0 using the [FreeTextAnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FreeTextAnnotationSettings.html#properties). @@ -133,7 +142,7 @@ The following example demonstrates how to create a free text annotation without {% tabs %} {% highlight C# %} // Access the default free text annotation settings -FreeTextAnnotationSettings freeTextSettings = pdfViewer.AnnotationSettings.FreeText; +FreeTextAnnotationSettings freeTextSettings = PdfViewer.AnnotationSettings.FreeText; // Set the border width to zero to remove the border freeTextSettings.BorderWidth = 0; @@ -142,6 +151,8 @@ freeTextSettings.BorderWidth = 0; ## Edit the selected free text annotation +You can edit the text content and properties of a selected free text annotation either through UI interaction or programmatically. + ### Edit the text with UI interaction Double-tapping the selected free text annotation will allow you to edit its text content. @@ -187,9 +198,9 @@ The `SfPdfViewer.FreeTextModalViewAppearing` event is triggered whenever the mod {% tabs %} {% highlight c# %} -pdfviewer.FreeTextModalViewAppearing += PdfViewer_FreeTextModalViewAppearing; +PdfViewer.FreeTextModalViewAppearing += PdfViewer_FreeTextModalViewAppearing; -private void PdfViewer_FreeTextModalViewAppearing(object? Sender, AnnotationModalViewAppearingEventArgs e) +private void PdfViewer_FreeTextModalViewAppearing(object? sender, AnnotationModalViewAppearingEventArgs e) { // Implement the logic to hide unwanted UI elements such as toolbar items added to the app UI. } @@ -202,9 +213,9 @@ The `SfPdfViewer.FreeTextModalViewDisappearing` event is triggered when the moda {% tabs %} {% highlight c# %} -pdfviewer.FreeTextModalViewDisappearing += PdfViewer_FreeTextModalViewDisappearing; +PdfViewer.FreeTextModalViewDisappearing += PdfViewer_FreeTextModalViewDisappearing; -Private void PdfViewer_FreeTextModalViewDisappearing(object? Sender, EventArgs e) +private void PdfViewer_FreeTextModalViewDisappearing(object? sender, EventArgs e) { // Implement the logic to show the UI elements that were hidden from the FreeTextModalViewAppearing event handler. } @@ -214,17 +225,17 @@ Private void PdfViewer_FreeTextModalViewDisappearing(object? Sender, EventArgs e ### Suppressing the free text modal view and implementing your own UI -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the free text modal view and use your own UI in its place. This can be achieved by setting the [AnnotationModalViewAppearingEventArgs.Cancel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ModalViewAppearingEventArgs.html#Syncfusion_Maui_PdfViewer_ModalViewAppearingEventArgs_Cancel) property to `true` in the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) event handler. +The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the free text modal view and use your own UI in its place. This can be achieved by setting the [AnnotationModalViewAppearingEventArgs.Cancel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ModalViewAppearingEventArgs.html#Syncfusion_Maui_PdfViewer_ModalViewAppearingEventArgs_Cancel) property to `true` in the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) event handler. The `ShowCustomDialog()` and `customDialog.Text` used in the sample below are user-defined and must be implemented by the developer. -The below code snippet illustrates suppressing the free text modal view and using a UI implemented in the app in its place. The free text annotation instance that is created or edited can be obtained from the event args. Once the user enters the text in the custom dialog and confirms, the text can be assigned to this free text annotation instance. +The following code snippet illustrates suppressing the free text modal view and using a UI implemented in the app in its place. The free text annotation instance that is created or edited can be obtained from the event args. Once the user enters the text in the custom dialog and confirms, the text can be assigned to this free text annotation instance. {% tabs %} {% highlight c# %} Annotation editedAnnotation; -pdfviewer.FreeTextModalViewAppearing += PdfViewer_FreeTextModalViewAppearing; +PdfViewer.FreeTextModalViewAppearing += PdfViewer_FreeTextModalViewAppearing; -private void PdfViewer_FreeTextModalViewAppearing(object? Sender, AnnotationModalViewAppearingEventArgs e) +private void PdfViewer_FreeTextModalViewAppearing(object? sender, AnnotationModalViewAppearingEventArgs e) { e.Cancel = true; editedAnnotation = e.Annotation; @@ -232,9 +243,9 @@ private void PdfViewer_FreeTextModalViewAppearing(object? Sender, AnnotationModa ShowCustomDialog(); } -Private void customDialogOkButton_Clicked(object sender, EventArgs e) +private void customDialogOkButton_Clicked(object sender, EventArgs e) { - //Get the typed text from the custom dialog + //Get the typed text from the custom dialog string newText = customDialog.Text; if(editedAnnotation is FreeTextAnnotation freeText) { @@ -245,9 +256,14 @@ Private void customDialogOkButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} -N> For WinUI and MacCatalyst platforms, there is no separate modal view to receive text input from the users. As a result, the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) and [FreeTextModalViewDisappearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewDisappearing) events are not applicable for these platforms. +**Note:** For WinUI and MacCatalyst platforms, there is no separate modal view to receive text input from the users. As a result, the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) and [FreeTextModalViewDisappearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewDisappearing) events are not applicable for these platforms. ## See Also + - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) -- [Add, Remove, and Modify Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) - [Text Markups](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-markups) +- [Comments](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-comment) +- [Sticky Notes](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/sticky-notes) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md index 03a061ee29..6adf7cc680 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md @@ -102,7 +102,7 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma using System.ComponentModel; using System.Reflection; -internal class PdfViewerViewModel : INotifyPropertyChanged +public class PdfViewerViewModel : INotifyPropertyChanged { private Stream pdfDocumentStream; @@ -133,7 +133,7 @@ internal class PdfViewerViewModel : INotifyPropertyChanged public PdfViewerViewModel() { // Load the embedded PDF document stream. - // Replace 'PdfViewerExample' with your project's namespace in resource path + // Replace 'PdfViewerExample' with your project's default namespace in the resource path. Verify that the namespace matches your project name. pdfDocumentStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("PdfViewerExample.Assets.PDF_Succinctly.pdf"); } @@ -169,8 +169,19 @@ xmlns:local="clr-namespace:PdfViewerExample" {% endhighlight %} {% 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. 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. +**Note:** 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). +**Note:** 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. + +{% tabs %} +{% highlight c# %} +// Call UnloadDocument when navigating away from the page to free resources. +protected override void OnNavigatedFrom(NavigatedFromEventArgs args) +{ + PdfViewer.UnloadDocument(); + base.OnNavigatedFrom(args); +} +{% endhighlight %} +{% endtabs %} ## Step 6: Running the Application @@ -187,13 +198,13 @@ Before proceeding, ensure the following are in place: 1. Install [.NET 9 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) or later. 2. Set up a .NET MAUI environment with Visual Studio Code. -3. Ensure that the .NET MAUI workload is installed and configured as described [here](https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation?view=net-maui-8.0&tabs=visual-studio-code). +3. Ensure that the .NET MAUI workload is installed and configured as described in the [.NET MAUI installation guide](https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation?view=net-maui-9.0&tabs=visual-studio-code). ## Step 1: Create a New MAUI Project -1. Open the command palette by pressing `Ctrl+Shift+P` and type **.NET:New Project** and enter. +1. Open the command palette by pressing `Ctrl+Shift+P` and type **.NET: New Project** and press Enter. 2. Choose the **.NET MAUI App** template. -3. Select the project location, type the project name and press enter. +3. Select the project location, type the project name, and press Enter. 4. Then choose **Create project**. ## Step 2: Install the Syncfusion® MAUI PDF Viewer NuGet Package @@ -265,11 +276,14 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma {% highlight xml tabtitle="PdfViewerExample.csproj" %} - + {% endhighlight %} {% endtabs %} + +If the project does not reload automatically after editing the `.csproj`, close and reopen the project. + 3. In this example, the PDF document is loaded using MVVM binding. Create a new C# file named `PdfViewerViewModel.cs` and add the following code snippet. {% tabs %} @@ -278,7 +292,7 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma using System.ComponentModel; using System.Reflection; -internal class PdfViewerViewModel : INotifyPropertyChanged +public class PdfViewerViewModel : INotifyPropertyChanged { private Stream pdfDocumentStream; @@ -309,7 +323,7 @@ internal class PdfViewerViewModel : INotifyPropertyChanged public PdfViewerViewModel() { // Load the embedded PDF document stream. - // Replace 'PdfViewerExample' with your project's namespace in resource path + // Replace 'PdfViewerExample' with your project's default namespace in the resource path. Verify that the namespace matches your project name. pdfDocumentStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("PdfViewerExample.Assets.PDF_Succinctly.pdf"); } @@ -326,7 +340,7 @@ internal class PdfViewerViewModel : INotifyPropertyChanged {% endhighlight %} {% endtabs %} -4. Open the `MainPage.xaml` file again and add the namespace `PdfViewerExample`and name it as `local`. +4. Open the `MainPage.xaml` file again and add the namespace `PdfViewerExample` and name it as `local`. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} xmlns:local="clr-namespace:PdfViewerExample" @@ -368,7 +382,7 @@ Before proceeding, ensure the following are set up: ## Step 1: Create a new .NET MAUI Project -1. Go to **File > New Solution,** Select .NET (C#), and choose the .NET MAUI App template. +1. Go to **File > New Solution**, select .NET (C#), and choose the .NET MAUI App template. 2. Enter the Project Name, Solution Name, and Location. 3. Select the .NET Framework version and click Create. @@ -388,7 +402,7 @@ dotnet restore ## Step 3: Register the Syncfusion® Core Handler -[Syncfusion.Maui.Core](https://www.nuget.org/packages/Syncfusion.Maui.Core/) is a dependency for all MAUI Syncfusion controls. This package will be automatically installed as a dependency when [Syncfusion.Maui.PdfViewer](https://www.nuget.org/packages/Syncfusion.Maui.PdfViewer) NuGet is installed. +[Syncfusion.Maui.Core](https://www.nuget.org/packages/Syncfusion.Maui.Core/) is automatically installed as a dependency when [Syncfusion.Maui.PdfViewer](https://www.nuget.org/packages/Syncfusion.Maui.PdfViewer) NuGet is installed. 1. Add the following namespace in your `MauiProgram.cs` file. {% tabs %} @@ -425,16 +439,16 @@ Open the `MainPage.xaml` file and follow the steps below. 1. Add the following namespace in your MainPage.xaml file. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} - xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" +xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" {% endhighlight %} {% endtabs %} -2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. Name the PDF viewer control as `pdfViewer`. +2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} - + {% endhighlight %} {% endtabs %} @@ -448,7 +462,7 @@ Open the `MainPage.xaml` file and follow the steps below. {% highlight xml tabtitle="PdfViewerExample.csproj" %} - + {% endhighlight %} @@ -461,7 +475,7 @@ Open the `MainPage.xaml` file and follow the steps below. using System.ComponentModel; using System.Reflection; -internal class PdfViewerViewModel : INotifyPropertyChanged +public class PdfViewerViewModel : INotifyPropertyChanged { private Stream pdfDocumentStream; @@ -492,7 +506,7 @@ internal class PdfViewerViewModel : INotifyPropertyChanged public PdfViewerViewModel() { // Load the embedded PDF document stream. - // Replace 'PdfViewerExample' with your project's namespace in resource path + // Replace 'PdfViewerExample' with your project's default namespace in the resource path. Verify that the namespace matches your project name. pdfDocumentStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("PdfViewerExample.Assets.PDF_Succinctly.pdf"); } @@ -539,7 +553,7 @@ N> 2. If you are using multiple pages in your application, then make sure to unl {% endtabcontent %} {% endtabcontents %} -![Getting started with .NET MAUI PDF Viewer](Images\Getting-Started\maui-pdf-viewer-getting-started.png) +![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/tree/master/Getting%20Started).  diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md b/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md index dc4d5b61be..2bcdd3c2a0 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md @@ -12,7 +12,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne Give users precise control over how PDF content is displayed — from pinch-to-zoom on touch screens to setting an exact zoom percentage in code. You can also lock the view to predefined zoom modes like *Fit to Page* or *Fit to Width* to optimize readability for different document types. -## Adjusting the Zoom Factor +## Adjusting the zoom factor You can control the zoom level using the [ZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ZoomFactor) property. Refer to the following code example. @@ -28,7 +28,13 @@ PdfViewer.ZoomFactor = 3; You can also retrieve the current zoom level using the same property. -### Setting Minimum and Maximum Zoom Limits +{% tabs %} +{% highlight c# %} +double currentZoom = PdfViewer.ZoomFactor; +{% endhighlight %} +{% endtabs %} + +### Setting minimum and maximum zoom limits By default, the zoom range varies by platform: * **Mobile (Android/iOS):** 1.0 to 4.0 @@ -63,25 +69,25 @@ The PDF Viewer supports the following zoom modes via the [ZoomMode](https://help The default value is [ZoomMode.Default](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_Default). -### Zoom Mode via Built-In Toolbar +### Zoom mode via the built-in toolbar #### Desktop Toolbar The built-in toolbar includes a magnification dropdown showing the current zoom percentage. Users can select predefined zoom levels or choose **Fit to Page** / **Fit to Width**. -![Desktop Zoom Mode Combo Box](Images/windowszoom.gif) +![Desktop zoom mode combo box](Images/windowszoom.gif) #### Mobile Toolbar On mobile, the magnification tool appears only after the zoom factor changes. Users can then select **Fit to Page** or **Fit to Width**. Once selected, the icon disappears until the zoom factor changes again. -![Mobile Zoom Mode Combo box](Images/ZoomModeforMobile.gif) +![Mobile zoom mode combo box](Images/ZoomModeforMobile.gif) -### Programmatically Setting Zoom Mode +### Programmatically setting zoom mode #### Fit to Page -You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToPage) enumeration. It will magnify the PDF document so that the entire PDF page is visible in the view port. +You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToPage) enumeration. It magnifies the PDF document so that the entire PDF page is visible in the viewport. Refer to the following code example:  {% tabs %} @@ -97,7 +103,7 @@ pdfViewer.ZoomMode = ZoomMode.FitToPage; #### Fit to Width -You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToWidth) enumeration. It will magnify the PDF document so that the widest page of the PDF document fits the width of the view port. +You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToWidth) enumeration. It magnifies the PDF document so that the widest page of the PDF document fits the width of the viewport. Refer to the following code example: {% tabs %} @@ -106,14 +112,14 @@ Refer to the following code example: {% endhighlight %} {% highlight c# %} -// To apply fit-to-page zoom mode. +// To apply fit-to-width zoom mode. pdfViewer.ZoomMode = ZoomMode.FitToWidth; {% endhighlight %} {% endtabs %} N> When the `ZoomFactor` is manually changed, the `ZoomMode` resets to `Default`. You can reapply the desired zoom mode afterward. -## Maintain Zoom Level in Single Page View Mode +## Maintain zoom level in single-page view mode In single-page view mode, the zoom level resets to default each time you navigate to a new page. To maintain a consistent zoom factor throughout the document, enable the [PersistZoomOnPageChange](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PersistZoomOnPageChange) property. This applies whether navigation is triggered by the built-in toolbar controls or programmatic APIs. The default value of [PersistZoomOnPageChange](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PersistZoomOnPageChange) is `False`. @@ -153,7 +159,7 @@ PdfViewer.PersistZoomOnPageChange = false; {% endhighlight %} {% endtabs %} -## Enable or Disable Double-Tap Zoom +## Enable or disable double-tap zoom The PDF Viewer allows users to zoom in and out of the document using a double-tap gesture. This behavior can be controlled programmatically using the `AllowDoubleTapZoom` property. @@ -173,6 +179,10 @@ pdfViewer.AllowDoubleTapZoom = false; {% endtabs %} ## See Also + - [Scrolling](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/scrolling) - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) - [Gesture Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/gesture-events) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) +- [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Overview.md index 4fe084bb75..f8e12c5d87 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Overview.md @@ -10,13 +10,13 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # .NET MAUI PDF Viewer (SfPdfViewer) Overview -Build powerful PDF experiences into your .NET MAUI app with the [SfPdfViewer](https://www.syncfusion.com/maui-controls/maui-pdf-viewer) control. Whether you need to display documents for review, let users fill out forms, redact sensitive data, or annotate content — the PDF Viewer gives you a full-featured, cross-platform solution that works on Android, iOS, macOS, and Windows from a single code base. +Build powerful PDF experiences into your .NET MAUI app with the [SfPdfViewer](https://www.syncfusion.com/maui-controls/maui-pdf-viewer) control. Whether you need to display documents for review, let users fill out forms, redact sensitive data, or annotate content — the PDF Viewer gives you a full-featured, cross-platform solution that works on Android, iOS, macOS, and Windows from a single codebase. To get started, see [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started). -## In This Section +## In this section | Topic | Description | |---|---| -| [Getting Started](https://help.syncfusion.com/maui/pdf-viewer/getting-started) | Install the package, configure the handler, and load your first PDF document. | +| [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) | Install the package, configure the handler, and load your first PDF document. | | [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) | Load documents from streams, local storage, URLs, Base64 strings, or password-protected files. | | [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) | Add, edit, import, and export highlights, shapes, ink, stamps, sticky notes, and more. | | [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) | Fill, edit, import, and export PDF form fields including text boxes, checkboxes, and signatures. | @@ -26,42 +26,68 @@ Build powerful PDF experiences into your .NET MAUI app with the [SfPdfViewer](ht | [Toolbar Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar-customization) | Show, hide, add, remove, and reorder toolbar items. | | [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) | Customize the appearance of the PDF Viewer control. | | [Redaction](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/redaction) | Permanently remove sensitive content from PDF documents. | -| [Electronic Signature](https://help.syncfusion.com/maui/pdf-viewer/signature) | Add handwritten, typed, or image-based signatures. | -| [Keyboard Shortcuts](https://help.syncfusion.com/maui/pdf-viewer/keyboard-shortcuts) | Keyboard shortcuts available on desktop platforms. | -| [Localization](https://help.syncfusion.com/maui/pdf-viewer/localization) | Translate all built-in strings into any supported language. | +| [Electronic Signature](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature) | Add handwritten, typed, or image-based signatures. | +| [Keyboard Shortcuts](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/keyboard-shortcuts) | Keyboard shortcuts available on desktop platforms. | +| [Localization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/localization) | Translate all built-in strings into any supported language. | | [Migration Guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/migration) | Migrate from Xamarin.Forms SfPdfViewer to .NET MAUI SfPdfViewer. | ## Key Features +### Navigation and viewing + * **Virtual scrolling** - Easily scroll through the pages in the document fluently. Pages are rendered only when required to improve loading and scrolling performance. * **Magnification** - The content of a PDF document can be efficiently zoomed in and out by pinching or changing the zoom factor programmatically. * **Zoom modes** - Improve document readability by adjusting magnification to suit your viewing needs. Use *Fit to Page* to display the entire page without scrolling, ideal for quick overviews. Choose *Fit to Width* for optimal reading of content with narrow columns, such as newspapers or multi-column layouts. * **Page navigation** - Navigate to the desired pages instantly using the page navigation option programmatically or by dragging the scroll head in the UI. -* **Open password-protected PDFs** - Load and view password-protected PDFs in a hassle-free way. You can design a custom password request view and integrate the functionality easily with the options available. -* **Built-in Toolbar** - The PDF Viewer control includes a built-in toolbar, offering a seamless user experience with essential functions such as page navigation, text search, page layout mode adjustments, and various annotation tools. The toolbar's visibility can also be customized according to user preferences. -* **Text search** - Search for text and instantly navigate all its occurrences in a PDF document. -* **Select and copy text** - Select text from a PDF document and copy it to the clipboard. This helps share text content with others. +* **Page layout modes** - View the PDF files in different page layout modes, such as continuous scroll and single page. * **Outline view** - Use the outline view's hierarchical list of headings and subheadings to instantly navigate to the required topic in the document. * **Custom bookmarks** - Add, remove, and modify custom bookmarks in PDF files. This feature lets you quickly jump to specific sections or chapters without scrolling through the entire document. * **Document link navigation** - Navigate to the topic or position by tapping the document link annotation of the topics in the table of contents in a PDF document. * **Hyperlink navigation** - Detects hyperlinks, and tapping on the hyperlink will open the URL in a browser. -* **Form filling** - Fill, modify, import, export, and save form data from PDF documents. This feature helps to digitize the manual process of filling out paper forms. This can be used for filling out job applications, registration forms, medical forms, etc. Supported form fields are text box, checkbox, radio button, combo box, list box, button (only GoTo actions), and signature. -* **Ink or free-hand drawing annotation** - Add, remove, modify, save, import, and export ink annotations in PDF files. This feature will help make quick notes on specific text or passages, add marks or drawings to images, and add handwritten signatures. -* **Ink or free-hand drawing eraser** - Remove or erase portions of freehand drawings or ink annotations. This feature can be used to correct a mistake or remove unwanted marks. -* **Shape annotations** - Add, remove, modify, import, and export shape annotations in PDF files. The available shapes are arrow, circle, line, rectangle, polygon, and polyline. This feature will help highlight important paragraphs, images, or blocks of text, point out certain areas of interest, underline text or phrases in an image, or divide different sections or paragraphs, and provide directional guidance. +* **Text search** - Search for text and instantly navigate all its occurrences in a PDF document. +* **Select and copy text** - Select text from a PDF document and copy it to the clipboard. This helps share text content with others. +* **Coordinates conversion** - Obtain the PDF page coordinates relative to the PDF Viewer's client coordinates and vice versa. It also helps to obtain the scroll point relative to the PDF page coordinates and bring the given region into view. + +### Document loading and security + +* **Open password-protected PDFs** - Load and view password-protected PDFs in a hassle-free way. You can design a custom password request view and integrate the functionality easily with the options available. +* **Redaction** - Permanently remove sensitive content from PDF documents. + +### Annotations + +* **Ink or freehand drawing annotation** - Add, remove, modify, save, import, and export ink annotations in PDF files. This feature helps make quick notes on specific text or passages, add marks or drawings to images, and add handwritten signatures. +* **Ink or freehand drawing eraser** - Remove or erase portions of freehand drawings or ink annotations. This feature can be used to correct a mistake or remove unwanted marks. +* **Shape annotations** - Add, remove, modify, import, and export shape annotations in PDF files. The available shapes are arrow, circle, line, rectangle, polygon, and polyline. This feature helps highlight important paragraphs, images, or blocks of text, point out certain areas of interest, underline text or phrases in an image, or divide different sections or paragraphs, and provide directional guidance. * **Stamp annotation** - Add, remove, modify, import, and export stamp annotations in PDF files. Stamps are predefined graphical text that can be used to mark or signify certain aspects of documents, like that they have undergone quality checks or audits. This feature also allows adding personalized images or text to PDF documents. -* **Sticky note annotation** - Add, remove, modify, import, and export sticky note annotations in PDF files. This feature will help add comments or notes to a specific part of a document to clarify complex concepts, terms, or ideas. -* **Text markup annotations** - Add, remove, modify, import, and export text markup annotations in PDF files. The available text markups are highlight, underline, strikeout, and squiggly. This feature will help mark important passages, emphasize specific words or phrases, indicate that certain content should be removed, or indicate that text contains possible errors. +* **Sticky note annotation** - Add, remove, modify, import, and export sticky note annotations in PDF files. This feature helps add comments or notes to a specific part of a document to clarify complex concepts, terms, or ideas. +* **Text markup annotations** - Add, remove, modify, import, and export text markup annotations in PDF files. The available text markups are highlight, underline, strikeout, and squiggly. This feature helps mark important passages, emphasize specific words or phrases, indicate that certain content should be removed, or indicate that text contains possible errors. * **Free text annotation** - Add, remove, modify, import, and export free text annotations in PDF files. This feature helps to add text notes, comments, or feedback to PDF documents. -* **Show and Hide Annotations** - This feature enables users to manage the visibility of specific annotations or all annotations within the document. +* **Show and hide annotations** - This feature enables users to manage the visibility of specific annotations or all annotations within the document. + +### Form filling and signatures + +* **Form filling** - Fill, modify, import, export, and save form data from PDF documents. This feature helps to digitize the manual process of filling out paper forms. This can be used for filling out job applications, registration forms, medical forms, etc. Supported form fields are text box, checkbox, radio button, combo box, list box, button (only GoTo actions), and signature. * **Electronic signatures** - Add, remove, and modify electronic signatures in PDF files that include freehand-drawn, text, and image signatures. It can be used to sign contracts and agreements digitally, eliminating the need for physical signatures. -* **Page layout modes** - View the PDF files in different page layout modes, such as continuous scroll and single page. -* **Save** - Save the modified PDF files. -* **Print** - Print the PDF files. -* **Coordinates conversion** - Obtain the PDF page coordinates relative to the PDF Viewer’s client coordinates and vice versa. It also helps to obtain the scroll point relative to the PDF page coordinates and bring the given region into view. + +### Toolbar and customization + +* **Built-in toolbar** - The PDF Viewer control includes a built-in toolbar, offering a seamless user experience with essential functions such as page navigation, text search, page layout mode adjustments, and various annotation tools. The toolbar's visibility can also be customized according to user preferences. * **Localization** - All static text within the PDF Viewer can be localized to any supported language. +### Saving and printing + +* **Save** - Save the modified PDF files to a file stream, with optional annotation flattening. +* **Print** - Print the PDF files directly from the viewer. + ## See Also + - [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) +- [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) - [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) +- [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/magnification) +- [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) +- [Print a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/print-a-document) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [Redaction](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/redaction) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md b/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md index c3fb16a8c0..6ebe255cdd 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md @@ -12,22 +12,38 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne Before sharing a PDF externally, use redaction to permanently remove sensitive data — such as personal details, financial figures, or confidential text — from the document. Unlike simply covering content with a shape or annotation, redaction in [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) eliminates the underlying content entirely once the document is saved, making recovery impossible. -## Types of Redactions +## Types of redactions The PDF Viewer provides multiple methods to apply redaction, allowing you to securely conceal sensitive content based on different requirements. The available redaction types include: -- **Text-based Redaction** : Allows you to manually select the texts on a page and apply redaction to hide the texts. -- **Selected Area Redaction** : Allows you to manually select a rectangular area on a page and apply redaction to hide any content within that region. -- **Page-based Redaction** : Enables you to redact entire pages of a PDF document, ensuring that all content on those pages is permanently removed. +- **Text-based redaction**: Allows you to manually select the texts on a page and apply redaction to hide the texts. +- **Selected area redaction**: Allows you to manually select a rectangular area on a page and apply redaction to hide any content within that region. +- **Page-based redaction**: Enables you to redact entire pages of a PDF document, ensuring that all content on those pages is permanently removed. +Text-based and selected-area redactions can be performed either with the built-in toolbar or with UI interaction using the `RedactionMode` property. Page-based redaction is available only programmatically via the `AddPageRedactionMarks` method. -## Mark region to redact +## Customize the default redaction appearance + +In redaction mode, the redaction is applied with a default appearance and behavior. You can modify these settings before marking regions on the pages. To define the appearance and behavior, customize the default settings using the [RedactionSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +The following example demonstrates how to obtain the default redaction settings and modify their appearance properties. Similarly, you can modify other available properties. -You need to mark the region for redaction by using one of the available methods such as text-based, selected-area or page-based redaction. +{% tabs %} +{% highlight c# %} +void CustomizeDefaultRedactionSettings() +{ + // Access the default redaction settings from the SfPdfViewer instance and modify the default appearance properties. + PdfViewer.RedactionSettings.MarkerBorderColor = Colors.Blue; // Border color for the marked region. + PdfViewer.RedactionSettings.FillColor = Colors.Red; // Fill color after redaction is applied. + PdfViewer.RedactionSettings.FontColor = Colors.Black; // Font color for overlay text. + PdfViewer.RedactionSettings.OverlayText = "text"; // Text to display on the redacted area. + PdfViewer.RedactionSettings.IsRepeat = true; // Repeat overlay text across the redacted area. +} +{% endhighlight %} +{% endtabs %} -## Mark regions for redaction using toolbar +## Mark regions for redaction using the built-in toolbar -The built-in toolbar includes a redaction tool that allows you to redact text, specific areas, or entire pages by marking the desired region on the PDF document and clicking the Apply button. The toolbar also provides options to modify redaction properties, such as the color and the text to display in the redacted area. +You need to mark the region for redaction by using one of the available methods such as text-based, selected-area, or page-based redaction. The built-in toolbar includes a redaction tool that allows you to redact text, specific areas, or entire pages by marking the desired region on the PDF document and clicking the Apply button. The toolbar also provides options to modify redaction properties, such as the color and the text to display in the redacted area. The following image represents how to perform redactions using the toolbar on the desktop. @@ -39,14 +55,14 @@ The following image represents how to perform redactions using the toolbar on mo ## Mark regions for redaction without using the toolbar -You can mark the region for redaction in a PDF document with UI interaction using touch or mouse using the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to mark the region on a PDF. +You can mark the region for redaction in a PDF document with UI interaction (touch or mouse) by setting the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to mark the region on a PDF. -1. Set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to Text or Rect. It activates the text-based or selected-area Redaction mode on the control. -2. Place your finger (or mouse) on the text in the PDF document, where you want to start redaction. +1. Set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to Text or Rect. It activates the text-based or selected-area redaction mode on the control. +2. Place your finger (or mouse) over the text in the PDF document where you want to start redaction. 3. Drag the finger (or cursor) across the text to select. 4. Complete adding the region to the selected text or area by releasing the finger (or cursor). -5. Once you have done that, set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) to None. It will disable the redaction mode and save the marked region for redaction. -6. You can later redact the marked regions using [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method. +5. Once you have finished marking regions, set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) to None. It will disable the redaction mode. The marked regions will be retained for redaction. +6. You can later redact the marked regions using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method. The following code explains how to enable the text-based redaction mode. @@ -83,7 +99,7 @@ void DisableRedactionMode() ## How to perform redaction programmatically -### Add redaction mark on the PDF +### Add a redaction mark to the PDF You can mark regions for text or specific areas programmatically using the [AddRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), and redact entire pages using the [AddPageRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddPageRedactionMarks_System_Collections_Generic_List_System_Int32__) method. The following example demonstrates how to mark regions for redaction, such as a specific area and page in the PDF document. @@ -102,17 +118,31 @@ void AddRedactionMarkOnSpecificRegionAndPages() PdfViewer.AddRedactionMark(redactionMark); // Add redaction marks to specific pages (pages 3, 5, and 1). - PdfViewer.AddPageRedactionMarks(new List([3, 5, 1])); + PdfViewer.AddPageRedactionMarks(new List { 3, 5, 1 }); } {% endhighlight %} {% endtabs %} -### Remove the selected redaction mark on the PDF +### Redact the marked region -You can remove a redaction mark for text, a specific area, or a page programmatically using the [SelectedRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectedRedactionMark) property and the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of SfPdfViewer. To remove a redaction mark, select the specific mark you want to delete and pass it to the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method. The following example demonstrates how to remove a selected redaction mark from the PDF document. +After marking the regions, you can redact them by using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This method redacts all marked regions and saves the document, making the changes irreversible. The following example demonstrates how to redact a marked region or page in a PDF document. {% tabs %} -{% highlight C# %} +{% highlight c# %} +private async void RedactMarkedRegion() +{ + // Apply redaction to all marked regions in the PDF document. + await PdfViewer.RedactAsync(); +} +{% endhighlight %} +{% endtabs %} + +### Remove the selected redaction mark + +You can remove a redaction mark for text, a specific area, or a page programmatically using the [SelectedRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectedRedactionMark) property and the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of the SfPdfViewer. To remove a redaction mark, select the specific mark you want to delete and pass it to the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method. The following example demonstrates how to remove a selected redaction mark from the PDF document. + +{% tabs %} +{% highlight c# %} void RemoveSelectedRedactionMark() { // Check if any redaction mark is currently selected. @@ -125,12 +155,12 @@ void RemoveSelectedRedactionMark() {% endhighlight %} {% endtabs %} -### Remove all the redaction marks in the PDF +### Remove all redaction marks You can remove all redaction marks from a document programmatically by calling the [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method. The following example demonstrates how to remove all redaction marks from a PDF document. {% tabs %} -{% highlight C# %} +{% highlight c# %} void RemoveAllRedactionMarksDrawn() { // Removes all the redaction marks from a PDF document using [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). @@ -139,41 +169,12 @@ void RemoveAllRedactionMarksDrawn() {% endhighlight %} {% endtabs %} -### Redact the marked region - -You can redact the marked regions by using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This method redacts all marked regions and saves the document, making the changes irreversible. The following example demonstrates how to redact a marked region or page in a PDF document. - -{% tabs %} -{% highlight C# %} -private async void RedactMarkedRegion() -{ - // Apply redaction to all marked regions in the PDF document. - await PdfViewer.RedactAsync(); -} -{% endhighlight %} -{% endtabs %} - -## Customize the default redaction appearance - -In redaction mode, the redaction is applied with a default appearance and behavior. You can modify these settings before marking regions on the pages. To define the appearance and behavior, customize the default settings using the [RedactionSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). -The following example demonstrates how to obtain the default redaction settings and modify their appearance properties. Similarly, you can modify other available properties. - -{% tabs %} -{% highlight C# %} -void CustomizeDefaultRedactionSettings() -{ - // Access the default redaction settings from the SfPdfViewer instance and modify the default appearance properties. - PdfViewer.RedactionSettings.MarkerBorderColor = Colors.Blue; // Border color for the marked region. - PdfViewer.RedactionSettings.FillColor = Colors.Red; // Fill color after redaction is applied. - PdfViewer.RedactionSettings.FontColor = Colors.Black; // Font color for overlay text. - PdfViewer.RedactionSettings.OverlayText = "text"; // Text to display on the redacted area. - PdfViewer.RedactionSettings.IsRepeat = true; // Repeat overlay text across the redacted area. -} -{% endhighlight %} -{% endtabs %} - ## See Also + - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) - [Text Search](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/text-search) - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) - [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [Open a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/open-a-document) +- [Print a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/print-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md b/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md index 5468d2d858..038b8348f5 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Scrolling.md @@ -14,7 +14,7 @@ Keep document navigation smooth and predictable by using the PDF Viewer's built- W> Since the PDF Viewer includes built-in scrolling, avoid placing it inside other scrollable containers like [ScrollView](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/scrollview?view=net-maui-8.0), as this may lead to unexpected behavior. -## Programmatic Scrolling +## Programmatic scrolling Use the [ScrollToOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ScrollToOffset_System_Double_System_Double_) method to scroll to a specific horizontal and vertical offset. Offset values are measured in **device-independent units**. If the specified offset is invalid or out of bounds, the scroll action will be ignored and the viewer will retain its current position. @@ -25,11 +25,11 @@ PdfViewer.ScrollToOffset(100, 1000); {% endhighlight %} {% endtabs %} -## Detect Scroll Changes +## Detect scroll changes -You can monitor scroll changes using the `PropertyChanged` event. By monitoring the [HorizontalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_HorizontalOffset) and [VerticalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_VerticalOffset) property changes, you can respond to both the horizontal and vertical scroll movements respectively. +You can monitor scroll changes using the `PropertyChanged` event. By monitoring the [HorizontalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_HorizontalOffset) and [VerticalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_VerticalOffset) property changes, you can respond to horizontal and vertical scroll movements. -The following is the code example for subscribing to the `PropertyChanged` event. +The following code example shows how to subscribe to the `PropertyChanged` event. {% tabs %} {% highlight XAML %} @@ -50,7 +50,7 @@ void SubscribeToPropertyChangedEvent() {% endhighlight %} {% endtabs %} -The following code example illustrates how implement the event handler and to respond to both horizontal and vertical scroll changes: +The following code example illustrates how to implement the event handler and respond to both horizontal and vertical scroll changes: {% tabs %} {% highlight c# %} @@ -71,15 +71,15 @@ private void PdfViewer_PropertyChanged(object sender, {% endhighlight %} {% endtabs %} -## Detecting End of Document +## Detecting end of document You can determine if the control has reached the vertical end of the document by evaluating the following properties: -* `VerticalOffset`: It provides the current vertically scrolled offset. -* `ClientRectangle`: It provides the viewport area bounds. -* `ExtentHeight`: It provides the overall vertical height of the PDF document. +* `VerticalOffset`: Provides the current vertical scroll offset. +* `ClientRectangle`: Provides the viewport area bounds. +* `ExtentHeight`: Provides the overall vertical height of the PDF document. -Below is the code example to detect whether the control has reached the vertical end of the document. +The following code example detects whether the control has reached the vertical end of the document. {% tabs %} {% highlight c# %} @@ -110,7 +110,6 @@ private void PdfViewer_PropertyChanged(object sender, PdfViewer.ClientRectangle.Width >= PdfViewer.ExtentWidth); } } - {% endhighlight %} {% endtabs %} @@ -118,7 +117,7 @@ private void PdfViewer_PropertyChanged(object sender, On Android and iOS platforms, the scroll head offers a quick way to move through pages. Users can drag the thumb indicator to scroll within the PDF document. -![Scroll Head](Images\ScrollHead.png) +![Scroll head](Images/ScrollHead.png) ### Show or Hide the Scroll Head @@ -139,7 +138,7 @@ When scrolling through large PDF documents, you may notice blank pages appearing To minimize this and provide a smoother scrolling experience, the SfPdfViewer control offers the `OverscanCount` property. This property defines how many pages should be pre-rendered and kept in memory on each side of the current viewport. Increasing this value reduces the chance of blank pages during fast scrolling but may increase memory usage. -The following example shows how to set `OverscanCount` property: +The following example shows how to set the `OverscanCount` property: {% tabs %} {% highlight xaml %} @@ -148,20 +147,21 @@ The following example shows how to set `OverscanCount` property: {% endhighlight %} {% highlight c# %} -SfPdfViewer PdfViewer = new SfPdfViewer(); - // Set the cache range (number of pages before and after the current viewport) PdfViewer.OverscanCount = 15; - -// Load a PDF document -PdfViewer.LoadDocument("sample.pdf"); {% endhighlight %} {% endtabs %} -N> - Use a reasonable OverscanCount value. Large values can cause memory spikes and app freezes. -N> - Pages with very high resolution may still render slowly due to native rendering limitations. +**Note:** +* Use a reasonable `OverscanCount` value. Large values can cause memory spikes and app freezes. +* Pages with very high resolution may still render slowly due to native rendering limitations. ## See Also + - [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/page-navigation) - [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/magnification) - [Gesture Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/gesture-events) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [UI Customization](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ui-customization) +- [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/getting-started) +- [Coordinate Conversion](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/coordinates-conversion) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md b/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md index a43874cbac..39557b0c21 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md @@ -10,24 +10,24 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, mau # Shape Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The shape annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove and modify shapes in the PDF document. This is useful for making corrections or emphasizing important points in the document. This section will go through the various types and functions available in the PDF Viewer for working with shape annotations. +The shape annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify shapes in the PDF document. This is useful for making corrections or emphasizing important points in the document. This section explains the various types and functions available in the PDF Viewer for working with shape annotations. ## Types of shapes -The following shape annotation types are now available in the PDF Viewer. +The following shape annotation types are available in the PDF Viewer. -1. Arrow -2. Circle. -3. Line. -4. Square. -5. Polygon. -6. Polyline. +1. Arrow +2. Circle +3. Line +4. Square +5. Polygon +6. Polyline ## Add shapes to a PDF document -This section will cover how to add shape annotations to a PDF document using a toolbar as well as programmatically. +This section explains how to add shape annotations to a PDF document using the built-in toolbar as well as programmatically. -### Add shapes using the toolbar +### Add shapes using the toolbar A shape annotation tool with seven different sorts of annotations (arrow, circle, square, line, polygon, polyline, and cloud) is accessible on the built-in toolbar. Users are able to select any of these shapes and draw them on the page at any desired location. Additionally, the toolbar allows modification of properties for both existing and new annotations of the selected shape. @@ -51,9 +51,9 @@ You can interactively draw and add shape annotations to a PDF document by touch 6. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). This will disable the circle drawing mode and save the drawn circles to the PDF pages as circle annotations. 7. You can later move, resize, or edit the annotation. -### Add Polygon and Polyline shapes +### Add polygon and polyline shapes -Adding polygon and polyline shapes with touch or mouse will vary slightly from adding other shape types. To add it interactively, refer to the following steps. +Adding polygon and polyline shapes with a touch or mouse differs slightly from adding other shape types. To add one interactively, refer to the following steps. 1. Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [Polygon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Polygon) or [Polyline](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Polyline). It sets the control’s drawing mode to polygon or polyline, respectively. 2. To begin drawing the shape, tap the desired location on the screen (using touch or mouse). @@ -118,7 +118,7 @@ CircleAnnotation CreateCircleAnnoation() void AddCircleAnnotation() { - Annotation circleAnnotation = CreateCircleAnnoation(); + Annotation circleAnnotation = CreateCircleAnnotation(); //Add the circle annotation to the PDF document using the AddAnnotation method of the `SfPdfViewer` instance. PdfViewer.AddAnnotation(circleAnnotation); @@ -133,7 +133,7 @@ In the shape annotation mode, the shape annotations will be drawn with a default The following example explains how to obtain the default circle annotation settings and modify some of its properties. Similarly, you can also modify the properties of other shape annotations. {% tabs %} -{% highlight C# %} +{% highlight c# %} void CustomizeDefaultCircleSettings() { //Obtain the default circle annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. @@ -151,7 +151,7 @@ void CustomizeDefaultCircleSettings() ## Edit the selected shape annotation -You can edit the properties of the selected shape annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected circle annotation. Similarly, you can modify the other shape annotation properties. +You can edit the properties of the selected shape annotation programmatically by accessing the selected annotation instance. You can obtain the selected annotation instance from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected circle annotation. Similarly, you can modify the other shape annotation properties. {% tabs %} {% highlight C# %} @@ -159,7 +159,7 @@ You can edit the properties of the selected shape annotation programmatically by /// Edit the selected circle annotation. /// /// The selected annotation instance that may be obtained from the annotation selected event -void EditSelectedCicleAnnotation(Annotation selectedAnnotation) +void EditSelectedCircleAnnotation(Annotation selectedAnnotation) { // Typecast the selected annotation as a circle annotation. if (selectedAnnotation is CircleAnnotation circleAnnotation) @@ -175,42 +175,41 @@ void EditSelectedCicleAnnotation(Annotation selectedAnnotation) ## Border styles for shape annotation [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to change the shape annotations' border style. Currently, it provides support for the following border styles. -1. Cloudy -2. Solid +1. Cloudy +2. Solid N> By default, the border style of the shape annotations is solid. The value of `BorderStyle` property is applicable only for square and polygon annotations only and it does not affect other shape annotations such as circle, line, arrow, and polyline annotations. -### Draw cloud shaped annotation +### Draw a cloud-shaped annotation -To draw a cloud annotation, set the annotation mode to either [AnnotationMode.Square](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html) or [AnnotationMode.Polygon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html). Then you should set the `BorderStyle` property of the shape annotation settings to `BorderStyle.Cloudy`. The following sample code illustrates how to draw a rectangle and polygon annotation with the cloud border style. +To draw a cloud annotation, set the annotation mode to either [AnnotationMode.Square](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html) or [AnnotationMode.Polygon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html). Then you should set the `BorderStyle` property of the shape annotation settings to `BorderStyle.Cloudy`. The following sample code illustrates how to draw a square and polygon annotation with the cloud border style. {% tabs %} -{% highlight C# %} +{% highlight c# %} // Draw square cloud annotation - SfPdfViewer pdfViewer = new SfPdfViwer(); - pdfViewer.AnnotationMode = AnnotationMode.Square; - pdfViewer.AnnotationSettings.Rectangle.BorederStyle = BorderStyle.Cloudy; + PdfViewer.AnnotationMode = AnnotationMode.Square; + PdfViewer.AnnotationSettings.Rectangle.BorderStyle = BorderStyle.Cloudy; {% endhighlight %} {% endtabs %} {% tabs %} -{% highlight C# %} +{% highlight c# %} - // Draw polygon cloud annotation - pdfViewer.AnnotationMode = AnnotationMode.Polygon; - pdfViewer.AnnotationSettings.Rectangle.BorederStyle = BorderStyle.Cloudy; + // Draw polygon cloud annotation + PdfViewer.AnnotationMode = AnnotationMode.Polygon; + PdfViewer.AnnotationSettings.Polygon.BorderStyle = BorderStyle.Cloudy; {% endhighlight %} {% endtabs %} ### Change the border style for the selected polygon annotation -You can change the border style of the selected polygon annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to change the border style of selected polygon annotation. Similarly, you can modify the square annotations border style. +You can change the border style of the selected polygon annotation programmatically by accessing the selected annotation instance. You can obtain the selected annotation instance from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to change the border style of the selected polygon annotation. Similarly, you can modify the square annotation's border style. {% tabs %} -{% highlight C# %} +{% highlight c# %} /// /// Change the selected shape annotation border style. /// @@ -218,11 +217,10 @@ You can change the border style of the selected polygon annotation programmatica void ChangeBorderStyleOfSelectedPolygonAnnotation(Annotation selectedAnnotation) { // Typecast the selected annotation as polygon annotation. - if (selectedAnnotation is PolygonAnnotation polygonAnnotation) - { - polygonAnnotation.BorderStyle = BorderStyle.Cloudy; // Change the border style to cloud. - } - + if (selectedAnnotation is PolygonAnnotation polygonAnnotation) + { + polygonAnnotation.BorderStyle = BorderStyle.Cloudy; // Change the border style to cloud. + } } {% endhighlight %} {% endtabs %} @@ -235,43 +233,49 @@ You can add cloud annotation to a PDF document using the built-in toolbar. ![Drawing cloud in mobile](Images/Annotations/mobile-cloud.gif) -### Add cloud shape annotation programmatically -You can create and add cloud polygon annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a cloud polygon annotation and add it to the first page of a PDF document. Similarly, you can add a square also. +### Add a cloud shape annotation programmatically + +You can create and add a cloud polygon annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a cloud polygon annotation and add it to the first page of a PDF document. Similarly, you can add a square. {% tabs %} -{% highlight C# %} -PolygonAnnotation CreateCloudAnnoation() +{% highlight c# %} +PolygonAnnotation CreateCloudAnnotation() { int pageNumber = 1; // Define the points for the polygon in the PDF coordinates. - List polygonPoints = new List - { new PointF(10, 10), - new PointF(100, 10), - new PointF(100, 100), - new PointF(10, 100) - }; + List polygonPoints = new List + { new PointF(10, 10), + new PointF(100, 10), + new PointF(100, 100), + new PointF(10, 100) + }; // Create a cloud border style polygon annotation. - PolygonAnnotation annotation = new PolygonAnnotation (polygonPoints, pageNumber); - + PolygonAnnotation annotation = new PolygonAnnotation(polygonPoints, pageNumber); + // Set the border style appearance for the polygon annotation. - annotation.BorderStyle = BorderStyle.Cloudy // set the border style + annotation.BorderStyle = BorderStyle.Cloudy; // set the border style return annotation; } void AddCloudAnnotation() { - Annotation polygonAnnotation = CreateCloudAnnoation(); + Annotation polygonAnnotation = CreateCloudAnnotation(); //Add the cloud border style polygon annotation to the PDF document using the AddAnnotation method of the `SfPdfViewer` instance. - PdfViewer.AddAnnotation(polygonAnnotation ); + PdfViewer.AddAnnotation(polygonAnnotation); } {% endhighlight %} {% endtabs %} ## See Also + - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) -- [Add, Remove, and Modify Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) +- [Add, Remove, and Edit Annotations](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/add-remove-modify-annotations) - [Undo and Redo](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/undo-redo) +- [Comments](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-comment) +- [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar) +- [Free Text](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/free-text) +- [Ink](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/ink) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md b/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md index 13eda6edb0..4a425c385c 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Undo and Redo in .NET MAUI PDF Viewer (SfPdfViewer) -If you performed any undesired actions when adding, removing, moving, resizing or editing annotations, you can undo and redo the action to restore the previous state. This section will go through how to perform the undo and redo the changes made on the annotations. +If you performed any undesired actions when adding, removing, moving, resizing, or editing annotations, you can undo and redo the action to restore the previous state. This section explains how to undo and redo changes made to annotations. For desktop platforms such as Windows and macOS, you can also use the following shortcut keys to perform the actions. @@ -34,14 +34,14 @@ For desktop platforms such as Windows and macOS, you can also use the following ## Undo -You can perform undo to reverse the most recent action performed on the annotations using the [UndoCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UndoCommand) of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code examples explain how to bind the command to a button in XAML to perform the action on button click, and also execute the command programmatically as well. +You can undo the most recent action performed on the annotations using the [UndoCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UndoCommand) of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code examples show how to bind the command to a button in XAML to perform the action on button click, and how to execute the command programmatically. {% tabs %} -{% highlight XAML %} +{% highlight xaml %} + {% endhighlight %} {% endtabs %} -**Using asynchronous search methods** +## Using Asynchronous Search Methods The PDF viewer allows the users to perform text search asynchronously using the [SearchTextAsync](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_SearchTextAsync_System_String_System_Threading_CancellationToken_) method. The user can also cancel the asynchronous text search when it is in progress. @@ -135,7 +137,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void SearchButton_Click(object sender, RoutedEventArgs e) { - //Searches for the text in the PDF Document. + // Searches for the text in the PDF document. pdfViewer.SearchTextAsync(targetText, cts.Token); } @@ -158,7 +160,7 @@ CancellationTokenSource cts = new CancellationTokenSource(); private void SearchNextButton_Click(object sender, RoutedEventArgs e) { - //Searches for the next text instance in the PDF Document. + // Searches for the next text instance in the PDF document. pdfViewer.SearchNextTextAsync(targetText, cts.Token); } @@ -179,7 +181,7 @@ CancellationTokenSource cts = new CancellationTokenSource(); private void SearchPreviousButton_Click(object sender, RoutedEventArgs e) { - //Searches for the previous instance of the text in the PDF Document. + // Searches for the previous instance of the text in the PDF document. pdfViewer.SearchPreviousTextAsync(targetText, cts.Token); } diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md index 8fc9a60c41..bc70d6b7cd 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md @@ -19,14 +19,14 @@ You can create a **UWP Application** using Visual Studio via [Microsoft Template ## Assemblies Deployment -You can add a UWP PdfViewer component to your application by installing it via NuGet packages (recommended) or by manually adding the required assemblies to the project. +You can add a UWP PDF Viewer component to your application by installing it via NuGet packages (recommended) or by manually adding the required assemblies to the project. {% tabcontents %} {% tabcontent NuGet Package %} -### Install Syncfusion® UWP PdfViewer NuGet Package +### Install Syncfusion® UWP PDF Viewer NuGet Package -To add **UWP PdfViewer** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: +To add the **UWP PDF Viewer** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: • [Syncfusion.SfPdfViewer.UWP](https://www.nuget.org/packages/Syncfusion.SfPdfViewer.UWP) @@ -34,9 +34,9 @@ To add **UWP PdfViewer** component in the application, open the NuGet package ma {% tabcontent Assemblies (.dll) %} -### Add Syncfusion® UWP PdfViewer Assemblies +### Add Syncfusion® UWP PDF Viewer Assemblies -Below table describes, list of assemblies required to be added in project when the UWP PdfViewer control is used in your application. +The following table lists the assemblies required when the UWP PDF Viewer control is used in your application. @@ -69,21 +69,25 @@ Below table describes, list of assemblies required to be added in project when t
    -Each assembly must be placed together with its corresponding resource files (i.e., the resource files for an assembly should reside in the same folder as that assembly). The assemblies do not all have to be in a single folder — each assembly may live in its own folder so long as its resource files are kept alongside it. The screenshot shows only the SfPdfViewer assembly for brevity. +Each assembly must be placed together with its corresponding resource files; that is, the resource files for an assembly should reside in the same folder as that assembly. + +The assemblies do not all have to be in a single folder. Each assembly may live in its own folder, as long as its resource files are kept alongside it. The screenshot shows only the SfPdfViewer assembly for brevity. ![Dependent assemblies needed for SfPdfViewerControl](Getting-Started_images/Getting-Started_img3.jpeg) This co-location matters only if you move assemblies out of their installed location. If you relocate an assembly, be sure to move its resource files with it and place them in the same folder as that assembly. -N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your UWP application to use our components. - {% endtabcontent %} {% endtabcontents %} -## Add UWP PdfViewer component +## Licensing + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to register the Syncfusion® license key in your UWP application to use our components. + +## Add UWP PDF Viewer component -UWP PdfViewer control can be added to an application either through the designer (XAML) or programmatically using code. +UWP PDF Viewer control can be added to an application either through the designer (XAML) or programmatically using code. Use the **Via Designer** tab if you prefer a drag-and-drop workflow; use the **Via Coding** tab if you want to add the control directly in XAML or C#. {% tabcontents %} @@ -95,7 +99,7 @@ UWP PdfViewer control can be added to an application either through the designer ![SfPdfViewerControl in visual studio toolbox](Getting-Started_images/Getting-Started_img1.jpeg) -3. Drag `SfPdfViewerControl`(https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) and drop in to the Designer area from the Toolbox. +3. Drag the [`SfPdfViewerControl`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) and drop it into the Designer area from the Toolbox. When you drag the SfPdfViewerControl toolbox item to the window, it automatically adds the required assembly references to the current application. @@ -103,9 +107,9 @@ When you drag the SfPdfViewerControl toolbox item to the window, it automaticall {% tabcontent Via Coding %} -The SfPdfViewerControl is available in the following namespace [_Syncfusion.Windows.PdfViewer_](https://help.syncfusion.com/cr/UWP/Syncfusion.Windows.PdfViewer.html) and it can be created using XAML or programmatically using C#. +The SfPdfViewerControl is available in the [`Syncfusion.Windows.PdfViewer`](https://help.syncfusion.com/cr/UWP/Syncfusion.Windows.PdfViewer.html) namespace and can be created using XAML or programmatically using C#. -1. Add the Syncfusion PdfViewer namespace +1. Add the Syncfusion PDF Viewer namespace. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} xmlns:syncfusion="using:Syncfusion.Windows.PdfViewer" @@ -131,6 +135,7 @@ After adding the `SfPdfViewerControl`, you can load a PDF document using data bi 2. Create a simple class (`PdfReport.cs`) that provides the PDF stream. +N> Replace `PdfViewerExample` in the manifest resource path below with your project's default namespace. {% tabs %} {% highlight c# tabtitle="PdfReport.cs" %} @@ -245,4 +250,6 @@ Press Ctrl+F5 (Windows) or +F5 (m - [Viewing PDF](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/viewing-pdf) - [UWP PDF Viewer Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/overview) - [Magnification](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-magnification) +- [Page Navigation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-page-navigation) +- [Text Search](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/uwp/concepts-and-features/working-with-text-search) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md b/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md index 4dda7479f4..8350a61188 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/How-to/Customize-the-scrollbar.md @@ -7,11 +7,13 @@ control: PDF viewer documentation: ug --- -# Customize the scrollbar in UWP PDF Viewer +# Customize the Scrollbar in UWP PDF Viewer + +This section explains how to customize the scrollbar appearance and width in the SfPdfViewer control. ## Customize the color of the scrollbar thumb -The PDF viewer uses the [ScrollViewer] (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-19041) control to scroll the pages of a PDF. The color of the vertical and horizontal scrollbar thumbs can be customized using the following code. +The PDF Viewer uses the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-19041) control to scroll the pages of a PDF. The color of the vertical and horizontal scrollbar thumbs can be customized using the following code. {% tabs %} {% highlight xaml %} @@ -28,14 +30,14 @@ The PDF viewer uses the [ScrollViewer] (https://docs.microsoft.com/en-us/uwp/api ## Customize the width of the vertical scrollbar -The width of the vertical scrollbar of the [ScrollViewer](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) can be modified by using the [VerticalScrollBarWidth](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_VerticalScrollBarWidth) property. The default value of the API is as same as the default width of the vertical scrollbar of the [ScrollViewer](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) control. +The width of the vertical scrollbar of the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) can be modified by using the [`VerticalScrollBarWidth`](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html#Syncfusion_Windows_PdfViewer_SfPdfViewerControl_VerticalScrollBarWidth) property. The default value of this property matches the default width of the vertical scrollbar of the [`ScrollViewer`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer?view=winrt-20348) control. {% tabs %} {% highlight c# %} -//Sets the width of the vertical scrollbar in the PDF Viewer. -pdfViewerControl.VerticalScrollBarWidth = 100; -//Gets the width of the vertical scrollbar in the PDF Viewer. +// Sets the width of the vertical scrollbar in the PDF Viewer. +pdfViewerControl.VerticalScrollBarWidth = 100; +// Gets the width of the vertical scrollbar in the PDF Viewer. double verticalScrollBarWidth = pdfViewerControl.VerticalScrollBarWidth; {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md b/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md index 92c2810dcd..753e2303d6 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Overview.md @@ -9,7 +9,7 @@ documentation: ug # UWP PDF Viewer (SfPdfViewer) Overview -The [PDF viewer](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) for Universal Windows Platform is a native control for viewing and printing PDF documents. The control internally makes use of the Windows rendering engine (Windows.Data.Pdf) for rendering the pages of the PDF document. +The [PDF viewer](https://help.syncfusion.com/cr/uwp/Syncfusion.Windows.PdfViewer.SfPdfViewerControl.html) for Universal Windows Platform is a native control for viewing and printing PDF documents. The control uses the Windows rendering engine (`Windows.Data.Pdf`) to render the pages of the PDF document. ## In This Section From 20bc0f504ff8649334ba6222b8800c42da392dad Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Tue, 14 Jul 2026 13:45:19 +0530 Subject: [PATCH 085/127] Addressed feedbacks --- .../PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md | 2 +- Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md index 475ef823ae..ae20d2ba8d 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Concepts-and-Features/Hyperlink.md @@ -9,7 +9,7 @@ documentation: ug # Hyperlink in UWP PDF Viewer (SfPdfViewer) -The PdfViewer control supports hyperlink navigation that detects document links and web links present in the PDF document pages. Tapping a table of contents (TOC) entry or hyperlink behaves as follows: +The PDF Viewer control supports hyperlink navigation that detects document links and web links present in the PDF document pages. Tapping a table of contents (TOC) entry or hyperlink behaves as follows: 1) If the tapped text contains a web link, the URI associated with the hyperlink is opened in the default browser. diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md index bc70d6b7cd..9660fb0ca8 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md @@ -81,8 +81,6 @@ This co-location matters only if you move assemblies out of their installed loca {% endtabcontents %} -## Licensing - N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to register the Syncfusion® license key in your UWP application to use our components. ## Add UWP PDF Viewer component From d85881eb4e314b843357df905a01a56b0e3fb471 Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Tue, 14 Jul 2026 13:52:49 +0530 Subject: [PATCH 086/127] addressed feedback --- Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md index 9660fb0ca8..0e5ce48b6e 100644 --- a/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/uwp/Getting-Started.md @@ -77,12 +77,12 @@ The assemblies do not all have to be in a single folder. Each assembly may live This co-location matters only if you move assemblies out of their installed location. If you relocate an assembly, be sure to move its resource files with it and place them in the same folder as that assembly. +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to register the Syncfusion® license key in your UWP application to use our components. + {% endtabcontent %} {% endtabcontents %} -N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to register the Syncfusion® license key in your UWP application to use our components. - ## Add UWP PDF Viewer component UWP PDF Viewer control can be added to an application either through the designer (XAML) or programmatically using code. Use the **Via Designer** tab if you prefer a drag-and-drop workflow; use the **Via Coding** tab if you want to add the control directly in XAML or C#. From cfa5937043e49f1797529a94bdc716312d6b71d5 Mon Sep 17 00:00:00 2001 From: jeyalakshmit Date: Wed, 15 Jul 2026 13:06:18 +0530 Subject: [PATCH 087/127] 1039209_feedback code changes --- .../NET/NuGet-Packages-Required.md | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md b/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md index 282cf298d0..63d938f09a 100644 --- a/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md +++ b/Document-Processing/PDF/PDF-Library/NET/NuGet-Packages-Required.md @@ -138,7 +138,7 @@ For advanced PDF features like compression, redaction, PDF/A conversion, image e -**RETIRED PRODUCTS** +To convert XPS documents to PDF, install the following required NuGet packages in your .NET application. @@ -150,18 +150,27 @@ For advanced PDF features like compression, redaction, PDF/A conversion, image e - + + + + +
    - Xamarin + ASP.NET Core (Targeting NET Core) + Console Application (Targeting .NET Core) + Blazor - {{'[Syncfusion.Xamarin.Pdf.Imaging.nupkg](https://www.nuget.org/packages/Syncfusion.Xamarin.Pdf.Imaging)'| markdownify }} + {{'[Syncfusion.XpsToPdfConverter.Net.Core.nupkg](https://www.nuget.org/packages/Syncfusion.XpsToPdfConverter.Net.Core)'| markdownify }}
    + Windows UI (WinUI) + .NET Multi-platform App UI (.NET MAUI) + + {{'[Syncfusion.XpsToPdfConverter.NET.nupkg](https://www.nuget.org/packages/Syncfusion.XpsToPdfConverter.NET)'| markdownify }} +
    -### Converting XPS to PDF - -To convert XPS documents to PDF, install the following required NuGet packages in your .NET application. +**RETIRED PRODUCTS** @@ -173,10 +182,10 @@ To convert XPS documents to PDF, install the following required NuGet packages i From aa7e062bd0d3fdb7adce22926305d6dfd01fc02b Mon Sep 17 00:00:00 2001 From: Mugesh Date: Wed, 15 Jul 2026 13:40:20 +0530 Subject: [PATCH 088/127] Updated Documentation Licensing Page --- .../Licensing/licensing-faq/CI-license-validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/Licensing/licensing-faq/CI-license-validation.md b/Document-Processing/Licensing/licensing-faq/CI-license-validation.md index a457a82033..681f0cd751 100644 --- a/Document-Processing/Licensing/licensing-faq/CI-license-validation.md +++ b/Document-Processing/Licensing/licensing-faq/CI-license-validation.md @@ -179,7 +179,7 @@ bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.FileFormats); {% endhighlight %} {% endtabs %} -N> Use the specific platform enum (`PDF`, `Word`, `Excel`, `PowerPoint`, `WordToPDF`, `ExcelToPDF`, `PowerPointToPDF`, `PDFViewer`, `WordEditor`, or `SpreadsheetEditor`) for license validation from v31.1.17 and later. `Platform.FileFormats` is not supported from v31.1.17 onwards. +N> Use the specific platform enum (`PDF`, `Word`, `Excel`, `PowerPoint`, `WordToPDF`, `ExcelToPDF`, or `PowerPointToPDF`) for license validation from v31.1.17 and later. `Platform.FileFormats` is not supported from v31.1.17 onwards. * If the `ValidateLicense()` method returns `true`, the registered license key is valid and the build can proceed with deployment. From 58b42ec057800afea4d0087b953a4978eaf8af78 Mon Sep 17 00:00:00 2001 From: YathavakrishnanMohan <169874568+YathavakrishnanMohan@users.noreply.github.com> Date: Mon, 6 Jul 2026 19:36:21 +0530 Subject: [PATCH 089/127] Task(1039012): Update WPF PDFViewer Getting started content hotfix --- .../PDF/PDF-Viewer/wpf/Getting-Started.md | 151 +++++++++--------- 1 file changed, 78 insertions(+), 73 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/wpf/Getting-Started.md index 17371cbf03..0015599a2d 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Getting-Started.md @@ -110,7 +110,10 @@ WPF PdfViewer control can be added to an application either through the designer {% tabs %} {% highlight xaml tabtitle="MainWindow.xaml" %} - @@ -143,82 +146,84 @@ To add control manually from code, follow these steps, 1. Add the required assemblies as a reference to the project. 2. Add the following Syncfusion®; namespace in MainWindow.xaml.cs. -{% tabs %} -{% highlight c# tabtitle="C#" %} -using Syncfusion.Windows.PdfViewer; -{% endhighlight %} -{% endtabs %} + {% tabs %} + {% highlight c# tabtitle="C#" %} + using Syncfusion.Windows.PdfViewer; + {% endhighlight %} + {% endtabs %} 3. Create a PdfViewerControl instance and add it to the main window. -{% tabs %} -{% highlight c# tabtitle="C#" %} -using Syncfusion.Windows.PdfViewer; -using System.Windows; - -namespace PdfViewerDemo -{ - /// - /// Interaction logic for Window1.xaml - /// - public partial class MainWindow : Window - { - # region Constructor - public MainWindow() - { - InitializeComponent(); - PdfViewerControl pdfViewer = new PdfViewerControl(); - HomeGrid.Children.Add(pdfViewer); - } - #endregion - } -} -{% endhighlight %} -{% endtabs %} - -4. The following example code demonstrate how to apply the FluentDark theme to PDF Viewer control in MainWindow.xaml.cs . + {% tabs %} + {% highlight c# tabtitle="C#" %} + using Syncfusion.Windows.PdfViewer; + using System.Windows; + + namespace PdfViewerDemo + { + /// + /// Interaction logic for Window1.xaml + /// + public partial class MainWindow : Window + { + # region Constructor + public MainWindow() + { + InitializeComponent(); + PdfViewerControl pdfViewer = new PdfViewerControl(); + HomeGrid.Children.Add(pdfViewer); + } + #endregion + } + } + {% endhighlight %} + {% endtabs %} + +4. The following example code demonstrate how to apply the FluentDark theme to PDF Viewer control in MainWindow.xaml.cs using SfSkinManager. -{% tabs %} -{% highlight c# tabtitle="C#" %} - -public MainWindow() -{ - InitializeComponent(); - //Initialize PDF Viewer. - PdfViewerControl pdfViewer1 = new PdfViewerControl(); - HomeGrid.Children.Add(pdfViewer); - - //Apply the theme to PDFViewer. - SfSkinManager.ApplyThemeAsDefaultStyle = true; - SfSkinManager.SetTheme(pdfViewer, new Theme() { ThemeName = "FluentDark" }); - pdfViewer.Load(@"../../PDF_Succinctly.pdf"); -} - -{% endhighlight %} - -{% highlight vbnet tabtitle="VB.NET" %} - -Public Sub New() - InitializeComponent() - 'Initialize PDF Viewer. - Dim pdfViewer As PdfViewerControl = New PdfViewerControl() - HomeGrid.Children.Add(pdfViewer) - - 'Apply the theme to PDFViewer. - SfSkinManager.ApplyThemeAsDefaultStyle = True - SfSkinManager.SetTheme(pdfViewer, New Theme() With { - .ThemeName = "FluentDark" - }) - pdfViewer.Load("../../PDF_Succinctly.pdf") -End Sub - -{% endhighlight %} -{% endtabs %} - - -{% endtabcontent %} - -{% endtabcontents %} + {% tabs %} + {% highlight c# tabtitle="C#" %} + + using Syncfusion.Windows.PdfViewer; + using Syncfusion.SfSkinManager; + public MainWindow() + { + InitializeComponent(); + //Initialize PDF Viewer. + PdfViewerControl pdfViewer = new PdfViewerControl(); + HomeGrid.Children.Add(pdfViewer); + + //Apply the theme to PDFViewer. + SfSkinManager.ApplyThemeAsDefaultStyle = true; + SfSkinManager.SetTheme(pdfViewer, new Theme() { ThemeName = "FluentDark" }); + pdfViewer.Load(@"../../PDF_Succinctly.pdf"); + } + + {% endhighlight %} + + {% highlight vbnet tabtitle="VB.NET" %} + + Public Sub New() + InitializeComponent() + 'Initialize PDF Viewer. + Dim pdfViewer As PdfViewerControl = New PdfViewerControl() + HomeGrid.Children.Add(pdfViewer) + + 'Apply the theme to PDFViewer. + SfSkinManager.ApplyThemeAsDefaultStyle = True + SfSkinManager.SetTheme(pdfViewer, New Theme() With { + .ThemeName = "FluentDark" + }) + pdfViewer.Load("../../PDF_Succinctly.pdf") + End Sub + + {% endhighlight %} + {% endtabs %} + + + {% endtabcontent %} + + {% endtabcontents %} N>[View Sample in GitHub.](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/GettingStarted). Looking for the full WPF PDF Viewer component overview, features, pricing, and documentation? Visit the [WPF PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/wpf-pdf-viewer) page. From b40fe1c96e2bceb194825a388a2fe57ba92f0fdb Mon Sep 17 00:00:00 2001 From: YathavakrishnanMohan <169874568+YathavakrishnanMohan@users.noreply.github.com> Date: Thu, 9 Jul 2026 18:32:56 +0530 Subject: [PATCH 090/127] Update UG content using AI agents --- .../Acquiring-current-page-being-displayed.md | 22 ++-- .../wpf/Acquiring-total-number-of-pages.md | 10 +- .../PDF/PDF-Viewer/wpf/Bookmark-Navigation.md | 28 ++-- ...ging-the-color-of-the-Loading-Indicator.md | 8 +- ...text-displayed-in-the-loading-indicator.md | 6 +- .../wpf/Customizing-context-menu.md | 40 +++--- ...Enabling-and-Disabling-Notification-bar.md | 16 ++- .../PDF/PDF-Viewer/wpf/Exporting-PDF.md | 120 +++++++++--------- .../PDF/PDF-Viewer/wpf/Getting-Started.md | 64 +++++----- .../PDF-Viewer/wpf/Handwritten-Signature.md | 105 ++++++++------- ...ew-toolbar-design-to-old-toolbar-design.md | 10 +- .../wpf/How-To/Changing-the-Current-User.md | 14 +- .../wpf/How-To/Disable-toolbar-items.md | 10 +- .../PDF/PDF-Viewer/wpf/Interaction-Modes.md | 6 +- .../PDF/PDF-Viewer/wpf/Localization.md | 18 +-- .../wpf/Magnifying-PDF-documents.md | 30 ++--- .../wpf/Navigating-through-the-pages.md | 8 +- .../PDF/PDF-Viewer/wpf/Organize-Pages.md | 45 +++---- .../PDF/PDF-Viewer/wpf/Printing-PDF-Files.md | 14 +- .../PDF/PDF-Viewer/wpf/Redaction.md | 58 +++++---- .../PDF/PDF-Viewer/wpf/Right-To-Left.md | 9 +- .../PDF-Viewer/wpf/Saving-the-PDF-document.md | 6 +- .../PDF/PDF-Viewer/wpf/Searching-Text.md | 86 +++++++------ .../PDF-Viewer/wpf/Select-and-copy-text.md | 6 +- .../PDF/PDF-Viewer/wpf/Themes.md | 6 +- .../Toggling-visibility-of-the-scroll-bar.md | 12 +- .../Toggling-visibility-of-the-tool-bar.md | 58 ++++----- .../PDF/PDF-Viewer/wpf/Viewing-PDF-Files.md | 84 ++++++------ .../wpf/Working-With-PDF-Coordinates.md | 22 ++-- .../Export-and-Import-Annotations.md | 8 +- .../File-Link-Annotation.md | 6 +- .../Highlight-Annotation.md | 24 ++-- .../Ink-Annotation.md | 22 ++-- .../Working-with-Annotation-Comments.md | 30 ++--- ...rking-with-Annotations-Programmatically.md | 120 ++++++++---------- .../PDF-Viewer/wpf/Working-with-Hyperlinks.md | 115 ++++++++++++----- .../PDF-Viewer/wpf/Working-with-PDF-Layers.md | 10 +- .../wpf/Working-with-Thumbnail-Navigation.md | 12 +- .../Binding-commands-to-a-button.md | 22 ++-- .../PDF-Viewer/wpf/extract-text-from-PDF.md | 22 ++-- .../PDF-Viewer/wpf/forms/form-field-events.md | 11 +- .../PDF-Viewer/wpf/forms/form-fields-api.md | 18 +-- .../PDF/PDF-Viewer/wpf/forms/form-filling.md | 19 ++- .../export-form-fields.md | 26 ++-- .../import-form-fields.md | 16 +-- .../manage-form-fields/add-form-fields.md | 26 ++-- .../manage-form-fields/modify-form-fields.md | 12 +- .../manage-form-fields/remove-form-fields.md | 6 +- .../wpf/password-protected-pdf-files.md | 7 +- .../PDF-Viewer/wpf/pdf-rendering-engines.md | 19 +-- .../PDF-Viewer/wpf/text-extraction-engines.md | 14 +- .../PDF/PDF-Viewer/wpf/ui-builder-skill.md | 6 +- .../PDF-Viewer/wpf/working-with-pdf-pages.md | 20 +-- 53 files changed, 801 insertions(+), 711 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Acquiring-current-page-being-displayed.md b/Document-Processing/PDF/PDF-Viewer/wpf/Acquiring-current-page-being-displayed.md index 9d1b5a3b9b..a121d6cc1e 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Acquiring-current-page-being-displayed.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Acquiring-current-page-being-displayed.md @@ -1,26 +1,28 @@ --- layout: post -title: Acquire current page being displayed in WPF Pdf Viewer | Syncfusion® -description: Learn about Acquire current page being displayed support in Syncfusion®; WPF Pdf Viewer control and more. +title: Acquire the current page being displayed in WPF Pdf Viewer | Syncfusion® +description: Learn about acquiring the current page being displayed support in Syncfusion® WPF Pdf Viewer control and more. platform: document-processing control: PDF Viewer documentation: ug --- -# Acquire current page being displayed in WPF Pdf Viewer +# Acquire the current page being displayed in WPF Pdf Viewer PDF Viewer supports acquiring the index of the page being displayed in the PDF Viewer at any moment using the [CurrentPageIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_CurrentPageIndex) property. The following code example illustrates the same. {% tabs %} {% highlight C# %} +using Syncfusion.Windows.PdfViewer; + //Initialize PDF Viewer. PdfViewerControl pdfViewer1 = new PdfViewerControl(); //Load the PDF. pdfViewer1.Load("Sample.pdf"); -// Acquiring the number of page being displayed in the Viewer -int pageCount = pdfviewer1.CurrentPageIndex; +// Acquiring the index of the page being displayed in the Viewer +int pageIndex = pdfViewer1.CurrentPageIndex; {% endhighlight %} @@ -28,13 +30,15 @@ int pageCount = pdfviewer1.CurrentPageIndex; {% highlight vbnet %} +Imports Syncfusion.Windows.PdfViewer + 'Initialize PDF Viewer. -Private pdfViewer1 As New PdfViewerControl() +Dim pdfViewer1 As New PdfViewerControl() 'Load the PDF. pdfViewer1.Load("Sample.pdf") -' Acquiring the number of page being displayed in the Viewer -Dim pageCount As Integer = pdfviewer1. CurrentPageIndex +' Acquiring the index of the page being displayed in the Viewer +Dim pageIndex As Integer = pdfViewer1.CurrentPageIndex {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Acquiring-total-number-of-pages.md b/Document-Processing/PDF/PDF-Viewer/wpf/Acquiring-total-number-of-pages.md index bc6ec4aac0..77d2521d07 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Acquiring-total-number-of-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Acquiring-total-number-of-pages.md @@ -1,7 +1,7 @@ --- layout: post title: Acquire total number of pages in WPF Pdf Viewer | Syncfusion® -description: Learn about Acquire total number of pages support in Syncfusion®; WPF Pdf Viewer control, its elements and more. +description: Learn how to acquire the total number of pages in Syncfusion® WPF Pdf Viewer control. platform: document-processing control: PDF Viewer documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Acquire total number of pages in WPF Pdf Viewer -PDF Viewer provides the total number of the pages in the PDF document that is being loaded into the PDF Viewer. This value can be acquired with the help of [PageCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_PageCount) property in the PDF Viewer control, the following code example illustrates the same. +PDF Viewer provides the total number of pages in the PDF document that is being loaded. This value can be acquired with the help of the [PageCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_PageCount) property of the PDF Viewer control. The following code example illustrates the same. {% tabs %} {% highlight C# %} @@ -20,7 +20,7 @@ PdfViewerControl pdfViewer1 = new PdfViewerControl(); pdfViewer1.Load("Sample.pdf"); // Acquiring the total number of pages in the document being loaded -int pageCount = pdfviewer1.PageCount; +int pageCount = pdfViewer1.PageCount; {% endhighlight %} @@ -34,6 +34,6 @@ Private pdfViewer1 As New PdfViewerControl() pdfViewer1.Load("Sample.pdf") 'Acquiring the total number of pages in the document being loaded -Dim pageCount As Integer = pdfviewer1.PageCount +Dim pageCount As Integer = pdfViewer1.PageCount {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Bookmark-Navigation.md b/Document-Processing/PDF/PDF-Viewer/wpf/Bookmark-Navigation.md index 9f056e2734..3df0c099d5 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Bookmark-Navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Bookmark-Navigation.md @@ -11,12 +11,12 @@ documentation: ug PDF Viewer control allows users to navigate to the bookmarks present in the loaded PDF document at UI level. -## Steps to perform bookmark navigation in PdfViewerControl. +## Steps to perform bookmark navigation in PdfViewerControl -1. Open the bookmarks contained PDF document to enable the bookmark button in `PdfViewerControl`. -2. Clicking on the bookmark button from the left pane, will list the bookmarks present in the PDF document. -3. To jump to a specific section, click its name in the bookmark pane. -4. If the bookmark has some children, you can explore them by clicking on the “+” button to the left of it. +1. Open the bookmarks contained PDF document to enable the bookmark button in `PdfViewerControl`. +2. Click the bookmark button from the left pane to list the bookmarks present in the PDF document. +3. To jump to a specific section, click its name in the bookmark pane. +4. If the bookmark has some children, you can explore them by clicking on the "+" button to the left of it. ![WPF PDF Viewer Bookmark Button](Bookmark_Navigation_images/wpf-pdf-viewer-bookmark-button.png) @@ -92,7 +92,7 @@ private void PdfViewer_DocumentLoaded(object sender, System.EventArgs args) {% endhighlight %} {% endtabs %} -N>You can also explore our [WPF PDF Viewer example](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/Navigation/Bookmark/Bookmark_Navigation) to know how to Programmatically navigate to a bookmark destination in pdfviewer. +N> You can also explore our [WPF PDF Viewer example](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/Navigation/Bookmark/Bookmark_Navigation) to know how to programmatically navigate to a bookmark destination in pdfviewer. ## Enabling and disabling bookmark feature @@ -120,19 +120,19 @@ pdfViewerControl.IsBookmarkEnabled = false; {% endhighlight %} {% highlight VB %} -'Bookmark feature is disabled +//Bookmark feature is disabled pdfViewerControl.IsBookmarkEnabled = false {% endhighlight %} {% endtabs %} -The following screenshot shown the Bookmark navigation in `PdfViewerControl`, +The following screenshot shows the Bookmark navigation in `PdfViewerControl`, ![WPF PDF Viewer Enabling and Disabling Bookmark Feature](Bookmark_Navigation_images/wpf-pdf-viewer-enabling-and-disabling-bookmark-feature.png) -## Expand bookmark panel Programmatically +## Expand bookmark panel programmatically -The bookmark are displayed by clicking the bookmark icon in the left panel.To display bookmark panel from code behind, use the following code example. +The bookmarks are displayed by clicking the bookmark icon in the left panel. To display the bookmark panel from code behind, use the following code example. {% tabs %} {% highlight C# %} @@ -140,9 +140,9 @@ The bookmark are displayed by clicking the bookmark icon in the left panel.To di private void Window_Loaded(object sender, RoutedEventArgs e) { PdfLoadedDocument pdf = new PdfLoadedDocument("Input.pdf"); - pdfviewer.Load(pdf); + pdfViewer.Load(pdf); //By default, the bookmark panel IsExpanded is false. - pdfviewer.BookMarkSettings.IsExpanded = true; + pdfViewer.BookMarkSettings.IsExpanded = true; } {% endhighlight %} @@ -151,10 +151,10 @@ private void Window_Loaded(object sender, RoutedEventArgs e) {% highlight vbnet %} Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) - Dim pdf As New PdfLoadedDocument(“Input.pdf”) + Dim pdf As New PdfLoadedDocument("Input.pdf") pdfViewer.Load(pdf) 'By default, the bookmark panel IsExpanded is false. - pdfviewer.BookMarkSettings.IsExpanded = true + pdfViewer.BookMarkSettings.IsExpanded = true End Sub {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Changing-the-color-of-the-Loading-Indicator.md b/Document-Processing/PDF/PDF-Viewer/wpf/Changing-the-color-of-the-Loading-Indicator.md index 19f778a664..21cb5066aa 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Changing-the-color-of-the-Loading-Indicator.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Changing-the-color-of-the-Loading-Indicator.md @@ -1,7 +1,7 @@ --- layout: post title: Change Loading Indicator color in WPF Pdf Viewer | Syncfusion® -description: Learn about Change the color of the Loading Indicator support in Syncfusion®; WPF Pdf Viewer control and more. +description: Learn how to change the color of the Loading Indicator in Syncfusion®; WPF Pdf Viewer control and more. platform: document-processing control: PDF Viewer documentation: ug @@ -20,7 +20,7 @@ PdfViewerControl pdfViewer1 = new PdfViewerControl(); pdfViewer1.Load("Sample.pdf"); // Changing the color of the loading indicator to Red -pdfviewer1.LoadingIndicator.LoaderColor = System.Windows.Media.Color.FromArgb(255, 255, 0, 0); +pdfViewer1.LoadingIndicator.LoaderColor = System.Windows.Media.Color.FromArgb(255, 255, 0, 0); {% endhighlight %} @@ -33,7 +33,7 @@ Private pdfViewer1 As New PdfViewerControl() pdfViewer1.Load("Sample.pdf") 'Changing the color of the loading indicator to Red -pdfviewer1.LoadingIndicator.LoaderColor = System.Windows.Media.Color.FromArgb(255, 255, 0, 0) +pdfViewer1.LoadingIndicator.LoaderColor = System.Windows.Media.Color.FromArgb(255, 255, 0, 0) {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Changing-the-text-displayed-in-the-loading-indicator.md b/Document-Processing/PDF/PDF-Viewer/wpf/Changing-the-text-displayed-in-the-loading-indicator.md index 22f1504bff..c15b474fae 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Changing-the-text-displayed-in-the-loading-indicator.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Changing-the-text-displayed-in-the-loading-indicator.md @@ -1,7 +1,7 @@ --- layout: post title: Change the text displayed in WPF Pdf Viewer | Syncfusion® -description: Learn about Change the text displayed in the loading indicator support in Syncfusion®; WPF Pdf Viewer control and more. +description: Learn how to change the text displayed in the loading indicator in the Syncfusion® WPF Pdf Viewer control. platform: document-processing control: PDF Viewer documentation: ug @@ -15,7 +15,7 @@ PDF Viewer allows you to change the text displayed in the loading indicator. The {% highlight C# %} // Changing the text displayed in the loading indicator -pdfviewer1. LoadingIndicator.LoadingMessage = "Document loading"; +pdfviewer1.LoadingIndicator.LoadingMessage = "Document loading"; {% endhighlight %} @@ -27,4 +27,4 @@ pdfviewer1. LoadingIndicator.LoadingMessage = "Document loading"; pdfviewer1.LoadingIndicator.LoadingMessage = "Document loading" {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Customizing-context-menu.md b/Document-Processing/PDF/PDF-Viewer/wpf/Customizing-context-menu.md index fa60b96ad2..39af956d84 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Customizing-context-menu.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Customizing-context-menu.md @@ -1,7 +1,7 @@ --- layout: post title: Customizing context menu in WPF Pdf Viewer | Syncfusion® -description: Learn about Customizing context menu support in Syncfusion®; WPF Pdf Viewer control, its elements and more. +description: Learn about Customizing context menu support in Syncfusion® WPF Pdf Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: ug @@ -22,29 +22,30 @@ Arguments
    - ASP.NET Core + Xamarin - {{'[Syncfusion.XpsToPdfConverter.Net.Core.nupkg](https://www.nuget.org/packages/Syncfusion.XpsToPdfConverter.Net.Core)'| markdownify }} + {{'[Syncfusion.Xamarin.Pdf.Imaging.nupkg](https://www.nuget.org/packages/Syncfusion.Xamarin.Pdf.Imaging)'| markdownify }}
    ContextMenuOpening Event -This Triggered before the context menu is displayed,this event allows users to dynamically modify menu items. +This is triggered before the context menu is displayed, this event allows users to dynamically modify menu items. ContextMenuOpeningEventArgs
    ContextMenuItemClicked Event -This event is triggered when a menu item is clicked,this event enables users to handle menu actions programmatically. +This event is triggered when a menu item is clicked, this event enables users to handle menu actions programmatically. ContextMenuItemClickedEventArgs
    ## How to customize the context menu items before opening. -The `ContextMenuOpening` Event allows users to customize and manage context menus dynamically,based on the source type where the context menu is triggered. This event provides the flexibility to modify, add, or suppress menu items based on the specific operation. +The `ContextMenuOpening` Event allows users to customize and manage context menus dynamically, based on the source type where the context menu is triggered. This event provides the flexibility to modify, add, or suppress menu items based on the specific operation. {% tabs %} {% highlight c# %} -//Wire the `ContextMenuOpening` event. +//Wire the `ContextMenuOpening` event in the code-behind (for example, in the constructor or the Loaded event of the window). pdfViewer.ContextMenuOpening += PdfViewer_ContextMenuOpening; {% endhighlight %} {% endtabs %} -Using the `ContextMenuOpeningEventArgs`, you can add,remove or hide context menu items. +Using the `ContextMenuOpeningEventArgs`, you can add, remove or hide context menu items. Please refer to the following example for more details. + ### Add the context menu item. You can enhance the existing default context menu by adding new menu items to it or inserting them at specific positions based on the source type that triggers the menu. This allows for dynamic customization to suit various use cases, such as adding custom options for annotations, redactions, text selection, or signature fields. {% tabs %} @@ -53,7 +54,7 @@ You can enhance the existing default context menu by adding new menu items to it { if (e.Source == "Annotation") { - e.MenuItems.Insert(0,(new ContextMenuItem { Content = "Lock Annotation" })); + e.MenuItems.Insert(0,(new ContextMenuItem { Content = "Lock Annotation" })); e.MenuItems.Add(new ContextMenuItem { Content = "New Menu Item" }); } if (e.Source == "Redaction") @@ -72,7 +73,7 @@ You can enhance the existing default context menu by adding new menu items to it {% endhighlight %} {% endtabs %} -![Adding new menu item](Customized-ConetextMenu-Images\Customized-Context-Menu-1.png) +![Adding new menu item](Customized-ContextMenu-Images\Customized-Context-Menu-1.png) ### Remove the context menu item. You can remove a menu item from the context menu based on the source type by identifying and matching the item's content. This helps you customize the menu to display only the necessary options. @@ -83,10 +84,10 @@ You can remove a menu item from the context menu based on the source type by ide if (e.Source == "Annotation") { var itemToRemove = e.MenuItems.FirstOrDefault(item => item.Content == "Delete"); - if (itemToRemove != null) - { - e.MenuItems.Remove(itemToRemove); - } + if (itemToRemove != null) + { + e.MenuItems.Remove(itemToRemove); + } } if (e.Source == "Redaction") { @@ -117,9 +118,10 @@ You can remove a menu item from the context menu based on the source type by ide {% endhighlight %} {% endtabs %} -![Remove menu item](Customized-ConetextMenu-Images\Customized-Context-Menu-2.png) -### Hide the context menu item. -You can hide the context menu by setting the `Handled` property to `true` in the `ContextMenuOpening` event.This prevents the menu from being displayed,giving you control over whether the context menu should appear for source types.This helps you manage and customize the behavior of the context menu based on your application's requirements. +![Remove menu item](Customized-ContextMenu-Images\Customized-Context-Menu-2.png) + +### Hide the context menu. +You can hide the context menu by setting the `Handled` property to `true` in the `ContextMenuOpening` event. This prevents the menu from being displayed, giving you control over whether the context menu should appear for source types. This helps you manage and customize the behavior of the context menu based on your application's requirements. {% tabs %} {% highlight c# %} private void PdfViewer_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e) @@ -144,8 +146,8 @@ You can hide the context menu by setting the `Handled` property to `true` in the {% endhighlight %} {% endtabs %} -## How to customized the clicked event for context menu item. -You can customized the context menu clicked event operations in the PDF Viewer control by setting the value of `Handled` to `true` in the `ContextMenuItemClickedEventArgs` parameter within the `ContextMenuItemClickedEvent` event.This allows you to control the behavior of the context menu and prevent any actions from being executed. +## How to customize the clicked event for context menu item. +You can customize the context menu clicked event operations in the PDF Viewer control by setting the value of `Handled` to `true` in the `ContextMenuItemClickedEventArgs` parameter within the `ContextMenuItemClickedEvent` event. This allows you to control the behavior of the context menu and prevent any actions from being executed. Please refer to the following example for more details. {% tabs %} @@ -162,7 +164,7 @@ private void PdfViewer_ContextMenuItemClickedEvent(object sender, ContextMenuIte {% endhighlight %} {% endtabs %} -You can also retrieve the details of the clicked context menu item, including its content and the source type,using the `ContextMenuItemClickedEventArgs` in the `ContextMenuItemClickedEvent` event. +You can also retrieve the details of the clicked context menu item, including its content and the source type, using the `ContextMenuItemClickedEventArgs` in the `ContextMenuItemClickedEvent` event. Please refer to the following example for more details. {% tabs %} {% highlight c# %} @@ -173,4 +175,4 @@ private void PdfViewer_ContextMenuItemClickedEvent(object sender, ContextMenuIte } {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Enabling-and-Disabling-Notification-bar.md b/Document-Processing/PDF/PDF-Viewer/wpf/Enabling-and-Disabling-Notification-bar.md index 57b0eb63de..bac9294cd2 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Enabling-and-Disabling-Notification-bar.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Enabling-and-Disabling-Notification-bar.md @@ -9,30 +9,34 @@ documentation: ug # Enable and Disable Notification bar in WPF Pdf Viewer -Notification bar is a part of the PDF Viewer that is used to display when an unexpected error occurs in the PDF Viewer control. You can suppress the display of the Notification bar by setting the [EnableNotificationBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_EnableNotificationBar) property to false. The following code example illustrate the same. +Notification bar is a part of the PDF Viewer that displays a notification when an unexpected error occurs in the PDF Viewer control. You can suppress the display of the Notification bar by setting the [EnableNotificationBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_EnableNotificationBar) property to `false` (default value is `true`). The following code example illustrates the same. {% tabs %} {% highlight C# %} +using Syncfusion.Windows.PdfViewer; + //Initialize PDF Viewer. PdfViewerControl pdfViewer1 = new PdfViewerControl(); //Load the PDF. pdfViewer1.Load("Sample.pdf"); -// Hiding the scrollbar of the PDF Viewer -pdfviewer1.EnableNotificationBar= false; +// Hiding the notification bar of the PDF Viewer +pdfViewer1.EnableNotificationBar = false; {% endhighlight %} {% highlight vbnet %} +Imports Syncfusion.Windows.PdfViewer + 'Initialize PDF Viewer. Private pdfViewer1 As New PdfViewerControl() 'Load the PDF. pdfViewer1.Load("Sample.pdf") -' Hiding the scrollbar of the PDF Viewer -pdfviewer1.EnableNotificationBar= False +' Hiding the notification bar of the PDF Viewer +pdfViewer1.EnableNotificationBar = False {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Exporting-PDF.md b/Document-Processing/PDF/PDF-Viewer/wpf/Exporting-PDF.md index d749a1e96c..4f0d60263e 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Exporting-PDF.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Exporting-PDF.md @@ -1,7 +1,7 @@ --- layout: post title: Exporting PDF pages in WPF Pdf Viewer control | Syncfusion® -description: Learn about Exporting PDF pages support in Syncfusion®; WPF Pdf Viewer control, its elements and more. +description: Learn how to export PDF pages in the Syncfusion® WPF Pdf Viewer control. platform: document-processing control: PDF Viewer documentation: ug @@ -30,14 +30,14 @@ BitmapSource image = pdfViewer.ExportAsImage(0); string output = @"..\..\Output\Image"; if (image != null) { - //Initialize the new Jpeg bitmap encoder - BitmapEncoder encoder = new JpegBitmapEncoder(); - //Create the bitmap frame using the bitmap source and add it to the encoder - encoder.Frames.Add(BitmapFrame.Create(image)); - //Create the file stream for the output in the desired image format - FileStream stream = new FileStream(output + ".Jpeg", FileMode.Create); - //Save the stream, so that the image will be generated in the output location - encoder.Save(stream); + //Initialize the new Jpeg bitmap encoder + BitmapEncoder encoder = new JpegBitmapEncoder(); + //Create the bitmap frame using the bitmap source and add it to the encoder + encoder.Frames.Add(BitmapFrame.Create(image)); + //Create the file stream for the output in the desired image format + FileStream stream = new FileStream(output + ".Jpeg", FileMode.Create); + //Save the stream, so that the image will be generated in the output location + encoder.Save(stream); } //Dispose the document loadedDocument.Dispose(); @@ -58,14 +58,14 @@ Dim image As BitmapSource = pdfViewer.ExportAsImage(0) 'Set up the output path Dim output As String = "..\..\Output\Image" If image IsNot Nothing Then - 'Initialize the new Jpeg bitmap encoder - Dim encoder As BitmapEncoder = New JpegBitmapEncoder() - 'Create the bitmap frame using the bitmap source and add it to the encoder. - encoder.Frames.Add(BitmapFrame.Create(image)) - 'Create the file stream for the output in the desired image format - Dim stream As FileStream = New FileStream(output & ".Jpeg", FileMode.Create) - 'Save the stream, so that the image will be generated in the output location - encoder.Save(stream) + 'Initialize the new Jpeg bitmap encoder + Dim encoder As BitmapEncoder = New JpegBitmapEncoder() + 'Create the bitmap frame using the bitmap source and add it to the encoder + encoder.Frames.Add(BitmapFrame.Create(image)) + 'Create the file stream for the output in the desired image format + Dim stream As FileStream = New FileStream(output & ".Jpeg", FileMode.Create) + 'Save the stream, so that the image will be generated in the output location + encoder.Save(stream) End If 'Dispose the document loadedDocument.Dispose() @@ -94,17 +94,17 @@ BitmapSource[] image = pdfViewer.ExportAsImage(0, loadedDocument.Pages.Count - 1 string output = @"..\..\Output\Image"; if (image != null) { - for (int i = 0; i < image.Length; i++) - { - //Initialize the new Jpeg bitmap encoder - BitmapEncoder encoder = new JpegBitmapEncoder(); - //Create the bitmap frame using the bitmap source and add it to the encoder - encoder.Frames.Add(BitmapFrame.Create(image[i])); - //Create the file stream for the output in the desired image format - FileStream stream = new FileStream(output + i.ToString() + ".Jpeg", FileMode.Create); - //Save the stream, so that the image will be generated in the output location - encoder.Save(stream); - } + for (int i = 0; i < image.Length; i++) + { + //Initialize the new Jpeg bitmap encoder + BitmapEncoder encoder = new JpegBitmapEncoder(); + //Create the bitmap frame using the bitmap source and add it to the encoder + encoder.Frames.Add(BitmapFrame.Create(image[i])); + //Create the file stream for the output in the desired image format + FileStream stream = new FileStream(output + i.ToString() + ".Jpeg", FileMode.Create); + //Save the stream, so that the image will be generated in the output location + encoder.Save(stream); + } } //Dispose the document loadedDocument.Dispose(); @@ -124,16 +124,16 @@ Dim image As BitmapSource() = pdfViewer.ExportAsImage(0, loadedDocument.Pages.Co 'Set up the output path Dim output As String = "..\..\Output\Image" If image IsNot Nothing Then - For i As Integer = 0 To image.Length - 1 - 'Initialize the new Jpeg bitmap encoder - Dim encoder As BitmapEncoder = New JpegBitmapEncoder() - 'Create the bitmap frame using the bitmap source and add it to the encoder - encoder.Frames.Add(BitmapFrame.Create(image(i))) - 'Create the file stream for the output in the desired image format - Dim stream As FileStream = New FileStream(output & i.ToString() & ".Jpeg", FileMode.Create) - 'Save the stream, so that the image will be generated in the output location - encoder.Save(stream) - Next + For i As Integer = 0 To image.Length - 1 + 'Initialize the new Jpeg bitmap encoder + Dim encoder As BitmapEncoder = New JpegBitmapEncoder() + 'Create the bitmap frame using the bitmap source and add it to the encoder + encoder.Frames.Add(BitmapFrame.Create(image(i))) + 'Create the file stream for the output in the desired image format + Dim stream As FileStream = New FileStream(output & i.ToString() & ".Jpeg", FileMode.Create) + 'Save the stream, so that the image will be generated in the output location + encoder.Save(stream) + Next End If 'Dispose the document loadedDocument.Dispose() @@ -144,25 +144,25 @@ loadedDocument = Nothing ## Exporting with a custom image size -You can export PDF pages as images with custom width and height by passing the required size as a parameter of the [ExportAsImage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ExportAsImage_System_Int32_System_Drawing_SizeF_System_Boolean_) method. Refer to the following code to export the pages of PDF into JPEG images. Refer to the following code to export the page at the index of 0 into JPEG image with the width and the height of 1836 and 2372 in pixels respectively. +You can export PDF pages as images with custom width and height by passing the required size as a parameter of the [ExportAsImage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ExportAsImage_System_Int32_System_Drawing_SizeF_System_Boolean_) method. Refer to the following code to export the page at the index of 0 into JPEG image with the width and the height of 1836 and 2372 in pixels respectively. {% tabs %} {% highlight C# %} //Export the particular PDF page as image at the page index of 0 -BitmapSource image = pdfViewerControl.ExportAsImage(0, new SizeF(1836, 2372), false); +BitmapSource image = pdfViewer.ExportAsImage(0, new SizeF(1836, 2372), false); //Set up the output path string output = @"..\..\Output\Image"; if (image != null) { - //Initialize the new Jpeg bitmap encoder - BitmapEncoder encoder = new JpegBitmapEncoder(); - //Create the bitmap frame using the bitmap source and add it to the encoder - encoder.Frames.Add(BitmapFrame.Create(image)); - //Create the file stream for the output in the desired image format - FileStream stream = new FileStream(output + ".Jpeg", FileMode.Create); - //Save the stream, so that the image will be generated in the output location - encoder.Save(stream); + //Initialize the new Jpeg bitmap encoder + BitmapEncoder encoder = new JpegBitmapEncoder(); + //Create the bitmap frame using the bitmap source and add it to the encoder + encoder.Frames.Add(BitmapFrame.Create(image)); + //Create the file stream for the output in the desired image format + FileStream stream = new FileStream(output + ".Jpeg", FileMode.Create); + //Save the stream, so that the image will be generated in the output location + encoder.Save(stream); } {% endhighlight %} @@ -182,22 +182,22 @@ int endPageIndex = 3; float dpiX=200; float dpiY=200; -BitmapSource[] images = pdfViewerControl.ExportAsImage(startPageIndex, endPageIndex, dpiX, dpiY); +BitmapSource[] images = pdfViewer.ExportAsImage(startPageIndex, endPageIndex, dpiX, dpiY); //Set up the output path string output = @"..\..\Output\Image"; if (images != null) { - for (int i = 0; i < images.Length; i++) - { - //Initialize the new Jpeg bitmap encoder - BitmapEncoder encoder = new JpegBitmapEncoder(); - //Create the bitmap frame using the bitmap source and add it to the encoder - encoder.Frames.Add(BitmapFrame.Create(images[i])); - //Create the file stream for the output in the desired image format - FileStream stream = new FileStream(output + i.ToString() + ".Jpeg", FileMode.Create); - //Save the stream, so that the image will be generated in the output location - encoder.Save(stream); - } + for (int i = 0; i < images.Length; i++) + { + //Initialize the new Jpeg bitmap encoder + BitmapEncoder encoder = new JpegBitmapEncoder(); + //Create the bitmap frame using the bitmap source and add it to the encoder + encoder.Frames.Add(BitmapFrame.Create(images[i])); + //Create the file stream for the output in the desired image format + FileStream stream = new FileStream(output + i.ToString() + ".Jpeg", FileMode.Create); + //Save the stream, so that the image will be generated in the output location + encoder.Save(stream); + } } {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/wpf/Getting-Started.md index 0015599a2d..a6de17e50e 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Getting-Started.md @@ -1,17 +1,17 @@ --- layout: post -title: Getting Started with WPF Pdf Viewer control | Syncfusion® -description: Learn here about getting started with Syncfusion®; Essential Studio® WPF Pdf Viewer control, its elements and more. +title: Getting Started with WPF PDF Viewer control | Syncfusion® +description: Learn here about getting started with Syncfusion® Essential Studio® WPF PDF Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: ug --- -# Getting Started with WPF Pdf Viewer +# Getting Started with WPF PDF Viewer This section explains how to create an application that displays a PDF file using the [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer). -To get started quickly with WPF PDF Viewer, you can check on this video: +To get started quickly with WPF PDF Viewer, you can check out this video: @@ -24,15 +24,15 @@ You can create a **WPF Application** using Visual Studio via [Microsoft Template ## Assemblies Deployment -To add a WPF pdfviewer component to your application by installing it via NuGet packages(Recommended) or by manually adding the required assemblies to the project. +To add a WPF PDF Viewer component to your application by installing it via NuGet packages (Recommended) or by manually adding the required assemblies to the project. {% tabcontents %} {% tabcontent NuGet Package %} -### Install Syncfusion® WPF PdfViewer NuGet packages +### Install Syncfusion® WPF PDF Viewer NuGet packages -To add **WPF pdfViewer** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: +To add **WPF PDF Viewer** component in the application, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: • [Syncfusion.PdfViewer.WPF](https://www.nuget.org/packages/Syncfusion.PdfViewer.WPF) @@ -47,9 +47,9 @@ Rather than referencing the assemblies, you can utilize the [PdfViewer NuGet](ht {% tabcontent Assemblies (.dll) %} -### Add Syncfusion® WPF pdfviewer Assemblies +### Add Syncfusion® WPF PDF Viewer Assemblies -Below table describes, list of assemblies required to be added in project when the WPF pdfviewer control is used in your application. +The following table lists the assemblies required to be added in the project when the WPF PDF Viewer control is used in your application. @@ -80,59 +80,59 @@ This component contains various UI controls (ColorPickerPalette and Numeric UpDo -Below are the additional DLLs required for applying themes and skinning to the WPF PdfViewer control: +Below are the additional DLLs required for applying themes and skinning to the WPF PDF Viewer control:
    Assembly Description
    Syncfusion.Themes.Windows11Light.WPF.dll Contains the Windows 11 Light theme style for Syncfusion WPF controls.
    Syncfusion.SfSkinManager.WPF.dll Contains the SfSkinManager which helps to apply different themes to Syncfusion WPF controls.
    -N> You need to add these references to your project to use the skinning and theming capabilities of the PdfViewer. +N> You need to add these references to your project to use the skinning and theming capabilities of the PDF Viewer. {% endtabcontent %} {% endtabcontents %} -N>* Starting with version 23.1.x, Syncfusion PdfToImageConverter is necessary for PdfViewer applications. -N>* Starting with v16.2.0.x, if you reference Syncfusion®; assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your WPF application to use our components. +N>* Starting with version 23.1.x, Syncfusion PdfToImageConverter is necessary for PDF Viewer applications. +N>* Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your WPF application to use our components. -## Add WPF PdfViewer component -WPF PdfViewer control can be added to an application either through the designer (XAML) or programmatically using code. +## Add WPF PDF Viewer component +WPF PDF Viewer control can be added to an application either through the designer (XAML) or programmatically using code. {% tabcontents %} {% tabcontent Via Designer %} 1. Open the Visual Studio toolbox. -2. Navigate to Syncfusion®; WPF Toolbox tab and drag the `PdfViewerControl` toolbox item to the Designer window, it automatically adds the required references to the current application. +2. Navigate to Syncfusion® WPF Toolbox tab and drag the `PdfViewerControl` toolbox item to the Designer window. The required references are automatically added to the current application. ![WPF PDF Viewer in Toolbox](getting-started_images/wpf-pdf-viewer-in-toolbox.png) - PDF viewer control in toolbox - {:.caption} - -3. PdfViewer can be added to the application by dragging `PdfViewerControl` to the Designer area. + PDF Viewer control in toolbox + {:.caption} + +3. Use the `PdfViewerControl` in XAML by including the Syncfusion namespace. {% tabs %} {% highlight xaml tabtitle="MainWindow.xaml" %} - + - + {% endhighlight %} {% endtabs %} -N> Declare a name for the PdfViewer component as shown above for reference. +N> Declare a name for the PDF Viewer component as shown above for reference. -4. Add the theme and the [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.html) namespace to style the control correctly. Then, include the SfSkinManager namespace in the XAML code and apply the desired theme. +4. Add the [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.html) namespace to style the control correctly, and apply the desired theme. {% tabs %} {% highlight xaml tabtitle="MainWindow.xaml" %} + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" + syncfusionskin:SfSkinManager.Theme="{syncfusionskin:SkinManagerExtension ThemeName=Windows11Light}"> {% endhighlight %} @@ -141,7 +141,7 @@ N> Declare a name for the PdfViewer component as shown above for reference. {% endtabcontent %} {% tabcontent Via Coding %} -To add control manually from code, follow these steps, +To add the control manually from code, follow these steps: 1. Add the required assemblies as a reference to the project. 2. Add the following Syncfusion®; namespace in MainWindow.xaml.cs. diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Handwritten-Signature.md b/Document-Processing/PDF/PDF-Viewer/wpf/Handwritten-Signature.md index 4a5240abff..70971fd4b3 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Handwritten-Signature.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Handwritten-Signature.md @@ -1,17 +1,17 @@ --- layout: post -title: Handwritten Signature in WPF Pdf Viewer control | Syncfusion® -description: Learn about Handwritten Signature support in Syncfusion®; WPF Pdf Viewer control, its elements and more. +title: Handwritten Signature in WPF PDF Viewer control | Syncfusion® +description: Learn about Handwritten Signature support in Syncfusion®, WPF PDF Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: ug --- -# Handwritten Signature in WPF Pdf Viewer +# Handwritten Signature in WPF PDF Viewer -PDF viewer WPF allows the user to include handwritten signature in the PDF document and provides options to edit or remove the included handwritten signature in the PDF document. +The WPF PDF Viewer allows users to include handwritten signatures in the PDF document and provides options to edit or remove the included handwritten signature in the PDF document. -The following code shows how to switch to handwritten signature mode in code behind. +The following code shows how to switch to handwritten signature mode in code-behind. {% tabs %} {% highlight C# %} @@ -19,8 +19,8 @@ The following code shows how to switch to handwritten signature mode in code beh private void Window_Loaded(object sender, RoutedEventArgs e) { PdfLoadedDocument pdf = new PdfLoadedDocument("Input.pdf"); - pdfviewer.Load(pdf); - pdfviewer.AnnotationMode = PdfDocumentView.PdfViewerAnnotationMode.HandwrittenSignature; + pdfViewer.Load(pdf); + pdfViewer.AnnotationMode = PdfDocumentView.PdfViewerAnnotationMode.HandwrittenSignature; } {% endhighlight %} @@ -28,15 +28,15 @@ private void Window_Loaded(object sender, RoutedEventArgs e) {% highlight vbnet %} Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) - Dim pdf As New PdfLoadedDocument(“Input.pdf”) + Dim pdf As New PdfLoadedDocument("Input.pdf") pdfViewer.Load(pdf) - pdfviewer.AnnotationMode = PdfDocumentView.PdfViewerAnnotationMode.HandwrittenSignature + pdfViewer.AnnotationMode = PdfDocumentView.PdfViewerAnnotationMode.HandwrittenSignature End Sub {% endhighlight %} {% endtabs %} -Moving to `HandwrittenSignature` mode will open the signature pad, requesting the user to draw the signature. Clicking on apply will add the signature in the PDF Document, this can then be resized and moved to appropriate location. +Moving to `HandwrittenSignature` mode will open the signature pad, requesting the user to draw the signature. Clicking on **Apply** will add the signature in the PDF document, which can then be resized and moved to the appropriate location. ![WPF PDF Viewer Handwritten Signature](Handwritten-Signature_images\wpf-pdf-viewer-handwritten-signature.png) @@ -50,8 +50,8 @@ The opacity of the handwritten signature can be customized at the time of inclus private void Window_Loaded(object sender, RoutedEventArgs e) { PdfLoadedDocument pdf = new PdfLoadedDocument("Input.pdf"); - pdfviewer.Load(pdf); - pdfviewer.HandwrittenSignatureSettings.Opacity = 0.5F; + pdfViewer.Load(pdf); + pdfViewer.HandwrittenSignatureSettings.Opacity = 0.5F; } {% endhighlight %} @@ -59,9 +59,9 @@ private void Window_Loaded(object sender, RoutedEventArgs e) {% highlight vbnet %} Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) - Dim pdf As New PdfLoadedDocument(“Input.pdf”) + Dim pdf As New PdfLoadedDocument("Input.pdf") pdfViewer.Load(pdf) - pdfviewer.HandwrittenSignatureSettings.Opacity = 0.5F + pdfViewer.HandwrittenSignatureSettings.Opacity = 0.5F End Sub {% endhighlight %} @@ -77,8 +77,8 @@ The color of the handwritten signature can be customized at the time of inclusio private void Window_Loaded(object sender, RoutedEventArgs e) { PdfLoadedDocument pdf = new PdfLoadedDocument("Input.pdf"); - pdfviewer.Load(pdf); - pdfviewer.HandwrittenSignatureSettings.Color = Colors.Green; + pdfViewer.Load(pdf); + pdfViewer.HandwrittenSignatureSettings.Color = Colors.Green; } {% endhighlight %} @@ -86,9 +86,9 @@ private void Window_Loaded(object sender, RoutedEventArgs e) {% highlight vbnet %} Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) - Dim pdf As New PdfLoadedDocument(“Input.pdf”) + Dim pdf As New PdfLoadedDocument("Input.pdf") pdfViewer.Load(pdf) - pdfviewer.HandwrittenSignatureSettings.Color = Colors.Green + pdfViewer.HandwrittenSignatureSettings.Color = Colors.Green End Sub {% endhighlight %} @@ -104,8 +104,8 @@ The included handwritten signature can be flattened in the PDF document when sav private void Window_Loaded(object sender, RoutedEventArgs e) { PdfLoadedDocument pdf = new PdfLoadedDocument("Input.pdf"); - pdfviewer.Load(pdf); - pdfviewer.HandwrittenSignatureSettings.FlattenSignatureOnSave = true; + pdfViewer.Load(pdf); + pdfViewer.HandwrittenSignatureSettings.FlattenSignatureOnSave = true; } {% endhighlight %} @@ -113,9 +113,9 @@ private void Window_Loaded(object sender, RoutedEventArgs e) {% highlight vbnet %} Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) - Dim pdf As New PdfLoadedDocument(“Input.pdf”) + Dim pdf As New PdfLoadedDocument("Input.pdf") pdfViewer.Load(pdf) - pdfviewer.HandwrittenSignatureSettings.FlattenSignatureOnSave = true + pdfViewer.HandwrittenSignatureSettings.FlattenSignatureOnSave = true End Sub {% endhighlight %} @@ -125,22 +125,22 @@ N> If the handwritten signature is not flattened, it will be saved as ink annota ## Working with included handwritten signatures -The PDF viewer allows editing the color and opacity of the Handwritten signature included in the document in the UI.. To perform this, select the included handwritten signature and click right using mouse, over the selected handwritten signature, a pop-up context menu will appear with the following options, +The PDF viewer allows editing the color and opacity of the handwritten signature included in the document in the UI. To perform this, select the included handwritten signature and right-click using the mouse, over the selected handwritten signature, a pop-up context menu will appear with the following options, * Properties * Delete ### Properties -Selecting properties from the context menu will display the Handwritten Signature Properties window, which would have Appearance tab. +Selecting properties from the context menu will display the Handwritten Signature Properties window, which has the Appearance tab. #### Appearance tab -The color, opacity of the handwritten signature can be edited using Appearance tab of Handwritten Signature Properties window. +The color and opacity of the handwritten signature can be edited using the Appearance tab of the Handwritten Signature Properties window. ##### Editing color of the signature -The color of the selected handwritten signature will be displayed in the color row in the appearance tab. Selecting the Color would displays the color palette, choosing a color from the color palette and clicking OK will apply the color to the handwritten signature. +The color of the selected handwritten signature will be displayed in the color row in the appearance tab. Selecting the Color displays the color palette, choosing a color from the color palette and clicking OK will apply the color to the handwritten signature. The following image illustrates how to change the color of the handwritten signature. @@ -148,30 +148,30 @@ The following image illustrates how to change the color of the handwritten signa ##### Editing opacity of the signature -The slider displayed in the Appearance tab allows modifying opacity of the selected handwritten signature. You can also modify the opacity of the selected handwritten signature by giving numeric value in the opacity text box. +The slider displayed in the Appearance tab allows modifying the opacity of the selected handwritten signature. You can also modify the opacity of the selected handwritten signature by giving numeric value in the opacity text box. ![WPF PDF Viewer Edit Opacity of the Signature](Handwritten-Signature_images\wpf-pdf-viewer-edit-opacity-of-the-signature.png) ### Deleting a signature -Selecting delete option from the context menu which is displayed when clicking right on the selected signature would delete the respective signature from the PDF document. +Selecting the delete option from the context menu which is displayed when right-clicking on the selected signature would delete the respective signature from the PDF document. ![WPF PDF Viewer Delete a Signature](Handwritten-Signature_images\wpf-pdf-viewer-delete-a-signature.png) ## Track the changes in a handwritten signature -You can track the changes occurred in a handwritten signature such as add, select, deselect, move, resize, and remove. The `HandwrittenSignatureChanged` event indicates that a signature is changed in the current document and the `Action` property of the `HandwrittenSignatureChangedEventArgs` provides you the type of changes made in the signature. The following code shows how to wire the event in [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). +You can track the changes that occur in a handwritten signature such as add, select, deselect, move, resize, and remove. The `HandwrittenSignatureChanged` event indicates that a signature is changed in the current document and the `Action` property of the `HandwrittenSignatureChangedEventArgs` provides the type of change made in the signature. The following code shows how to subscribe to the event on the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). {% tabs %} {% highlight C# %} PdfViewerControl pdfViewer = new PdfViewerControl(); -pdfViewer.Load("Barcode.pdf"); +pdfViewer.Load("Input.pdf"); pdfViewer.HandwrittenSignatureChanged += PdfViewer_HandwrittenSignatureChanged; private void PdfViewer_HandwrittenSignatureChanged(object sender, HandwrittenSignatureChangedEventArgs e) { - //Insert your code that does something + //Insert your code that does something } {% endhighlight %} @@ -179,11 +179,11 @@ private void PdfViewer_HandwrittenSignatureChanged(object sender, HandwrittenSig {% highlight vbnet %} Dim pdfViewer As PdfViewerControl = New PdfViewerControl() -pdfViewer.Load("Barcode.pdf") +pdfViewer.Load("Input.pdf") AddHandler pdfViewer.HandwrittenSignatureChanged, AddressOf PdfViewer_HandwrittenSignatureChanged Private Sub PdfViewer_HandwrittenSignatureChanged(ByVal sender As Object, ByVal e As HandwrittenSignatureChangedEventArgs) -'Insert your code that does something + 'Insert your code that does something End Sub {% endhighlight %} @@ -263,7 +263,6 @@ Private Sub PdfViewer_HandwrittenSignatureChanged(ByVal sender As Object, ByVal End Sub {% endhighlight %} - {% endtabs %} ### Track the details of the selected handwritten signature @@ -306,21 +305,21 @@ End Sub ## Add handwritten signature from code -PDF Viewer allows you to add a signature anywhere in the pages of a PDF document from code behind. +PDF Viewer allows you to add a signature anywhere in the pages of a PDF document from code-behind. ### Add a handwritten signature in a single page -You can add signature in a particular page as `System.Windows.Shapes.Path` by using the `AddHandwrittenSignature` with the page number and the bounds as parameters. The following code explains how to add a handwritten signature at the first page of the PDF document. +You can add a signature in a particular page as `System.Windows.Shapes.Path` by using the `AddHandwrittenSignature` with the page number and the bounds as parameters. The following code explains how to add a handwritten signature at the first page of the PDF document. {% tabs %} {% highlight C# %} private void button_Click(object sender, RoutedEventArgs e) { - System.Windows.Shapes.Path signature = new System.Windows.Shapes.Path(); - //Note: Set your signature appearance as Data for the path here. - //Add signature in the first page of the PDF document at the location: X= 450, Y=750 and with the size: Width=100, Height=100. - pdfViewer.AddHandwrittenSignature(signature, 1, new RectangleF(450, 750, 100, 100)); + System.Windows.Shapes.Path signature = new System.Windows.Shapes.Path(); + //Note: Set your signature appearance as Data for the path here. + //Add signature in the first page of the PDF document at the location: X= 450, Y=750 and with the size: Width=100, Height=100. + pdfViewer.AddHandwrittenSignature(signature, 1, new RectangleF(450, 750, 100, 100)); } {% endhighlight %} @@ -345,14 +344,14 @@ You can also add a signature in multiple pages of the PDF document at multiple p private void button_Click(object sender, RoutedEventArgs e) { - System.Windows.Shapes.Path signature = new System.Windows.Shapes.Path(); - //Note: Set your signature appearance using `Data` property of the path here. - Dictionary> bounds = new Dictionary>(); - //Add signature bounds for the first page as: X= 450, Y=750, Width=100, Height=100. - bounds.Add(1, new List() { new RectangleF(450, 750, 100, 100) }); - //Add signature bounds for the second page as: X= 350, Y=550, Width=200, Height=200 - bounds.Add(2, new List() { new RectangleF(350, 550, 200, 200) }); - pdfViewer.AddHandwrittenSignature(signature, bounds); + System.Windows.Shapes.Path signature = new System.Windows.Shapes.Path(); + //Note: Set your signature appearance using `Data` property of the path here. + Dictionary> bounds = new Dictionary>(); + //Add signature bounds for the first page as: X= 450, Y=750, Width=100, Height=100. + bounds.Add(1, new List() { new RectangleF(450, 750, 100, 100) }); + //Add signature bounds for the second page as: X= 350, Y=550, Width=200, Height=200. + bounds.Add(2, new List() { new RectangleF(350, 550, 200, 200) }); + pdfViewer.AddHandwrittenSignature(signature, bounds); } {% endhighlight %} @@ -360,13 +359,13 @@ private void button_Click(object sender, RoutedEventArgs e) Private Sub button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Dim signature As System.Windows.Shapes.Path = New System.Windows.Shapes.Path() - 'Note: Set your signature appearance using `Data` property of the path here. + 'Note: Set your signature appearance using `Data` property of the path here. Dim bounds As Dictionary(Of Integer, List(Of RectangleF)) = New Dictionary(Of Integer, List(Of RectangleF))() 'Add signature bounds for the first page as: X= 450, Y=750, Width=100, Height=100. - bounds.Add(1, New List(Of RectangleF)() From { + bounds.Add(1, New List(Of RectangleF)() From { New RectangleF(450, 750, 100, 100) }) - 'Add signature bounds for the second page as: X= 350, Y=550, Width=200, Height=200. + 'Add signature bounds for the second page as: X= 350, Y=550, Width=200, Height=200. bounds.Add(2, New List(Of RectangleF)() From { New RectangleF(350, 550, 200, 200) }) @@ -378,11 +377,11 @@ End Sub ## Keyboard shortcuts -The below keyboard shortcuts are available to customize the handwritten signature in the PDF document. +The following keyboard shortcuts are available to customize the handwritten signature in the PDF document. * Delete key – Deletes the selected signature from the PDF document. * Ctrl + Z – Performs undo functionality for recently performed operations. * Ctrl + Y – Performs redo functionality for recently performed operations. -N> You can refer to our [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the pdfviewer. \ No newline at end of file +N> You can refer to the [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its feature representations. You can also explore the [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the pdfviewer. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Change-the-new-toolbar-design-to-old-toolbar-design.md b/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Change-the-new-toolbar-design-to-old-toolbar-design.md index 33177be711..d3db1e4506 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Change-the-new-toolbar-design-to-old-toolbar-design.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Change-the-new-toolbar-design-to-old-toolbar-design.md @@ -9,11 +9,11 @@ documentation: ug # Change the current toolbar design to the old toolbar design -From 21.1.0.X onwards, PDFViewer toolbar design was changed for better user interface and visual. The current toolbar design is shown as follows. +From 21.1.0.X onwards, PDFViewer toolbar design was changed for a better user interface and visual appearance. The current toolbar design is shown as follows. ![WPF PDFViewer New Toolbar Design](Change-toolbar-design-images/NewToolbarDesign.png) -In order to change the new toolbar design back to the old toolbar design, set the customized style “SyncfusionPdfViewerCustomControlStyle”(refer to this style definition in the sample download link) to the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) as follows. +In order to change the new toolbar design back to the old toolbar design, set the customized style "SyncfusionPdfViewerCustomControlStyle"(refer to this style definition in the sample download link) to the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) as follows. {% tabs %} {% highlight c# %} @@ -25,12 +25,12 @@ In order to change the new toolbar design back to the old toolbar design, set th {% endhighlight %} {% endtabs %} -The customized style of the PdfViewer toolbar re-arranges the toolbar icons as of the old design. However, it needs three new buttons to be added in the custom style to perform fit page, fit Width, and Marquee Zoom operations. The above mentioned three buttons are inside the zoom level combo box of the new toolbar design as follows. +The customized style of the PdfViewer toolbar re-arranges the toolbar icons as of the old design. However, it needs three new buttons to be added in the custom style to perform fit page, fit width, and marquee zoom operations. The above-mentioned three buttons are inside the zoom level combo box of the new toolbar design as follows. ![WPF PDFViewer New Combo Box](Change-toolbar-design-images/NewComboBox.png) -So, the events for the above mentioned three buttons needs to trigger to achieve their functionalities as same in the old toolbar design. After applying the “SyncfusionPdfViewerCustomControlStyle” style to the PdfViewerControl, it will look as follows. +So, the events for the above-mentioned three buttons need to trigger to achieve their functionalities same as in the old toolbar design. After applying the "SyncfusionPdfViewerCustomControlStyle" style to the PdfViewerControl, it will look as follows. ![WPF PDFViewer Old Toolbar Design](Change-toolbar-design-images/OldToolbarDesign.png) -N> The sample for changing the current toolbar deign to the old toolbar design is present in the [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/Toolbar/ChangeCurrentToolbarToOldToolbar). \ No newline at end of file +N> The sample for changing the current toolbar design to the old toolbar design is present in the [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/Toolbar/ChangeCurrentToolbarToOldToolbar). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Changing-the-Current-User.md b/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Changing-the-Current-User.md index d36e594727..228de5bb27 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Changing-the-Current-User.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Changing-the-Current-User.md @@ -1,7 +1,7 @@ --- layout: post -title: Change the Current user in PdfViewer | Syncfusion -description: Learn about how to Change the CurrentUser in Syncfusion®; WPF Pdf Viewer control using CurrentUser property. +title: Change the CurrentUser in PdfViewer | Syncfusion +description: Learn how to change the CurrentUser in Syncfusion® WPF Pdf Viewer control using CurrentUser property. platform: document-processing control: PDF Viewer documentation: ug @@ -14,12 +14,14 @@ The PDF Viewer allows you to change the CurrentUser. If the CurrentUser property {% tabs %} {% highlight C# %} +using Syncfusion.Windows.PdfViewer; + //Initialize PDF Viewer. PdfViewerControl pdfViewer = new PdfViewerControl(); //Load the PDF. pdfViewer.Load("Sample.pdf"); -//Changing the CurrentUser of document +//Changing the CurrentUser of document. pdfViewer.CurrentUser = "set the name here"; {% endhighlight %} @@ -27,13 +29,15 @@ pdfViewer.CurrentUser = "set the name here"; {% highlight vbnet %} +Imports Syncfusion.Windows.PdfViewer + 'Initialize PDF Viewer. Private pdfViewer As New PdfViewerControl() 'Load the PDF. pdfViewer.Load("Sample.pdf") -'Changing the CurrentUser of document +'Changing the CurrentUser of document. pdfViewer.CurrentUser = "set the name here"; {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Disable-toolbar-items.md b/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Disable-toolbar-items.md index eeffdfc4bc..758b384d94 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Disable-toolbar-items.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/How-To/Disable-toolbar-items.md @@ -13,7 +13,7 @@ To remove the default toolbar completely, use the [PdfDocumentView](https://help However, an individual toolbar item can also be removed from the default toolbar of the PDF Viewer using the toolbar template. -N> When disabling the toolbar items using the toolbar template, the toolbar template should be accessed either in the **PdfViewerControl's Loaded event** or **Windows loaded event** as the toolbar items will be initialized when the PdfViewer is loaded. Accessing the toolbar items using its template before the PdfViewer is loaded will result in a null reference exception +N> When disabling the toolbar items using the toolbar template, the toolbar template should be accessed either in the **PdfViewerControl's Loaded event** or **Windows loaded event** as the toolbar items will be initialized when the PdfViewer is loaded. Accessing the toolbar items using its template before the PdfViewer is loaded will result in a null reference exception. The following code sample explains disabling the text search tool from the default toolbar. @@ -33,7 +33,7 @@ private void pdfViewer_Loaded(object sender, RoutedEventArgs e) { //Get the instance of the toolbar using its template name. DocumentToolbar toolbar = pdfViewer.Template.FindName("PART_Toolbar", pdfViewer) as DocumentToolbar; - //Get the instance of the open file button using its template name. + //Get the instance of the text search button using its template name. Button textSearchButton = (Button)toolbar.Template.FindName("PART_ButtonTextSearch", toolbar); //Set the visibility of the button to collapsed. textSearchButton.Visibility = System.Windows.Visibility.Collapsed; @@ -42,7 +42,7 @@ private void pdfViewer_Loaded(object sender, RoutedEventArgs e) {% endhighlight %} {% endtabs %} -N> Apply the changes of hiding toolbar items, only after when the application window is loaded. +N> Apply the changes for hiding toolbar items only after the application window is loaded. N> The sample project for disabling toolbar item is available in the [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/Toolbar/HideToolbarItems). Similarly, other toolbar items also can be disabled. The following table lists the template names of the rest of the toolbar items along with their respective types in the order they appear in the toolbar. @@ -193,7 +193,7 @@ Similarly, other toolbar items also can be disabled. The following table lists t N> From the v18.4.0.x onwards, the file menu items such as Open, Save, Save As, and Print are not directly present in the toolbar and they are present in the context menu of the File tools toggle button. N> From the v21.1.0.x onwards, the PDFViewer toolbar design is changed for a better user interface and visual. -Due to the changes in the toolbar design, there were some changes for a few tool templates. They are listed as follows. +Due to the toolbar design changes, a few tool templates have been modified. They are listed as follows. ## Before v21.1.0.x (Old Toolbar) @@ -384,4 +384,4 @@ Similarly, other file menu items can be disabled. The following table lists the -N> The present UI design is subject to change, based on the inclusion of new features, enhancements, and user convenience. \ No newline at end of file +N> The current UI design is subject to change based on the inclusion of new features, enhancements, and user convenience. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Interaction-Modes.md b/Document-Processing/PDF/PDF-Viewer/wpf/Interaction-Modes.md index 91953764b5..61f851ee88 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Interaction-Modes.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Interaction-Modes.md @@ -1,7 +1,7 @@ --- layout: post title: Interaction Modes in WPF Pdf Viewer control | Syncfusion® -description: Learn about Interaction Modes support in Syncfusion®; Essential Studio® WPF Pdf Viewer control, its elements and more. +description: Learn about Interaction Modes support in Syncfusion®, Essential Studio® WPF Pdf Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: UG @@ -9,9 +9,9 @@ documentation: UG # Interaction Modes in WPF Pdf Viewer -The PDF Viewer supports following cursor modes for easy interaction with the PDF documents: +The PDF Viewer supports the following cursor modes for easy interaction with the PDF documents: -* Selection mode +* Selection mode * Panning mode * Marquee zoom mode diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Localization.md b/Document-Processing/PDF/PDF-Viewer/wpf/Localization.md index 6dc26e5b28..fb2a978dd3 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Localization.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Localization.md @@ -9,16 +9,16 @@ documentation: ug # Localization in WPF Pdf Viewer -Localization is the process of configuring the application to a specific language. [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) provides support to localize all the static text used for tooltip and context menu contents. Localization can be done by adding resource file (.resx) in the application. -We are using `en-US` culture-based resource file as default in PDF Viewer. This can be downloaded from this [GitHub](https://github.com/syncfusion/wpf-controls-localization-resx-files/tree/master/Syncfusion.PdfViewer.WPF) location. +Localization is the process of configuring the application to a specific language. [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) provides support to localize all the static text used for tooltip and context menu contents. Localization can be done by adding a resource file (.resx) in the application. +We use the `en-US` culture-based resource file as the default in PDF Viewer. This can be downloaded from this [GitHub](https://github.com/syncfusion/wpf-controls-localization-resx-files/tree/master/Syncfusion.PdfViewer.WPF) location. ## Adding Resource file -* Create a folder name as `Resources` in your application. -* Add default English (“en-US”) [Resx](https://github.com/syncfusion/wpf-controls-localization-resx-files/blob/master/Syncfusion.PdfViewer.WPF/Syncfusion.PdfViewer.WPF.resx) (resource) file of `PdfViewerControl` in `Resources` folder named as Syncfusion.PdfViewer.WPF.resx. -* Create a Resx (resource) files and name it as Syncfusion.PdfViewer.WPF.[Culture name].resx. For example, Syncfusion.PdfViewer.WPF.fr.resx for French culture. -* Add the resource key such as `OpenDocument` and its corresponding localized value in Syncfusion.PdfViewer.WPF.fr.resx file. Refer the below screenshot for the same. +* Create a folder named `Resources` in your application. +* Add the default English ("en-US") [Resx](https://github.com/syncfusion/wpf-controls-localization-resx-files/blob/master/Syncfusion.PdfViewer.WPF/Syncfusion.PdfViewer.WPF.resx) (resource) file of `PdfViewerControl` in the `Resources` folder named as `Syncfusion.PdfViewer.WPF.resx`. +* Create a Resx (resource) file and name it as `Syncfusion.PdfViewer.WPF.[Culture name].resx`. For example, `Syncfusion.PdfViewer.WPF.fr.resx` for French culture. +* Add the resource key such as `OpenDocument` and its corresponding localized value in `Syncfusion.PdfViewer.WPF.fr.resx` file. Refer the below screenshot for the same. * Execute the application in French culture to see the changes. ![Resource file](Localization_images/wpf-pdf-viewer-resource-file.png) @@ -29,14 +29,16 @@ The following screenshot shows the `PdfViewerControl` in French language ## Localize Resource File with Different Assembly or Namespace -In general, [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) try to read the resource file from executing assembly and its default namespace can be done using [Assembly.GetExecuteAssembly](https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getexecutingassembly?view=net-7.0) method. When the resource file is located at different assembly or namespace, it can set to the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) by using [LocalizationManager.SetResources](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeView.LocalizationManager.html#Syncfusion_UI_Xaml_TreeView_LocalizationManager_SetResources_System_Reflection_Assembly_System_String_) method. +In general, [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) tries to read the resource file from the executing assembly, and its default namespace can be obtained using the [Assembly.GetExecutingAssembly](https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getexecutingassembly) method. When the resource file is located at different assembly or namespace, it can be set to the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) by using [LocalizationManager.SetResources](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeView.LocalizationManager.html#Syncfusion_UI_Xaml_TreeView_LocalizationManager_SetResources_System_Reflection_Assembly_System_String_) method. {% tabs %} {% highlight c# %} +using System.Threading; + public MainWindow() { Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-FR"); - + // Set the Custom assembly and namespace for the localization. LocalizationManager.SetResources(typeof(Custom_Class).Assembly, "ClassLibrary"); InitializeComponent(); diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Magnifying-PDF-documents.md b/Document-Processing/PDF/PDF-Viewer/wpf/Magnifying-PDF-documents.md index 27e0af5c58..8c3745d39e 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Magnifying-PDF-documents.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Magnifying-PDF-documents.md @@ -1,7 +1,7 @@ --- layout: post -title: Magnifying PDF documents in WPF Pdf Viewer control | Syncfusion®; -description: Learn about Magnifying PDF documents support in Syncfusion®; WPF Pdf Viewer control, its elements and more. +title: Magnifying PDF documents in WPF Pdf Viewer control | Syncfusion® +description: Learn about Magnifying PDF documents support in Syncfusion® WPF Pdf Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: ug @@ -13,7 +13,7 @@ The [WPF PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/wpf-pdf-viewer) h ![Zoom tools of WPF PDF Viewer](images/zoom tools.png) -1. **Combo box**: It allows you to select a zoom percentage from the pre-defined set of values listed in the dropdown. Since it is editable, you can also provide your zoom values by double editing the text area. +1. **Combo box**: It allows you to select a zoom percentage from the pre-defined set of values listed in the dropdown. Since it is editable, you can also provide your zoom values by directly editing the text area. 2. **Zoom out button**: It allows you to reduce the zoom value by 25% from the current zoom percentage. 3. **Zoom in button**: It allows you to increase the zoom value by 25% from the current zoom percentage. 4. **Fit to width button**: It allows you to fit the document to the width of the control. @@ -71,7 +71,7 @@ pdfViewer.ZoomMode = ZoomMode.FitWidth; The default minimum and maximum zoom percentage of the PDF Viewer is 50 and 400 respectively. However, the PDF Viewer allows you to customize the minimum and maximum zoom percentage values based on your requirement. -You can customize the minimum zoom percentage of the PDF viewer using the [MinimumZoomPercentage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_MinimumZoomPercentage) property. Its default value is 50. Refer to the following code sample to set the property and apply the customized minimum zoom percent to the PDF Viewer +You can customize the minimum zoom percentage of the PDF viewer using the [MinimumZoomPercentage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_MinimumZoomPercentage) property. Its default value is 50. Refer to the following code sample to set the property and apply the customized minimum zoom percent to the PDF Viewer. N> The allowed value of this property ranges from 10 to the value of the [MaximumZoomPercentage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_MaximumZoomPercentage) of PDF Viewer. @@ -82,7 +82,7 @@ pdfViewer.Load(@"../../Data/Barcode.pdf"); //Set the minimum zoom percentage. pdfViewer.MinimumZoomPercentage = 20; //Magnify the document to minimum zoom percentage. -pdfViewer.ZoomTo(pdfviewer.MinimumZoomPercentage); +pdfViewer.ZoomTo(pdfViewer.MinimumZoomPercentage); {% endhighlight %} {% endtabs %} @@ -93,11 +93,11 @@ N> The allowed value of this property ranges from the value of [MinimumZoomPerce {% tabs %} {% highlight c# %} // Load PDF document. -pdfviewer.Load(@"../../Data/Barcode.pdf"); +pdfViewer.Load(@"../../Data/Barcode.pdf"); //Set the maximum zoom percentage. -pdfviewer.MaximumZoomPercentage = 600; +pdfViewer.MaximumZoomPercentage = 600; //Magnify the document to maximum zoom percentage. -pdfviewer.ZoomTo(pdfviewer.MaximumZoomPercentage); +pdfViewer.ZoomTo(pdfViewer.MaximumZoomPercentage); {% endhighlight %} {% endtabs %} @@ -119,11 +119,11 @@ private void PdfViewer_ZoomChanged(object sender, ZoomEventArgs args) {% endhighlight %} {% endtabs %} -## Active view port rendering at higher zoom percentages +## Active viewport rendering at higher zoom percentages -From the 19.3 version, the [MaximumZoomPercentage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_MaximumZoomPercentage) of the PDF Viewer can be extended up to 6400% with the support of active view port rendering at higher zoom percentages. It renders only the part of the PDF file that is visible on-screen and ignoring the parts that are outside the viewport. The mode is automatically enabled when the page size or zoom increased beyond a specified limit on the zooming. This approach will be helpful to open the large-size pages containing PDF documents at higher zoom levels. +From the 19.3 version, the [MaximumZoomPercentage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_MaximumZoomPercentage) of the PDF Viewer can be extended up to 6400% with the support of active viewport rendering at higher zoom percentages. It renders only the part of the PDF file that is visible on-screen and ignoring the parts that are outside the viewport. The mode is automatically enabled when the page size or zoom increased beyond a specified limit on the zooming. This approach will be helpful to open the large-size pages containing PDF documents at higher zoom levels. -N> Active view port rendering is supported only for the PDFium (default) rendering engine. +N> Active viewport rendering is supported only for the PDFium (default) rendering engine. You need to set the [MaximumZoomPercentage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_MaximumZoomPercentage) and call [ZoomTo](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ZoomTo_System_Int32_) method to achieve it from the application level as shown in the following code example. @@ -131,19 +131,19 @@ You need to set the [MaximumZoomPercentage](https://help.syncfusion.com/cr/wpf/S {% highlight c# %} //Set the maximum zoom percentage. -pdfviewer.MaximumZoomPercentage = 6400; +pdfViewer.MaximumZoomPercentage = 6400; //Magnify the document to the zoom percentage you needed (less than or equal to 6400). //In the below example, control will magnify to 1200% zoom. -pdfviewer.ZoomTo(1200); +pdfViewer.ZoomTo(1200); {% endhighlight %} {% endtabs %} ## Pinch to zoom -The WPF PDF Viewer supports pinch-to-zoom, allows users to magnify using touch gestures when working on a device with a touch screen. To use pinch-to-zoom, place two fingers on the control and move them apart to zoom in (or together to zoom out). +The WPF PDF Viewer supports pinch-to-zoom, which allows users to magnify using touch gestures when working on a device with a touch screen. To use pinch-to-zoom, place two fingers on the control and move them apart to zoom in (or together to zoom out). ## Mouse and keyboard shortcuts **Ctrl (key) + Scroll the mouse wheel up** - To perform zoom in. -**Ctrl (key) + Scroll the mouse wheel down** - To perform zoom out. +**Ctrl (key) + Scroll the mouse wheel down** - To perform zoom out. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Navigating-through-the-pages.md b/Document-Processing/PDF/PDF-Viewer/wpf/Navigating-through-the-pages.md index ddeb0db390..6279e433da 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Navigating-through-the-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Navigating-through-the-pages.md @@ -9,7 +9,7 @@ documentation: ug # Page Navigation in WPF Pdf Viewer -PDF Viewer allows you to navigate through the pages of the PDF document using the [GotoPage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_GotoPage_System_Int32_) method. The following code example illustrates the navigation to page 2 of the PDF document. +PDF Viewer allows you to navigate through the pages of the PDF document using the [GotoPage](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_GotoPage_System_Int32_) method. The page number is 1-based. The following code example illustrates the navigation to page 2 of the PDF document. {% tabs %} {% highlight C# %} @@ -31,8 +31,8 @@ pdfViewer.GotoPage(2) {% endhighlight %} {% endtabs %} -## Navigate to the horizontal and vertical offset -You can now scroll to the given horizontal and vertical offset of the PDF document programmatically using the [ScrollTo](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ScrollTo_System_Double_System_Double_) method of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). Refer to the following code to scroll the PDF document to the horizontal and vertical offset of 160 and 400 respectively. +## Scroll to a horizontal and vertical offset +You can scroll to a specified horizontal and vertical offset of the PDF document programmatically using the [ScrollTo](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ScrollTo_System_Double_System_Double_) method of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). Refer to the following code to scroll the PDF document to the horizontal and vertical offset of 160 and 400 respectively. {% tabs %} {% highlight C# %} @@ -54,7 +54,7 @@ pdfViewer.ScrollTo (160, 400) {% endhighlight %} {% endtabs %} -N> Internally, the parameters (offset values) of this method will be multiplied by current zoom factor. So, the parameters (offset values) must be specified in terms of default zoom factor of 1, or 100% zoom. +N> Internally, the offset values passed to this method are multiplied by the current zoom factor. Therefore, the offset values must be specified in terms of the default zoom factor of 1 (100% zoom). {% tabs %} {% highlight C# %} diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Organize-Pages.md b/Document-Processing/PDF/PDF-Viewer/wpf/Organize-Pages.md index b8559283b0..0c213e927b 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Organize-Pages.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Organize-Pages.md @@ -1,7 +1,7 @@ --- layout: post title: Organize Pages in WPF Pdf Viewer control | Syncfusion -description: Learn about Organize Pages support in Syncfusion®; Essential Studio® WPF Pdf Viewer control, its elements and more. +description: Learn about Organize Pages support in Syncfusion® Essential Studio® WPF Pdf Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: ug @@ -15,23 +15,23 @@ Use the following steps to organize the PDF page(s) in [PdfViewerControl](https: 1. Click the organize page button in the left pane, this displays the organize pages pane in the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). -2. You can rotate or delete a specific page using context menu that appears when hovering the mouse over the pages. +2. You can rotate or delete a specific page using the context menu that appears when hovering the mouse over the pages. - ![WPF PDF Viewer Page Toolbar](OrganizePages_Images/wpf-pdf-viewer-page-toolbar.png) + ![WPF PDF Viewer Page Toolbar](OrganizePages_Images/wpf-pdf-viewer-page-toolbar.png) 3. You can rotate or delete multiple pages using the organize pages toolbar. - ![WPF PDF Viewer Organize Pages Toolbar](OrganizePages_Images/wpf-pdf-viewer-organize-pages-toolbar.png) + ![WPF PDF Viewer Organize Pages Toolbar](OrganizePages_Images/wpf-pdf-viewer-organize-pages-toolbar.png) - N> You can use Ctrl/Shift keys to select multiple pages. Also, you can select all pages using Ctrl+A shortcut key. You cannot delete all the pages from the document. + N> You can use Ctrl/Shift keys to select multiple pages. Also, you can select all pages using Ctrl+A shortcut key. You cannot delete all the pages from the document. 4. You can rearrange the page(s) by dragging and dropping them. - ![WPF PDF Viewer Rearrange Pages](OrganizePages_Images/wpf-pdf-viewer-rearrange-pages.png) - + ![WPF PDF Viewer Rearrange Pages](OrganizePages_Images/wpf-pdf-viewer-rearrange-pages.png) + 5. You can insert a blank page or any PDF page(s) using the Organize Pages toolbar. ![WPF PDF Viewer insert Pages](OrganizePages_Images/wpf-pdf-viewer-insert-pages-toolbar.png) -6.You can insert a blank page or any PDF page(s),and perform clipboard actions like Cut, Copy, and Paste using the more option in the context menu that appears when hovering over a pages. +6. You can insert a blank page or any PDF page(s), and perform clipboard actions like Cut, Copy, and Paste using the more option in the context menu that appears when hovering over a page. ![WPF PDF Viewer insert Pages option button](OrganizePages_Images/wpf-pdf-viewer-Option-button.png) ![WPF PDF Viewer option button context menu](OrganizePages_Images/wpf-pdf-viewer-Option-button-contextmenu.png) @@ -190,7 +190,7 @@ N> If any of the already existing page index is not present in rearranged array, ## Removing PDF page(s) You can remove the PDF page(s) from the PDF document using the RemoveAt method in PageOrganizer. -To remove the page at specific index from PDF document, refer to the following code example. +To remove the page at a specific index from the PDF document, refer to the following code example. {% tabs %} {% highlight c# %} @@ -212,7 +212,7 @@ End Sub {% endhighlight %} {% endtabs %} -To remove the set of pages from PDF document, refer to the following code example. +To remove the set of pages from the PDF document, refer to the following code example. {% tabs %} {% highlight c# %} @@ -247,20 +247,21 @@ pdfViewerControl.PageOrganizer.RemovePagesCommand.Execute(new int[] { 0, 1 }); {% endtabs %} ## Insert Page(s) Customization -Insert page feature allows users to choose where to add pages using the **Insert Pages** window.Users can access this via from either the Organize Pages toolbar or the context menu that appears when hovering over a pages. -In the window, there are three options **First**, **Last**, and **Page**. Selecting **First** inserts pages at the document's beginning, while **Last** adds them at the end. The **Page** option lets users specify a position using **Location** **Before** adds pages before the selected page, and **After** inserts them after. + +Insert page feature allows users to choose where to add pages using the **Insert Pages** window. Users can access this from either the Organize Pages toolbar or the context menu that appears when hovering over a page. +In the window, there are three options: **First**, **Last**, and **Page**. Selecting **First** inserts pages at the document's beginning, while **Last** adds them at the end. The **Page** option lets users specify a position using **Location**; **Before** adds pages before the selected page, and **After** inserts them after. N> The **Location** is accessible only when the **Page** radio button is selected. ### From file When users want to insert pages using the **From File** option, a browser window will open to select a PDF. Once selected, all pages from the PDF are inserted into the document based on the customization in the **Insert Pages** window. -![WPF PDF Viewer insert page window ](OrganizePages_Images/wpf-pdf-viewer-insert-page-window.png) - +![WPF PDF Viewer insert page window](OrganizePages_Images/wpf-pdf-viewer-insert-page-window.png) + ### Blank page -When users want to insert page a page using the **Blank Page** option, a single blank page will be added to the document as per the Customization in the **Insert Pages** window. +When users want to insert a page using the **Blank Page** option, a single blank page will be added to the document as per the customization in the **Insert Pages** window. -![WPF PDF Viewer insert page window blank page ](OrganizePages_Images/wpf-pdf-viewer-insert-page-window-blank-page.png) +![WPF PDF Viewer insert page window blank page](OrganizePages_Images/wpf-pdf-viewer-insert-page-window-blank-page.png) ## Get the selected page indexes @@ -273,9 +274,9 @@ You can get the selected page indexes of the PDF document in the organizing page pdfViewer.PageSelected += PdfViewer_PageSelected; private void PdfViewer_PageSelected(object sender, PageSelectedEventArgs e) { - // Get the selected pages. - if (e.SelectedPages.Length != 0) - selectedPages = e.SelectedPages; + // Get the selected pages. + if (e.SelectedPages.Length != 0) + selectedPages = e.SelectedPages; } {% endhighlight %} @@ -283,8 +284,8 @@ private void PdfViewer_PageSelected(object sender, PageSelectedEventArgs e) ## Disabling page organizer -You can remove the page organizer icon from left pane of the ‘PdfViewerControl’ by setting the ‘PageOrganizerSettings.IsIconVisible’ property to false. -Refer to the following code example to disable the organize page. +You can remove the page organizer icon from the left pane of the ‘PdfViewerControl’ by setting the ‘PageOrganizerSettings.IsIconVisible’ property to false. +Refer to the following code example to disable the page organizer. {% tabs %} {% highlight c# %} @@ -316,7 +317,7 @@ Refer to the following code example to show the annotations and form fields in p {% tabs %} {% highlight c# %} -Private void button_Click(object sender,RoutedEventArgs e) +private void button_Click(object sender, RoutedEventArgs e) { //show the annotations in page organizer. pdfViewer.PageOrganizerSettings.ShowAnnotations = true; diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Printing-PDF-Files.md b/Document-Processing/PDF/PDF-Viewer/wpf/Printing-PDF-Files.md index 94cc400983..78f9b6fc77 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Printing-PDF-Files.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Printing-PDF-Files.md @@ -1,13 +1,13 @@ --- layout: post -title: Printing PDF Files in WPF Pdf Viewer control | Syncfusion -description: Learn about Printing PDF Files support in Syncfusion®; Essential Studio® WPF Pdf Viewer control, its elements and more. +title: Printing PDF Files in WPF PDF Viewer control | Syncfusion +description: Learn about Printing PDF Files support in Syncfusion®; Essential Studio® WPF PDF Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: ug --- -# Printing PDF Files in WPF Pdf Viewer +# Printing PDF Files in WPF PDF Viewer PDF Viewer allows printing loaded PDFs using the Print button in the toolbar. The following Print dialog opens upon triggering the Print button. @@ -55,7 +55,7 @@ pdfviewer1.Print(printerName) ## Customizing print size -PDF viewer printer settings allows scaling PDF pages to shrink or enlarge while printing. +PDF Viewer printer settings allow scaling PDF pages to shrink or enlarge while printing. ### Actual Size @@ -133,7 +133,7 @@ pdfviewer1.PrinterSettings.ScalePercentage = 120 ## Printing PDF document with orientation settings -PDF Viewer printer settings allows the user to print the document with a custom orientation. +PDF Viewer printer settings allow the user to print the document with a custom orientation. ### Auto Portrait/Landscape @@ -159,7 +159,7 @@ pdfviewer1.PrinterSettings.PageOrientation = PdfViewerPrintOrientation.Auto ### Portrait -Portrait option prints the PDF document in portrait orientation and it overrides the orientation settings provided in the print dialog. The following code example illustrates the same. +Portrait option prints the PDF document in portrait orientation, and it overrides the orientation settings provided in the print dialog. The following code example illustrates the same. {% tabs %} {% highlight c# %} @@ -181,7 +181,7 @@ pdfviewer1.PrinterSettings.PageOrientation = PdfViewerPrintOrientation.Portrait ### Landscape -Landscape option prints the PDF document in landscape orientation and it overrides the orientation settings provided in print dialog. The following code example illustrates the same. +Landscape option prints the PDF document in landscape orientation, and it overrides the orientation settings provided in the print dialog. The following code example illustrates the same. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Redaction.md b/Document-Processing/PDF/PDF-Viewer/wpf/Redaction.md index 9850e45878..a6196c25ff 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Redaction.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Redaction.md @@ -41,15 +41,15 @@ End Sub Use the following steps to perform redaction in the PDF document page: -1. Click the redaction tool button in the left pane, this displays the redaction toolbar as a secondary toolbar in the `PdfViewerControl`. -2. Select **Mark for Redaction** from redaction toolbar to select the region or text to be redacted +1. Click the redaction tool button in the left pane, this displays the redaction toolbar as a secondary toolbar in the `PdfViewerControl`. +2. Select **Mark for Redaction** from redaction toolbar to select the region or text to be redacted - ![Mark for Redaction](Redaction_Images/Redaction_Images_0.png) + ![Mark for Redaction](Redaction_Images/Redaction_Images_0.png) -3. Use the mouse pointer to select the region or the text to be redacted. This operation will create a mark in the region selected. -4. Choose Apply in the redaction toolbar to redact the marked region. +3. Use the mouse pointer to select the region or the text to be redacted. This operation will create a mark in the region selected. +4. Choose Apply in the redaction toolbar to redact the marked region. -N> Undo and redo can only be performed before applying the redaction, these operations cannot be performed after applying redaction. +N> Undo and redo can only be performed before applying the redaction. These operations cannot be performed after applying redaction. ### Mark regions for redaction without UI interaction @@ -58,34 +58,36 @@ You can also mark regions for redaction without UI interaction from the code beh {% tabs %} {% highlight c# %} +using System.Collections.Generic; +using System.Drawing; + private void Button_Click(object sender, RoutedEventArgs e) -{ - List rectangles = new List(); - rectangles = new List() { new RectangleF(100, 100, 100, 100) }; - - // Appends regions to the existing marked regions, marking regions if it does not already exist. - pdfViewerControl.PageRedactor.MarkRegions(0, rectangles, false); - // Enable the redaction mode. - pdfViewerControl.PageRedactor.EnableRedactionMode = true; +{ + List rectangles = new List() { new RectangleF(100, 100, 100, 100) }; + + // Appends regions to the existing marked regions, marking regions if it does not already exist. + pdfViewerControl.PageRedactor.MarkRegions(0, rectangles, false); + // Enable the redaction mode. + pdfViewerControl.PageRedactor.EnableRedactionMode = true; } {% endhighlight %} {% endtabs %} -N> You can overwrite the existing marked regions with the new regions, By passing the value `true` for the `clearExisting` parameter of `MarkRegions` method. +N> You can overwrite the existing marked regions with the new regions, by passing the value `true` for the `clearExisting` parameter of `MarkRegions` method. -## Customizing redaction appearance +## Customizing redaction appearance -Choosing **Properties** from the redaction toolbar will show the default Redaction Tool Properties window, which contain two tabs: +Choosing **Properties** from the redaction toolbar will show the default Redaction Tool Properties window, which contains two tabs: -• Appearance -• General +- Appearance +- General ### Appearance tab The redacted area fill color, overlay text, and redaction mark area appearances can be customized using the options in the Appearance tab. -#### Redaction appearance +#### Redaction appearance The following image illustrates how to change the fill color of the redacted area. @@ -159,7 +161,7 @@ End Sub The marked redaction appearance represents the appearance of the region or text marked for redaction before the redaction is being applied. The fill color, border color, and fill color opacity of the redaction marked area can also be customized. -The following image illustrates how to customize the appearance of the redaction marked area. +The following image illustrates how to customize the appearance of the redaction marked area. ![Redaction Mark Appearance](Redaction_Images/Redaction_Images_3.png) @@ -206,7 +208,7 @@ The following image illustrates the customization of Author and Subject of the r ## Appearance of the included redaction -Selecting the properties option from the context menu that is displayed when right-clicking the selected redaction will show the Redaction Tool Properties window of selected redaction. +Selecting the properties option from the context menu that is displayed when right-clicking the selected redaction will show the Redaction Tool Properties window of the selected redaction. The following image illustrates how to customize the appearance of the included redaction. ![Redaction Properties](Redaction_Images/Redaction_Images_6.png) @@ -219,7 +221,7 @@ Notes can be added to the redaction marked region by choosing Open Pop-up note o ## Delete redaction marked region -Select the delete option from the context menu that is displayed when right-clicking the selected redaction marked region will delete the respective redaction from the PDF document. +Selecting the delete option from the context menu that is displayed when right-clicking the selected redaction marked region will delete the respective redaction from the PDF document. The following image illustrates how to delete the included redaction from the PDF document. ![Redaction Delete](Redaction_Images/Redaction_Images_8.png) @@ -228,7 +230,7 @@ The following image illustrates how to delete the included redaction from the PD ### Redaction applied notification -The `RedactionApplied` event notifies you when the marked regions of the page(s) are redacted. It provides the details of the redacted region through the `RedactionEventArgs`. The following code shows how to wire the event in [PdfViewerControl](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html). +The `RedactionApplied` event notifies you when the marked regions of the page(s) are redacted. It provides the details of the redacted region through the `RedactionEventArgs`. The following code shows how to wire the event in [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). {% tabs %} {% highlight c# %} @@ -238,7 +240,7 @@ using System.Collections.Generic; using System.Windows; namespace RedactionAppliedEventDemo -{ +{ public partial class MainWindow : Window { public MainWindow() @@ -270,9 +272,9 @@ namespace RedactionAppliedEventDemo ## Keyboard shortcuts The following keyboard shortcuts are available to customize the marked redaction in the PDF document: -• Delete key: Deletes the selected mark redaction from the PDF document. -• Ctrl + Z: Performs undo functionality for recently performed operations. -• Ctrl + Y: Performs redo functionality for recently performed operations. +- Delete key: Deletes the selected mark redaction from the PDF document. +- Ctrl + Z: Performs undo functionality for recently performed operations. +- Ctrl + Y: Performs redo functionality for recently performed operations. N> All these operations can only be performed before applying the redaction. diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Right-To-Left.md b/Document-Processing/PDF/PDF-Viewer/wpf/Right-To-Left.md index 35aefc9607..8b0f8363c1 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Right-To-Left.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Right-To-Left.md @@ -13,7 +13,7 @@ The [WPF PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/wpf-pdf-viewer) c ## Enabling RTL in WPF PDF Viewer -RTL can be configured in the WPF PDF Viewer using the `FlowDirection` property. This can be set either in **XAML** or in the **code-behind (C#)**. +RTL can be configured in the WPF PDF Viewer using the `FlowDirection` property. By default, the layout direction is `LeftToRight`; setting it to `RightToLeft` enables RTL. This can be set either in **XAML** or in the **code-behind (C#)**. ## Configuring RTL in XAML @@ -23,7 +23,7 @@ RTL can be enabled in XAML by setting the `FlowDirection` property to `RightToLe {% tabs %} {% highlight xaml %} - + @@ -33,11 +33,14 @@ RTL can be enabled in XAML by setting the `FlowDirection` property to `RightToLe ## Configuring RTL in Code-Behind (C#) -RTL can also be configured programmatically by setting the `FlowDirection` property in the code-behind. Refer the following code snippet. +RTL can also be configured programmatically by setting the `FlowDirection` property in the code-behind. Refer to the following code snippet. {% tabs %} {% highlight c# %} +using System.Windows; +using Syncfusion.Windows.PdfViewer; + namespace RTLSample { public partial class MainWindow : Window diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Saving-the-PDF-document.md b/Document-Processing/PDF/PDF-Viewer/wpf/Saving-the-PDF-document.md index 3f7b4bc208..cdf8db977c 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Saving-the-PDF-document.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Saving-the-PDF-document.md @@ -20,7 +20,7 @@ You can also call the [Save](https://help.syncfusion.com/cr/wpf/Syncfusion.Windo {% tabs %} {% highlight c# %} -Private void SavePDF() +private void SavePDF() { //Save the PDF file to a specific file path after doing any modifications by passing the file name as a parameter to the `Save` method. pdfViewer.Save("Saved.pdf"); @@ -75,9 +75,9 @@ namespace SaveEvents {% endhighlight %} {% endtabs %} -### Canceling save in Save events +### Canceling a save operation -The [BeginSave](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_BeginSave) event occurs before initiating the save operation of the PDF file. It also allows you to cancel the save operation using the [Cancel](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.BeginSaveEventArgs.html#Syncfusion_Windows_PdfViewer_BeginSaveEventArgs_Cancel) property of [BeginSaveEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.BeginSaveEventArgs.html). The following code shows how to wire the event in the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). +You can cancel the save operation by setting the [Cancel](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.BeginSaveEventArgs.html#Syncfusion_Windows_PdfViewer_BeginSaveEventArgs_Cancel) property of [BeginSaveEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.BeginSaveEventArgs.html) to `true` within the [BeginSave](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_BeginSave) event handler. The following code shows how to cancel the save operation in the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Searching-Text.md b/Document-Processing/PDF/PDF-Viewer/wpf/Searching-Text.md index 8ff4ba2b45..491d100207 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Searching-Text.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Searching-Text.md @@ -17,11 +17,23 @@ The WPF PDF Viewer allows you to search and highlight the text in the PDF files. N> [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) is used to view the PDF documents without the toolbar. So, make use of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) to search the text using search box. +N> The code examples below use the following namespaces: +```csharp +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows; +using Syncfusion.Windows.PdfViewer; +``` +Ensure a `PdfViewerControl` named `pdfViewer` is added to your view and that the document is loaded (for example, `pdfViewer.Load("sample.pdf")`). + ## Search text in PDF programmatically The WPF PDF Viewer also allows a user to search for text in the PDF document programmatically using the following methods * SearchText method +* SearchNextText method +* SearchPreviousText method * FindText method ## Search Text method @@ -30,7 +42,7 @@ The [SearchText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer ### Search the initial occurrence of the text -The [SearchText(String)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchText_System_String_) method finds the occurrences of the target text and highlights the first occurrence of the search in the UI. A user can also search the text with case sensitivity by passing the Boolean parameter as ‘true’ to the [SearchText(String, Boolean)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchText_System_String_System_Boolean_) method. The below code illustrates how to search a text in a PDF programmatically. +The [SearchText(String)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchText_System_String_) method finds the occurrences of the target text and highlights the first occurrence of the search in the UI. A user can also search the text with case sensitivity by passing the Boolean parameter as ‘true’ to the [SearchText(String, Boolean)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchText_System_String_System_Boolean_) method. The following code example illustrates how to search a text in a PDF programmatically. {% tabs %} {% highlight c# %} @@ -47,7 +59,7 @@ private void PdfViewer_DocumentLoaded(object sender, System.EventArgs args) ### Search the next occurrence of the text -The [SearchNextText(String)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchNextText_System_String_) method highlights the next occurrence of the highlighted search in the UI. If there is no highlighted search, it will highlight the first occurrence of the search. A user can also search the text with case sensitivity by passing the Boolean parameter as ‘true’ to the [SearchNextText(String, Boolean)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchNextText_System_String_System_Boolean_) method. The below code snippet illustrates how to search the next occurrence of the text programmatically. +The [SearchNextText(String)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchNextText_System_String_) method highlights the next occurrence of the highlighted search in the UI. If there is no highlighted search, it will highlight the first occurrence of the search. A user can also search the text with case sensitivity by passing the Boolean parameter as ‘true’ to the [SearchNextText(String, Boolean)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchNextText_System_String_System_Boolean_) method. The following code example illustrates how to search the next occurrence of the text programmatically. {% tabs %} {% highlight c# %} @@ -63,14 +75,14 @@ private void SearchNext_Click(object sender, RoutedEventArgs e) ### Search the previous occurrence of the text -The [SearchPreviousText(String)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchPreviousText_System_String_) method highlights the previous occurrence of the highlighted search in the UI. The user can also search the text with case sensitivity bypassing the Boolean parameter as ‘true’ to the [SearchPreviousText(String, Boolean)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchPreviousText_System_String_System_Boolean_) method. The below code snippet illustrates how to search the previous occurrence of the text programmatically. +The [SearchPreviousText(String)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchPreviousText_System_String_) method highlights the previous occurrence of the highlighted search in the UI. The user can also search the text with case sensitivity by passing the Boolean parameter as ‘true’ to the [SearchPreviousText(String, Boolean)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SearchPreviousText_System_String_System_Boolean_) method. The following code example illustrates how to search the previous occurrence of the text programmatically. {% tabs %} {% highlight c# %} private void SearchPrevious_Click(object sender, RoutedEventArgs e) { - //Search and highlight the previuos occurrence of the target text + //Search and highlight the previous occurrence of the target text pdfViewer.SearchPreviousText("Target text"); } @@ -79,13 +91,13 @@ private void SearchPrevious_Click(object sender, RoutedEventArgs e) ## Find text method -N> From version 27.1.x, we have used text extraction engine for find text from PDF documents. By default text extraction engine uses PDFium for extracting text information. Please refer to the [link](https://help.syncfusion.com/wpf/pdf-viewer/text-extraction-engines) for more details. +N> From version 27.1.x, we have used the text extraction engine for finding text from PDF documents. By default, the text extraction engine uses PDFium for extracting text information. Please refer to the [link](https://help.syncfusion.com/wpf/pdf-viewer/text-extraction-engines) for more details. The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_String_System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_System_Drawing_RectangleF____) method allows the user to search a particular text and get its bounds after loading the document in the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_String_System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_System_Drawing_RectangleF____) method returns ‘true’ when the given text is found in the document; else, it returns ‘false’. ### Find and get the bounds of a text -The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_String_System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_System_Drawing_RectangleF____) method takes the input argument as the given text. It provides a dictionary that contains the page index and the list of rectangular coordinates(bounds) of the text found on that page. The below code snippet shows how to get the bounds of the given text: +The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_String_System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_System_Drawing_RectangleF____) method takes the input argument as the given text. It provides a dictionary that contains the page index and the list of rectangular coordinates (bounds) of the text found on that page. The following code example illustrates how to get the bounds of the given text: {% tabs %} {% highlight c# %} @@ -109,7 +121,7 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args) ### Find and get the bounds of a text on the desired page -The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_String_System_Int32_System_Collections_Generic_List_System_Drawing_RectangleF___) method takes the input arguments as the text to be found along with the desired page index and provides a list of values that contains the rectangular coordinates(bounds) of the found text. The below code snippet shows how to get the bounds of the given text on a particular page: +The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_String_System_Int32_System_Collections_Generic_List_System_Drawing_RectangleF___) method takes the input arguments as the text to be found along with the desired page index and provides a list of values that contains the rectangular coordinates (bounds) of the found text. The following code example illustrates how to get the bounds of the given text on a particular page: {% tabs %} {% highlight c# %} @@ -123,7 +135,7 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args) bool isMatchFound = pdfViewer.FindText("FindText",0, out textSearch); if (isMatchFound) { - //Get the bounds of the first occurance in the particluar page + //Get the bounds of the first occurrence in the particular page RectangleF bounds = textSearch[0]; } } @@ -133,7 +145,7 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args) ### Find and get the bounds of the list of text -The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_Collections_Generic_List_System_String__System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_Syncfusion_Windows_PdfViewer_TextSearchResult____) method takes the input argument as the list of text that needs to be found. It provides a list of ‘TextSearchResult’, which contains the found text and its rectangular coordinates(bounds). The below code snippet shows how to get the bounds of the found text from the Text Search Result: +The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_Collections_Generic_List_System_String__System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_Syncfusion_Windows_PdfViewer_TextSearchResult____) method takes the input argument as the list of text that needs to be found. It provides a `Dictionary` mapping each page index to a list of [TextSearchResult](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.TextSearchResult.html) objects, where each entry contains the found text and its rectangular coordinates (bounds). The following code example illustrates how to get the bounds of the found text from the TextSearchResult: {% tabs %} {% highlight c# %} @@ -143,7 +155,7 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args) //Get the occurrences of the target text and location. Dictionary> searchResult = new Dictionary>(); //List of text need to be found - List findText = new List() {"Find","Text"};; + List findText = new List() {"Find","Text"}; //Return true, if the given text is found in the particular page bool isMatchFound = pdfViewer.FindText(findText, out searchResult); @@ -157,9 +169,9 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args) {% endhighlight %} {% endtabs %} -### Find and get the bounds of the list of text on multiple lines +### Find and get the bounds of the list of text on the desired page -The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) method provides an overload with an `enableMultilineSearch` parameter that allows detection of matches spanning line breaks or multiple pages. When enabled, results are returned as line‑based TextSearchResult entries grouped by page, including the matched text and corresponding RectangleF bounds. The default value of enableMultilineSearch is false. +The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_Collections_Generic_List_System_String__System_Int32_System_Collections_Generic_List_Syncfusion_Pdf_Parsing_MatchedItem___) method takes the input argument as the list of text to be found along with the desired page index and provides the list of [MatchedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Parsing.MatchedItem.html), which contains the matched text and its rectangular coordinates (bounds). The following code example illustrates how to get the bounds of the text from the matched item: {% tabs %} {% highlight c# %} @@ -167,36 +179,25 @@ The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.P private void PdfViewer_DocumentLoaded(object sender, EventArgs args) { //Get the occurrences of the target text and location. - Dictionary> searchResult = new Dictionary>(); + List searchResult = new List(); //List of text need to be found - List findText = new List() {"Find the text that spans across multiple lines and pages"}; + List findText = new List() {"Find","Text"}; - //Enable multiline search to detect line and page breaks and return line-wise results. - //Return true, if the given text is found across lines/pages - bool isMatchFound = pdfViewer.FindText(findText, out searchResult, true); + //Return true, if the given text is found in the particular page + bool isMatchFound = pdfViewer.FindText(findText,0, out searchResult); if (isMatchFound) { - foreach (var Index in searchResult) - { - int pageIndex = Index.Key; - List results = Index.Value; - foreach (TextSearchResult result in results) - { - //The Bounds contains the line-wise rectangle for the matched text. - RectangleF bounds = result.Bounds; - //The Text property contains the matched text for this line. - string matchedText = result.Text; - } - } + //Get the bounds of the first MatchedItem on the desired page + RectangleF bounds = searchResult[0].Bounds; } } {% endhighlight %} {% endtabs %} -### Find and get the bounds of the list of text on the desired page +### Find and get the bounds of the list of text on multiple lines -The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_Collections_Generic_List_System_String__System_Int32_System_Collections_Generic_List_Syncfusion_Pdf_Parsing_MatchedItem___) method takes the input argument as the list of text to be found along with the desired page index and provides the list of [MatchedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Parsing.MatchedItem.html), which contains the matched text, and its rectangular coordinates(bounds). The below code snippet illustrates how to get the bounds of the text from the matched item: +The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_Collections_Generic_List_System_String__System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_Syncfusion_Windows_PdfViewer_TextSearchResult___System_Boolean_) method provides an overload with an `enableMultilineSearch` parameter that allows detection of matches spanning line breaks or multiple pages. When enabled, results are returned as line-based TextSearchResult entries grouped by page, including the matched text and corresponding RectangleF bounds. The default value of `enableMultilineSearch` is `false`. Use this overload when the text to find may wrap across lines or pages. {% tabs %} {% highlight c# %} @@ -204,16 +205,27 @@ The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.P private void PdfViewer_DocumentLoaded(object sender, EventArgs args) { //Get the occurrences of the target text and location. - List searchResult = new List(); + Dictionary> searchResult = new Dictionary>(); //List of text need to be found - List findText = new List() {"Find","Text"}; + List findText = new List() {"Find the text that spans across multiple lines and pages"}; - //Return true, if the given text is found in the particular page - bool isMatchFound = pdfViewer.FindText(findText,0, out searchResult); + //Enable multiline search to detect line and page breaks and return line-wise results. + //Return true, if the given text is found across lines/pages + bool isMatchFound = pdfViewer.FindText(findText, out searchResult, true); if (isMatchFound) { - //Get the bounds of the first MatchedItem on the desired page - RectangleF bounds = searchResult[0].Bounds; + foreach (var entry in searchResult) + { + int pageIndex = entry.Key; + List results = entry.Value; + foreach (TextSearchResult result in results) + { + //The Bounds contains the line-wise rectangle for the matched text. + RectangleF bounds = result.Bounds; + //The Text property contains the matched text for this line. + string matchedText = result.Text; + } + } } } diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Select-and-copy-text.md b/Document-Processing/PDF/PDF-Viewer/wpf/Select-and-copy-text.md index f244936ee3..0cd57516b1 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Select-and-copy-text.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Select-and-copy-text.md @@ -9,7 +9,7 @@ documentation: ug # Select and Copy Text in PDF files using WPF PDF Viewer -In PDF Viewer, text can be selected by clicking the mouse left button and dragging the mouse pointer over the text in any direction. +In PDF Viewer, text can be selected by clicking the left mouse button and dragging the mouse pointer over the text in any direction. N> From version 19.4.0.48, we have updated our default text extraction engine to PDFium for extracting text information from PDF documents. Based on the text information, we select text in the PDF documents. Please refer to the [link](https://help.syncfusion.com/wpf/pdf-viewer/text-extraction-engines) for more details. @@ -30,6 +30,8 @@ The selected text can be retrieved as string from the [TextSelectionCompletedEve {% tabs %} {% highlight c# %} +using System.Drawing; + private void PdfViewer_TextSelectionCompleted(object sender, TextSelectionCompletedEventArgs args) { //Get the whole selected text @@ -43,7 +45,7 @@ private void PdfViewer_TextSelectionCompleted(object sender, TextSelectionComple ## Copying the selected text -The selected text can be copied by clicking the copy from the context menu, which appears when clicking the right mouse button after the text is selected. +The selected text can be copied by clicking **Copy** from the context menu, which appears when clicking the right mouse button after the text is selected. ![WPF PDF Viewer Copying the Selected Text](Select_and_copy_text_images/wpf-pdf-viewer-copying-the-selected-text.png) diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Themes.md b/Document-Processing/PDF/PDF-Viewer/wpf/Themes.md index 2d26bb90b7..0e84f5e930 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Themes.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Themes.md @@ -1,7 +1,7 @@ --- layout: post title: Themes in WPF Pdf Viewer control | Syncfusion® -description: Learn about theme support in Syncfusion® WPF Pdf Viewer, including available themes, UI elements, customization options, and usage details. +description: Learn about the built-in themes supported by Syncfusion® WPF PDF Viewer and how to apply them. platform: document-processing control: PDF Viewer documentation: ug @@ -19,10 +19,10 @@ PdfViewerControl supports the following built-in themes. * FluentDark * SystemTheme -Refer to the below links to apply themes for the PdfViewerControl, +Refer to the following links to apply themes for the PdfViewerControl: * [Apply theme using SfSkinManager](https://help.syncfusion.com/wpf/themes/skin-manager) - + * [Create a custom theme using ThemeStudio](https://help.syncfusion.com/wpf/themes/theme-studio#creating-custom-theme) ![WPF PDF Viewer Theme](getting-started_images/wpf-pdf-viewer-theme.png) diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Toggling-visibility-of-the-scroll-bar.md b/Document-Processing/PDF/PDF-Viewer/wpf/Toggling-visibility-of-the-scroll-bar.md index 2549c5e1bb..5cc608d1f0 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Toggling-visibility-of-the-scroll-bar.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Toggling-visibility-of-the-scroll-bar.md @@ -1,7 +1,7 @@ --- layout: post -title: Toggle visibility of the scroll bar in WPF Pdf Viewer | Syncfusion®; -description: Learn about Toggle visibility of the scroll bar support in Syncfusion®; WPF Pdf Viewer control and more. +title: Toggle visibility of the scroll bar in WPF Pdf Viewer | Syncfusion® +description: Learn how to toggle the visibility of the scroll bar in Syncfusion® WPF Pdf Viewer control and more. platform: document-processing control: PDF Viewer documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Toggle visibility of the scroll bar in WPF Pdf Viewer -PDF Viewer supports showing and hiding scrollbar, when you feel to use the PDF Viewer only with the touch support, you can hide the default scrollbars of the PDF Viewer using the [ShowScrollbar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ShowScrollbar). The following code example hides the scrollbar in the PDF Viewer control. +PDF Viewer supports showing and hiding a scrollbar, when you want to use the PDF Viewer only with touch support, you can hide the default scrollbars of the PDF Viewer using the [ShowScrollbar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ShowScrollbar). The following code example hides the scrollbar in the PDF Viewer control. {% tabs %} {% highlight c# %} @@ -20,7 +20,7 @@ PdfViewerControl pdfViewer1 = new PdfViewerControl(); pdfViewer1.Load("Sample.pdf"); // Hiding the scrollbar of the PDF Viewer -pdfviewer1.ShowScrollbar = false; +pdfViewer1.ShowScrollbar = false; {% endhighlight %} @@ -34,7 +34,7 @@ Private pdfViewer1 As New PdfViewerControl() pdfViewer1.Load("Sample.pdf") ' Hiding the scrollbar of the PDF Viewer -pdfviewer1.ShowScrollbar = False +pdfViewer1.ShowScrollbar = False {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Toggling-visibility-of-the-tool-bar.md b/Document-Processing/PDF/PDF-Viewer/wpf/Toggling-visibility-of-the-tool-bar.md index 83953355f9..94627eb3c1 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Toggling-visibility-of-the-tool-bar.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Toggling-visibility-of-the-tool-bar.md @@ -1,7 +1,7 @@ --- layout: post title: Toggle visibility of the tool bar in WPF Pdf Viewer | Syncfusion -description: Learn about Toggle visibility of the tool bar support in Syncfusion®; WPF Pdf Viewer control and more. +description: Learn how to toggle the visibility of the tool bar in Syncfusion® WPF Pdf Viewer control and more. platform: document-processing control: PDF Viewer documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Toggle visibility of the tool bar in WPF Pdf Viewer -PDF Viewer supports showing and hiding toolbar, when you feel to customize the toolbar, you can hide the default toolbar of the PDF Viewer using the [ShowToolbar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ShowToolbar) property. The following code example hides the default toolbar in the PDF Viewer control. +PDF Viewer supports showing and hiding the toolbar. To customize the toolbar, you can hide the default toolbar of the PDF Viewer using the [ShowToolbar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ShowToolbar) property. The following code example hides the default toolbar in the PDF Viewer control. {% tabs %} {% highlight c# %} @@ -23,54 +23,54 @@ pdfViewer.ShowToolbar = False {% endhighlight %} {% endtabs %} -## Expand the Annotation toolbar by programmatically. +## Expand the annotation toolbar programmatically -The annotation toolbar is a secondary toolbar of PDF Viewer control that contains a collection of annotation buttons. By default, this annotation toolbar will be collapsed. To expand annotation toolbar at runtime, the user can click show annotations button, which is present in the primary toolbar. In order to expand annotation toolbar at loading or by programmatically, the user can just enable the isChecked property in annotations button as true. The following code example shows how to expands the annotation toolbar by programmatically in the PDF Viewer control. +The annotation toolbar is a secondary toolbar of the PDF Viewer control that contains a collection of annotation buttons. By default, this annotation toolbar will be collapsed. To expand the annotation toolbar at runtime, the user can click show annotations button, which is present in the primary toolbar. In order to expand the annotation toolbar at loading or programmatically, the user can just enable the isChecked property in the annotations button as true. The following code example shows how to expand the annotation toolbar programmatically in the PDF Viewer control. {% tabs %} {% highlight c# %} private void ExpandAnnotationToolbar() { - // Get the instance of the toolbar using its template name. - DocumentToolbar toolbar = pdfViewer.Template.Findname("PART_Toolbar", pdfViewer) as DocumentToolbar; - // Get the instance of the annotation button using its template name. - ToggleButton annotationButton = (ToggleButton)toolbar.Template.Findname("PART_Annotations", toolbar); - // Expand the annotation toolbar. - annotationButton.IsChecked = true; + // Get the instance of the toolbar using its template name. + DocumentToolbar toolbar = pdfViewer.Template.FindName("PART_Toolbar", pdfViewer) as DocumentToolbar; + // Get the instance of the annotation button using its template name. + ToggleButton annotationButton = (ToggleButton)toolbar.Template.FindName("PART_Annotations", toolbar); + // Expand the annotation toolbar. + annotationButton.IsChecked = true; } {% endhighlight %} {% highlight vbnet %} Private Sub ExpandAnnotationToolbar() ' Get the instance of the toolbar using its template name. - Dim toolbar As DocumentToolbar = TryCast(pdfViewer.Template.Findname("PART_Toolbar", pdfViewer), DocumentToolbar) - ' Get the instance of the annotation button using its template name. - Dim annotationButton As ToggleButton = CType(toolbar.Template.Findname("PART_Annotations", toolbar), ToggleButton) - ' Expand the annotation toolbar. - annotationButton.IsChecked = True + Dim toolbar As DocumentToolbar = TryCast(pdfViewer.Template.FindName("PART_Toolbar", pdfViewer), DocumentToolbar) + ' Get the instance of the annotation button using its template name. + Dim annotationButton As ToggleButton = CType(toolbar.Template.FindName("PART_Annotations", toolbar), ToggleButton) + ' Expand the annotation toolbar. + annotationButton.IsChecked = True End Sub {% endhighlight %} {% endtabs %} ## Hide the vertical toolbar -You can hide the vertical toolbar which is present in the left side of PDF Viewer by disabling all the items present in the toolbar. Refer to the following code to hide the vertical toolbar. +You can hide the vertical toolbar which is present on the left side of the PDF Viewer by disabling all the items in the toolbar. Refer to the following code to hide the vertical toolbar. {% tabs %} {% highlight c# %} private void HideVerticalToolbar() { - // Hides the thumbnail icon. - pdfViewer.ThumbnailSettings.IsVisible = false; - // Hides the bookmark icon. - pdfViewer.IsBookmarkEnabled = false; - // Hides the layer icon. - pdfViewer.EnableLayers = false; - // Hides the organize page icon. - pdfViewer.PageOrganizerSettings.IsIconVisible = false; - // Hides the redaction icon. - pdfViewer.EnableRedactionTool = false; - // Hides the form icon. - pdfViewer.FormSettings.IsIconVisible = false; + // Hides the thumbnail icon. + pdfViewer.ThumbnailSettings.IsVisible = false; + // Hides the bookmark icon. + pdfViewer.IsBookmarkEnabled = false; + // Hides the layer icon. + pdfViewer.EnableLayers = false; + // Hides the organize page icon. + pdfViewer.PageOrganizerSettings.IsIconVisible = false; + // Hides the redaction icon. + pdfViewer.EnableRedactionTool = false; + // Hides the form icon. + pdfViewer.FormSettings.IsIconVisible = false; } {% endhighlight %} {% highlight vbnet %} @@ -85,4 +85,4 @@ End Sub {% endhighlight %} {% endtabs %} -N> The sample project for disabling top and left toolbar is available in the [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/Toolbar/HideToolbar). +N> The sample project for disabling top and left toolbar is available in the [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/Toolbar/HideToolbar). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Viewing-PDF-Files.md b/Document-Processing/PDF/PDF-Viewer/wpf/Viewing-PDF-Files.md index ef5077fb35..f6e94bf485 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Viewing-PDF-Files.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Viewing-PDF-Files.md @@ -18,16 +18,16 @@ You can open a PDF file from the toolbar by browsing it from the local disk. You 1. Add the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) in the MainWindow.xaml and run the project. ~~~xaml - - - - - + + + + + ~~~ 2. Click the Open button in the toolbar, as shown in the following picture. ![WPF PDF Viewer Open PDF file](view-pdf-file-images/wpf-pdf-viewer-open-file.png) @@ -48,7 +48,7 @@ namespace PdfViewerDemo /// public partial class MainWindow : Window { - # region Constructor + #region Constructor public MainWindow() { InitializeComponent(); @@ -64,7 +64,7 @@ namespace PdfViewerDemo ## View PDF file from stream -You can view the PDF file from code behind, by passing the [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?redirectedfrom=MSDN&view=netcore-3.1) as a parameter to the Load method of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). Refer to the following code to perform the same. +You can view the PDF file from code behind, by passing the [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream) as a parameter to the Load method of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). Refer to the following code to perform the same. {% tabs %} {% highlight c# %} @@ -78,7 +78,7 @@ namespace PdfViewerDemo /// public partial class MainWindow : Window { - # region Constructor + #region Constructor public MainWindow() { InitializeComponent(); @@ -95,7 +95,7 @@ namespace PdfViewerDemo ## View PDF file using the ItemSource property -You can also view a PDF file using the [ItemSource](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ItemSource) property of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). The property accepts a string file path, a [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-7.0&redirectedfrom=MSDN), and a [PdfLoadedDocument](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.Parsing.PdfLoadedDocument.html) object. +You can also view a PDF file using the [ItemSource](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ItemSource) property of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). The property accepts a string file path, a [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream), and a [PdfLoadedDocument](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.Parsing.PdfLoadedDocument.html) object. {% tabs %} {% highlight c# %} @@ -108,7 +108,7 @@ namespace PdfViewerDemo /// public partial class MainWindow : Window { - # region Constructor + #region Constructor public MainWindow() { InitializeComponent(); @@ -122,7 +122,8 @@ namespace PdfViewerDemo {% endhighlight %} {% endtabs %} -Refer the below code snippet to load a [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-7.0&redirectedfrom=MSDN) using the [ItemSource](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ItemSource) property +Refer to the following code snippet to load a [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream) using the [ItemSource](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ItemSource) property. + {% tabs %} {% highlight c# %} //Load PDF file as Stream using the `ItemSource` property. @@ -141,11 +142,11 @@ pdfViewer.ItemSource = pdfLoadedDocument; ## View PDF file using ItemSource with DataContext -The [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html)’s [ItemSource](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ItemSource) property allows you to bind PDF documents in XAML. This property accepts a stream input that can be bounded to the viewer during initialization. The following steps explain how to display a PDF file using the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html): +The [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html)’s [ItemSource](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ItemSource) property allows you to bind PDF documents in XAML. This property accepts a stream input that can be bound to the viewer during initialization. The following steps explain how to display a PDF file using the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html): N> From v16.3.0x onwards, PDF Viewer uses PDFium as a default rendering engine to render the PDF pages, which is a more robust and promising rendering engine. Refer to this [link](https://help.syncfusion.com/wpf/pdf-viewer/pdf-rendering-engines) for more details. -1. Create a simple class in the application that implements [INotifyPropertyChanged](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged?view=netcore-3.1) and declare a file stream property in the class as shown in the following code sample. +1. Create a simple class in the application that implements [INotifyPropertyChanged](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged) and declare a file stream property in the class as shown in the following code sample. {% tabs %} {% highlight c# tabtitle="PdfReport.cs" %} @@ -188,27 +189,32 @@ namespace PdfViewerDemo {% endhighlight %} {% endtabs %} -2. Set the [DataContext](https://learn.microsoft.com/en-us/dotnet/api/system.windows.frameworkelement.datacontext?view=windowsdesktop-8.0&viewFallbackFrom=netcore-3.1) to the Window for data binding. To add the `DataContext` in XAML, use the following code example. +2. Set the [DataContext](https://learn.microsoft.com/en-us/dotnet/api/system.windows.frameworkelement.datacontext) to the Window for data binding. To add the `DataContext` in XAML, use the following code example. {% tabs %} {% highlight xaml tabtitle="MainWindow.xaml" %} - + {% endhighlight %} -{% endtabs %} 3. After setting the `DataContext`, bind the file stream property to the [ItemSource](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ItemSource) dependency property of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) using the following code sample in XAML. {% tabs %} {% highlight xaml tabtitle="MainWindow.xaml" %} - - + {% endhighlight %} {% endtabs %} @@ -222,16 +228,16 @@ The [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfV 1. Add the [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) control in the MainWindow.xaml. ~~~xaml - - - - - + + + + + ~~~ 2. Load the file using the [Load](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_Load_System_String_) method as mentioned in the following code snippet in MainWindow.xaml.cs. @@ -261,7 +267,7 @@ The [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfV 3. Run the project. -The following picture illustrates how the PDF file being displayed in [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) control. ![WPF PDF Viewer File in PdfDocumentView](view-pdf-file-images/wpf-pdf-viewer-file-in-pdfdocumentview.png) +The following picture illustrates how the PDF file is being displayed in [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) control. ![WPF PDF Viewer File in PdfDocumentView](view-pdf-file-images/wpf-pdf-viewer-file-in-pdfdocumentview.png) ## Avoid exception while loading PDF Document @@ -284,7 +290,7 @@ For instance, when attempting to open a document through a button click event, u ## Obtain the PDF file information -You can get the information on the PDF file that is being displayed in the control using the [DocumentInfo](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_DocumentInfo) property of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). This property provides you the information such as file name and the folder name from that the PDF file is opened using the [FileName](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.DocumentInfo.html#Syncfusion_Windows_PdfViewer_DocumentInfo_FileName) and [FilePath](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.DocumentInfo.html#Syncfusion_Windows_PdfViewer_DocumentInfo_FilePath) properties respectively. +You can get the information on the PDF file that is being displayed in the control using the [DocumentInfo](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_DocumentInfo) property of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). This property provides you the information such as file name and the folder name from which the PDF file is opened using the [FileName](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.DocumentInfo.html#Syncfusion_Windows_PdfViewer_DocumentInfo_FileName) and [FilePath](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.DocumentInfo.html#Syncfusion_Windows_PdfViewer_DocumentInfo_FilePath) properties respectively. Refer to the following code to obtain the document information using the [DocumentInfo](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_DocumentInfo) property. @@ -296,11 +302,11 @@ using System.Windows; namespace PdfViewerDemo { /// - /// Interaction logic for Window1.xaml + /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { - # region Constructor + #region Constructor public MainWindow() { InitializeComponent(); @@ -327,11 +333,11 @@ using System.Windows; namespace PdfViewerDemo { /// - /// Interaction logic for Window1.xaml + /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { - # region Constructor + #region Constructor public MainWindow() { InitializeComponent(); diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-With-PDF-Coordinates.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-With-PDF-Coordinates.md index 6a3e75cdd1..c570dafb6e 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-With-PDF-Coordinates.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-With-PDF-Coordinates.md @@ -1,7 +1,7 @@ --- layout: post -title: PDF Coordinates in WPF Pdf Viewer control | Syncfusion® -description: Learn about PDF Coordinates support in Syncfusion® Essential Studio® WPF Pdf Viewer control, its elements and more. +title: PDF Coordinates in WPF PDF Viewer control | Syncfusion® +description: Learn about PDF Coordinates support in Syncfusion® Essential Studio® WPF PDF Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: ug @@ -13,9 +13,9 @@ The [WPF PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/wpf-pdf-viewer) a ## Client coordinates -The WPF PDF Viewer specifies the position of points in the client area(viewport) using client coordinates. The upper-left corner of the client area (viewport) of the control is the origin for client coordinates. The dimensions of the client area(viewport) are also known as **client rectangle**, which is the bounds of the control without non-client elements such as toolbars and scroll bars. The client rectangle in the WPF PDF Viewer is represented by the red rectangle in the following figure. +The WPF PDF Viewer specifies the position of points in the client area (viewport) using client coordinates. The upper-left corner of the client area (viewport) of the control is the origin for client coordinates. The dimensions of the client area (viewport) are also known as **client rectangle**, which is the bounds of the control without non-client elements such as toolbars and scroll bars. The client rectangle in the WPF PDF Viewer is represented by the red rectangle in the following figure. - ![WPF PDF Viewer Client Rectangle](PDF_Coordinates_Images/Client-Rectangle.png) + ![WPF PDF Viewer Client Rectangle](PDF_Coordinates_Images/Client-Rectangle.png) The client rectangle can be obtained by the [ClientRectangle](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ClientRectangle) property of the PDF Viewer. @@ -32,7 +32,7 @@ Rectangle clientRectangle = pdfViewerControl.ClientRectangle; PDF page coordinates are represented in terms of a device-independent coordinate system called user space, which is independent of the output device that will be used for printing or display. The user space coordinate system is initialized to its default state for each page of a PDF document. The length of a unit is 1/72 inches, which is approximately the same as a unit of **point(pt)**. As an example, the following figure shows the dimensions of a letter-sized paper in the PDF page coordinates with the WPF PDF Viewer. - ![WPF PDF Viewer Page Coordinates](PDF_Coordinates_Images/Page-Coordinates.png) + ![WPF PDF Viewer Page Coordinates](PDF_Coordinates_Images/Page-Coordinates.png) ## Get and set the scroll coordinates @@ -64,7 +64,7 @@ private void PdfViewerControl_PageClicked(object sender, PageClickedEventArgs e) //Retrieve the clicked client area position Point clientPoint = e.Position; //Retrieve the page number that corresponds to the client point - int pageNumber = pdfViewerControl.GetPageNumberFromClientPoint(clientPoint) + int pageNumber = pdfViewerControl.GetPageNumberFromClientPoint(clientPoint); //Retrieve the page point Point pagePoint = pdfViewerControl.ConvertClientPointToPagePoint(clientPoint, pageNumber); @@ -99,7 +99,7 @@ private void PdfViewer_ShapeAnnotationChanged(object sender, ShapeAnnotationChan ## Convert PDF page coordinates to scroll coordinates -The user can obtain the scroll coordinates using the [ConvertPagePointToScrollPoint](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ConvertPagePointToScrollingPoint_System_Windows_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code example explains how to convert a shape annotation’s position in the page coordinates to a scroll point in the PDF Viewer. +The user can obtain the scroll coordinates using the [ConvertPagePointToScrollPoint](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ConvertPagePointToScrollPoint_System_Windows_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code example explains how to convert a shape annotation's position in the page coordinates to a scroll point in the PDF Viewer. {% tabs %} {% highlight c# %} @@ -128,13 +128,13 @@ The user can bring the given rectangular region into view and zoom in to the doc {% tabs %} {% highlight c# %} -//Create a bound with respect to client area -Rect bounds = new Rect(400 , 300, 200, 400) -//Pass the converted rectangle in client coordinates to the ZoomToRect method. +//Create a bound with respect to page coordinates +Rect bounds = new Rect(400 , 300, 200, 400); +//Pass the converted rectangle in page coordinates to the ZoomToRect method. pdfViewerControl.ZoomToRect(bounds); {% endhighlight %} {% endtabs %} -N> You can refer to our [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the pdfviewer. \ No newline at end of file +N> You can refer to our [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the PDF viewer. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Export-and-Import-Annotations.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Export-and-Import-Annotations.md index b16472a257..9102284dbc 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Export-and-Import-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Export-and-Import-Annotations.md @@ -18,12 +18,12 @@ The required data format can be chosen from the [AnnotationDataFormat](https://h ## Exporting annotations -The ExportAnnotations method exports the annotations added in the document to a file or stream in specified file format. The annotation data format should be given as an arguments. +The ExportAnnotations method exports the annotations added in the document to a file or stream in specified file format. The annotation data format should be given as an argument. {% tabs %} {% highlight C# %} -//Export annotations to "fdf" data format to file -pdfViewer.ExportAnnotations("Annotation.fdf ", AnnotationDataFormat.fdf); +//Export annotations to "fdf" data format to file +pdfViewer.ExportAnnotations("Annotation.fdf", AnnotationDataFormat.fdf); //Export annotations to "fdf" data format to stream Stream stream = new MemoryStream(); @@ -34,7 +34,7 @@ pdfViewer.ExportAnnotations(stream, AnnotationDataFormat.fdf); ## Importing annotations -The ImportAnnotations method imports the annotations from the file or file stream of a specified type and fills the annotations into the loaded PDF document. The full path of file or file stream contains the annotation information. The annotation data format should be given as the arguments. +The ImportAnnotations method imports the annotations from the file or file stream of a specified type and fills the annotations into the loaded PDF document. The full path of the file or file stream that contains the annotation information should be provided. The annotation data format should be given as the argument. {% tabs %} {% highlight C# %} diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/File-Link-Annotation.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/File-Link-Annotation.md index 4f0b4e43a6..b3a9418e03 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/File-Link-Annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/File-Link-Annotation.md @@ -11,7 +11,7 @@ documentation: ug The PDF viewer supports file link annotations, which means that if you open a PDF document that contains file link annotations, you can click them to get the details of file linked with the annotation, through its clicked event. You can open the file externally from the application, using the details of the file obtained from the event. -## How to obtain the details of the of the annotation and the file linked with the annotation? +## How to obtain the details of the annotation and the file linked with the annotation? The [FileLinkAnnotationClicked](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FileLinkAnnotationClicked) event will be raised when you click the annotation in PDF pages. Refer to the following code example to wire the `FileLinkAnnotationClicked` event with the PDF Viewer. @@ -25,7 +25,7 @@ pdfViewer.FileLinkAnnotationClicked += PdfViewer_FileLinkAnnotationClicked; Using the [FileLinkAnnotationClickedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.FileLinkAnnotationClickedEventArgs.html) you can obtain the page number, bounds of the annotation through the [PageNumber](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.FileLinkAnnotationClickedEventArgs.html#Syncfusion_Windows_PdfViewer_FileLinkAnnotationClickedEventArgs_PageNumber) and [Bounds](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.FileLinkAnnotationClickedEventArgs.html#Syncfusion_Windows_PdfViewer_FileLinkAnnotationClickedEventArgs_Bounds) properties respectively. -Similarly, you can obtain the details of the file linked with the annotation using the [Settings](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.FileLinkAnnotationClickedEventArgs.html#Syncfusion_Windows_PdfViewer_FileLinkAnnotationClickedEventArgs_Settings) property in the [FileLinkAnnotationClickedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.FileLinkAnnotationClickedEventArgs.html). Refer to the following code example to obtain the details of the of the annotation and the file linked with the annotation +Similarly, you can obtain the details of the file linked with the annotation using the [Settings](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.FileLinkAnnotationClickedEventArgs.html#Syncfusion_Windows_PdfViewer_FileLinkAnnotationClickedEventArgs_Settings) property in the [FileLinkAnnotationClickedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.FileLinkAnnotationClickedEventArgs.html). Refer to the following code example to obtain the details of the annotation and the file linked with the annotation {% tabs %} {% highlight C# %} @@ -58,4 +58,4 @@ private void PdfViewer_FileLinkAnnotationClicked(object sender, FileLinkAnnotati {% endtabs %} -N> You can refer to our [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the pdfviewer. \ No newline at end of file +N> You can refer to our [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the PDF Viewer. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Highlight-Annotation.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Highlight-Annotation.md index 48e2b02409..dba450211b 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Highlight-Annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Highlight-Annotation.md @@ -11,13 +11,13 @@ documentation: ug The WPF PDF Viewer allows the user to highlight text in PDF files and provides options to edit or remove the existing highlights. The highlight inclusion mode can be enabled via the toolbar UI or the API. Once the highlight inclusion mode is activated, you can highlight the required text by selecting it. To select the text, hold down the left mouse button and drag the mouse pointer over the text. -To enable the mode from UI, click the below icon in the default toolbar of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). +To enable the mode from the UI, click the below icon in the default toolbar of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). ![Highlight icon in the WPF PDF Viewer toolbar](Annotation-images\highlight-icon.png) N> From version 19.4.0.48, we have updated our default text extraction engine to PDFium for extracting text information from PDF documents. Based on the text information, we create text markup annotations in the PDF documents. Please refer to the [link](https://help.syncfusion.com/wpf/pdf-viewer/text-extraction-engines) for more details. -If you are using [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) control, or your own toolbar, or if you want enable the mode programmatically, change the [AnnotationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_AnnotationMode) property of PDF Viewer to **Highlight**, as shown in the below code example. +If you are using [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) control, or your own toolbar, or if you want to enable the mode programmatically, change the [AnnotationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_AnnotationMode) property of PDF Viewer to **Highlight**, as shown in the below code example. {% tabs %} {% highlight C# %} @@ -114,7 +114,7 @@ End Sub ## Working with included/existing highlight annotations -Highlight annotation supports adding notes along with it, also it allows editing its color and opacity. To use these options, select the included/existing highlight annotation and click right using mouse, over the selected annotation, a pop up context menu will appear with the following options, +Highlight annotation supports adding notes along with it, also it allows editing its color and opacity. To use these options, select the included/existing highlight annotation and right-click using the mouse, over the selected annotation, a pop up context menu will appear with the following options, * Open Pop-up note * Properties @@ -122,13 +122,13 @@ Highlight annotation supports adding notes along with it, also it allows editing ### Open Pop-up notes -We can add notes to the highlight annotation choosing Open Pop-up note option from the context menu. The following image illustrates the notes added to the selected highlight annotation. The added notes will be saved along with the PDF document and if there is any existing notes, it will be displayed in here. +We can add notes to the highlight annotation choosing Open Pop-up note option from the context menu. The following image illustrates the notes added to the selected highlight annotation. The added notes will be saved along with the PDF document and if there are any existing notes, they will be displayed here. ![highlight annotation](Annotation-images\Highlight-Annotation-2.png) ### Properties -Selecting properties from the context menu will display the Highlight Properties window, which would consist of two tabs +Selecting Properties from the context menu will display the Highlight Properties window, which would consist of two tabs * Appearance * General @@ -139,7 +139,7 @@ The color and opacity of the highlight annotation can be edited using Appearance ##### Editing color of the annotation -The color of the selected highlight annotation will be displayed in the color row in the appearance tab. Selecting the Color would displays the color palette control, choosing a color from the color palette and clicking OK will apply the color to the highlight annotation. +The color of the selected highlight annotation will be displayed in the color row in the appearance tab. Selecting the Color will display the color palette, choosing a color from the color palette and clicking OK will apply the color to the highlight annotation. The following image illustrates how to change the color of the highlight annotation included. @@ -151,7 +151,7 @@ The following image illustrates the change in the color of the included highligh ##### Editing opacity of the annotation -The slider displayed in the Appearance tab will allow us to modify the opacity of the selected highlight annotation. You can also modify the opacity of the selected highlight annotation by giving numeric value in the opacity text box. +The slider displayed in the Appearance tab allows you to modify the opacity of the selected highlight annotation. You can also modify the opacity by entering a numeric value in the opacity text box. The following image illustrates how to change the opacity of the included highlight annotation. @@ -171,7 +171,7 @@ The following image illustrates the change in Author and Subject of the included ### Deleting an annotation -Selecting delete option from the context menu which will be displayed by right click on the selected annotation would delete the respective annotation from the PDF document. +Selecting the Delete option from the context menu displayed by right-clicking on the selected annotation would delete the respective annotation from the PDF document. The following image illustrates how to delete the included annotation from the PDF document. @@ -186,15 +186,9 @@ The following code shows how to wire and handle the event, and also how to chang {% tabs %} {% highlight C# %} -//wire the text markup changed event. +//Wire the text markup changed event. pdfViewer.TextMarkupAnnotationChanged += PdfViewer_TextMarkupAnnotationChanged; -{% endhighlight %} -{% endtabs %} - -{% tabs %} -{% highlight C# %} - private void PdfViewer_TextMarkupAnnotationChanged(object sender, TextMarkupAnnotationChangedEventArgs e) { //Get the action performed on the annotation diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Ink-Annotation.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Ink-Annotation.md index 716d933d86..07c56f04de 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Ink-Annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Ink-Annotation.md @@ -9,7 +9,7 @@ documentation: ug # Ink Annotation in WPF Pdf Viewer -PDF viewer WPF allows the user to include ink annotation in the PDF document and provides options to edit or remove the existing ink annotation in the PDF document. +WPF PDF Viewer allows the user to include ink annotation in the PDF document and provides options to edit or remove the existing ink annotation in the PDF document. The following code shows how to switch to ink annotation mode in code behind. @@ -121,7 +121,7 @@ End Sub ## How to set the author and subject of the ink annotation? -The author and subject fields of the ink annotation can be added for the ink annotation to be added to the PDF document. The follow code shows how to set the author and subject field of the ink annotation to be included. +The author and subject fields of the ink annotation can be added for the ink annotation to be added to the PDF document. The following code shows how to set the author and subject field of the ink annotation to be included. {% tabs %} {% highlight C# %} @@ -149,7 +149,7 @@ End Sub ## Working with included/existing ink annotations -Ink annotation supports adding notes along with it, also it allows editing its color, opacity and thickness. To use these options, select the included/existing ink annotation and click right using mouse, over the selected annotation, a pop up context menu will appear with the following options, +Ink annotation supports adding notes along with it, also it allows editing its color, opacity and thickness. To use these options, select the included/existing ink annotation and right-click using the mouse, over the selected annotation, a pop-up context menu will appear with the following options, * Open Pop-up note * Properties @@ -157,7 +157,7 @@ Ink annotation supports adding notes along with it, also it allows editing its c ### Open Pop-up notes -We can add notes to the ink annotation choosing Open Pop-up note option from the context menu. The following image illustrates the notes added to the selected ink annotation. The added notes will be saved along with the PDF document and if there is any existing notes, it will be displayed in here. +We can add notes to the ink annotation choosing Open Pop-up note option from the context menu. The following image illustrates the notes added to the selected ink annotation. The added notes will be saved along with the PDF document and if there are any existing notes, it will be displayed in here. ![Popup note](Annotation-images\Ink-Annotation-2.png) @@ -166,7 +166,7 @@ We can add notes to the ink annotation choosing Open Pop-up note option from the Selecting properties from the context menu will display the Ink Properties window, which would consist of two tabs * Appearance -* General +* General ### Appearance tab @@ -184,9 +184,9 @@ The following image illustrates the change in thickness of the selected ink anno ![Modified ink thickness](Annotation-images\Ink-Annotation-4.png) -#### Editing color of the annotation +#### Editing the color of the ink annotation -The color of the selected ink annotation will be displayed in the color row in the appearance tab. Selecting the Color would displays the color palette control, choosing a color from the color palette and clicking OK will apply the color to the ink annotation. +The color of the selected ink annotation will be displayed in the color row in the appearance tab. Selecting the Color displays the color palette control, choosing a color from the color palette and clicking OK will apply the color to the ink annotation. The following image illustrates how to change the color of the ink annotation included. @@ -196,7 +196,7 @@ The following image illustrates the change in the color of the ink annotation. ![Modified ink color](Annotation-images\Ink-Annotation-6.png) -#### Editing opacity of the annotation +#### Editing the opacity of the ink annotation The slider control displayed in the Appearance tab will allow us to modify the opacity of the selected ink annotation. You can also modify the opacity of the selected ink annotation by giving numeric value in the opacity text box. @@ -246,17 +246,19 @@ N> This tool can be used to erase the ink annotation only and not applicable for ## Events -The [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) notifies through events, when [AnnotationChangedAction](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationChangedAction.html) such us adding, deleting, select, deselect, moving and resizing made in annotations. It also provides the annotations common information such as annotation name, page index, bounds and action type performed in respective annotation. +The [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) notifies through events, when [AnnotationChangedAction](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationChangedAction.html) such as adding, deleting, select, deselect, moving and resizing made in annotations. It also provides the annotations common information such as annotation name, page index, bounds and action type performed in respective annotation. ### InkAnnotationChanged Event The [InkAnnotationChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_InkAnnotationChanged) event occurs when the [Action](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationChangedEventArgs.html#Syncfusion_Windows_PdfViewer_AnnotationChangedEventArgs_Action) performed in ink annotation. It provides the common information and annotation properties which are available in `Settings` through the [InkAnnotationChangedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.InkAnnotationChangedEventArgs.html). The user can modify the annotation properties through [Settings](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.InkAnnotationChangedEventArgs.html#Syncfusion_Windows_PdfViewer_InkAnnotationChangedEventArgs_Settings). -The following code shows how to write the `InkAnnotationChanged` event in `PdfViewerControl` +The following code shows how to subscribe and write the `InkAnnotationChanged` event in `PdfViewerControl`. {% tabs %} {% highlight C# %} +pdfviewer.InkAnnotationChanged += PdfViewer_InkAnnotationChanged; + private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedEventArgs e) { //COMMON PROPERTIES diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Working-with-Annotation-Comments.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Working-with-Annotation-Comments.md index 8177fdaf9c..2efa4d1a1b 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Working-with-Annotation-Comments.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Working-with-Annotation-Comments.md @@ -9,7 +9,7 @@ documentation: ug # Working with annotation comments -PDF viewer provides options to add, edit, and delete the comments to the following annotation in the PDF documents: +PDF viewer provides options to add, edit, and delete the comments for the following annotations in the PDF documents: * Ink. * Text markups (Highlight, Underline, Squiggly and Strikethrough). @@ -18,7 +18,7 @@ PDF viewer provides options to add, edit, and delete the comments to the followi * Text box (Text and Text Callout). * Sticky note. -![Annotation Comments](Annotation-images\comments.png) +![Annotation Comments](Annotation-images/comments.png) ## Expand/Collapse the comments pane @@ -28,7 +28,7 @@ Refer to the following code example to expand the comments pane. {% tabs %} {% highlight c# %} -Private void button_Click(object sender,RoutedEventArgs e) +private void button_Click(object sender,RoutedEventArgs e) { //expand the comments pane pdfViewer.CommentSettings.IsExpanded = true; @@ -55,7 +55,7 @@ Refer to the following code example to hide the comments button in the annotatio {% tabs %} {% highlight c# %} -Private void button_Click(object sender,RoutedEventArgs e) +private void button_Click(object sender,RoutedEventArgs e) { //hide the comments button in the annotation toolbar pdfViewer.CommentSettings.IsVisible = false; @@ -74,13 +74,13 @@ End Sub ## Adding a comment to the annotation -Annotation comment, comment replies, and status can be added to the PDF document using the comment panel. +Annotation comments, comment replies, and status can be added to the PDF document using the comment panel. ### Adding comments Annotation comments can be added to the PDF using the comment panel. If the comment panel is expanded, you can select the annotations and add annotation comments using the comment panel. The initial comment of the annotation will be reflected in the popup note and vice versa. -![Adding Comments](Annotation-images\add-comments.png) +![Adding Comments](Annotation-images/add-comments.png) ### Adding Comment Replies @@ -90,37 +90,37 @@ Annotation comments can be added to the PDF using the comment panel. If the comm ### Adding Comment or Reply Status * Select the Annotation Comments in the comment panel. -* Click the more options button showing in the Comments or reply container. +* Click the More options button shown in the Comments or reply container. * Select the Set Status option in the context menu that appears. * Select the status of the annotation comment in the context menu that appears. -![Comment Status](Annotation-images\comment-status.png) +![Comment Status](Annotation-images/comment-status.png) -## Editing the comments and comments replies of the annotations +## Editing the comments and comment replies of the annotations The comment, comment replies, and status of the annotation can be edited using the comment panel. ### Editing the Comment or Comment Replies * Select the Annotation Comments in the comment panel. -* Click the More options button showing in the Comments or reply container. +* Click the More options button shown in the Comments or reply container. * Select the Edit option in the context menu that appears. * Now, an editable text box appears. You can change the content of the annotation comment or comment reply. -![Editing the Comments](Annotation-images\edit-comment.png) +![Editing the Comments](Annotation-images/edit-comment.png) ### Editing Comment or Reply Status * Select the Annotation Comments in the comment panel. -* Click the more options button showing in the Comments or reply container. +* Click the More options button shown in the Comments or reply container. * Select the Set Status option in the context menu that appears. * Select the status of the annotation comment in the context menu that appears. -* Status ‘None’ is the default state. If the status is set to ‘None,’ the comments or reply does not appear. +* Status ‘None’ is the default state. If the status is set to ‘None,’ the comments or replies do not appear. ### Delete Comment or Comment Replies * Select the Annotation Comments in the comment panel. -* Click the more options button shown in the Comments or reply container. +* Click the More options button shown in the Comments or reply container. * Select the Delete option in the context menu that appears. -![Deleteing the Comments](Annotation-images\delete-comment.png) \ No newline at end of file +![Deleting the Comments](Annotation-images/delete-comment.png) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Working-with-Annotations-Programmatically.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Working-with-Annotations-Programmatically.md index d510df1dd3..5bca1add0b 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Working-with-Annotations-Programmatically.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Annotations/Working-with-Annotations-Programmatically.md @@ -10,7 +10,7 @@ documentation: ug # Working with annotations programmatically ## Add an annotation -The PDF Viewer allows users to add annotations programmatically without user interaction. Annotations can be added to the PDF document using the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property in the code behind. +The PDF Viewer allows users to add annotations programmatically without user interaction. Annotations can be added to the PDF document using the [PdfViewerControl's loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property in the code behind. The following code snippet explains how to add an ink annotation at runtime to the PDF document. @@ -38,8 +38,7 @@ private void AddAnnotation() {% highlight VB %} 'Adding ink annotation at runtime to the PDF document. -private void AddAnnotation() -{ +Private Sub AddAnnotation() 'Get the instance of the loadedDocument from the PdfViewerControl. Dim loadedDocument As PdfLoadedDocument = pdfViewer.LoadedDocument @@ -52,7 +51,7 @@ private void AddAnnotation() 'Add the ink annotation to the desired page of the PdfLoadedDocument property instance. loadedDocument.Pages(0).Annotations.Add(inkAnnotation) -} +End Sub {% endhighlight %} {% endtabs %} @@ -62,14 +61,14 @@ PDF Viewer allows the users to select the annotation programmatically without us ### Select an annotation in the PDF file -PDF Viewer allows the users to select the annotation programmatically using [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_) method. The annotation’s name should pass as a parameter that needs to be selected. +PDF Viewer allows the users to select the annotation programmatically using [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_) method. The annotation's name should be passed as a parameter that needs to be selected. The following code snippet explains how to select an ink annotation using the annotation name. {% tabs %} {% highlight C# %} -//Selecting ink annotation with annotation’s name +//Selecting ink annotation with annotation's name private void SelectAnnotation() { bool isSelected = pdfViewer.SelectAnnotation(inkAnnotationName); @@ -80,9 +79,9 @@ private void SelectAnnotation() N> Similarly, we can implement it for all other annotations. -### Select an annotations at specific page +### Select an annotation at a specific page -PDF Viewer also allows the users to select the annotation programmatically using overload [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_System_Int32_) method with specified the page number on which the annotation is located. The annotation’s name and its page number should pass as a parameter that needs to be selected. +PDF Viewer also allows the users to select the annotation programmatically using overload [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_System_Int32_) method with a specified page number on which the annotation is located. The annotation's name and its page number should be passed as a parameter that needs to be selected. N> For better performance, we can use the method [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_System_Int32_) with page number overload. @@ -91,7 +90,7 @@ The following code snippet explains how to select an ink annotation on the first {% tabs %} {% highlight C# %} -//Selecting ink annotation from page 1 with the annotation’s name +//Selecting ink annotation from page 1 with the annotation's name private void SelectAnnotation() { bool isSelected = pdfViewer.SelectAnnotation(inkAnnotationName, 1); @@ -104,14 +103,14 @@ N> Similarly, we can implement it for all other annotations. ### Select an annotation in the PDF file and bring it into view -PDF Viewer also allows the user to select and bring an annotation to view programmatically using overload [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_System_Boolean_) method with `BringIntoView` Parameter. The annotation’s name and true value for `BringIntoView` should be passed as a parameter to select and bring an annotation into view. +PDF Viewer also allows the user to select and bring an annotation to view programmatically using overload [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_System_Boolean_) method with `BringIntoView` Parameter. The annotation's name and true value for `BringIntoView` should be passed as a parameter to select and bring an annotation into view. The following code snippet explains how to select an ink annotation using the annotation name and bring them into view. {% tabs %} {% highlight C# %} -//Selecting ink annotation with the annotation’s name and bring them into view +//Selecting ink annotation with the annotation's name and bring them into view private void SelectAnnotation() { bool isSelected = pdfViewer.SelectAnnotation(inkAnnotationName, true); @@ -122,16 +121,16 @@ private void SelectAnnotation() N> Similarly, we can implement it for all other annotations. -### Select an annotation at specific page and bring it into view +### Select an annotation at a specific page and bring it into view -PDF Viewer also allows the user to select the annotation programmatically and bring it into view using overload [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_System_Int32_System_Boolean_) method, specifying the page number on which the annotation is located. The annotation’s name, its page number and its “true” value for `BringIntoView` should be passed as a parameter that needs to be selected. +PDF Viewer also allows the user to select the annotation programmatically and bring it into view using overload [SelectAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_SelectAnnotation_System_String_System_Int32_System_Boolean_) method, specifying the page number on which the annotation is located. The annotation's name, its page number and its "true" value for `BringIntoView` should be passed as a parameter that needs to be selected. The following code snippet explains how to select an ink annotation on the first page of the document using the annotation name and bring it into view. {% tabs %} {% highlight C# %} -//Selecting ink annotation from page 1 with the annotation’s name and bringing into view parameter +//Selecting ink annotation from page 1 with the annotation's name and bringing into view parameter private void SelectAnnotation() { bool isSelected = pdfViewer.SelectAnnotation(inkAnnotationName, 1, true); @@ -142,20 +141,20 @@ private void SelectAnnotation() N> Similarly, we can implement it for all other annotations. -N> To bring an annotation into view we need to pass a “true” value for the BringIntoView parameter, providing a “false” value will only select the annotation. +N> To bring an annotation into view we need to pass a "true" value for the BringIntoView parameter, providing a "false" value will only select the annotation. ### How to get and set name of an annotation -Annotation’s name can be obtained either for newly added annotation or the annotation that already exist. Also, you can modify the [Name](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationChangedEventArgs.html#Syncfusion_Windows_PdfViewer_AnnotationChangedEventArgs_Name) property to give annotations a unique name. In the following sections, the ink annotation was explained brevity and similarly, you can get and set names for all other annotations. +Annotation's name can be obtained either for newly added annotation or the annotation that already exist. Also, you can modify the [Name](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationChangedEventArgs.html#Syncfusion_Windows_PdfViewer_AnnotationChangedEventArgs_Name) property to give annotations a unique name. In the following sections, the ink annotation is explained briefly and similarly, you can get and set names for all other annotations. -#### Get and Set Annotations’ Name +#### Get and Set Annotations' Name -The annotations’ name can be obtained from the annotation changed event. The following code sample explains how to get the annotations’ name when adding it to the document. +The annotations' name can be obtained from the annotation changed event. The following code sample explains how to get the annotations' name when adding it to the document. {% tabs %} {% highlight C# %} -//Getting annotation’s name while adding the annotation +//Getting annotation's name while adding the annotation private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedEventArgs e) { if (e.Action == AnnotationChangedAction.Add) @@ -174,7 +173,7 @@ You can also change the name of an annotation. The following code sample demonst //Set the annotation name private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedEventArgs e) { - e.Name = ”YOUR OWN NAME”; + e.Name = "YOUR OWN NAME"; } {% endhighlight %} @@ -183,13 +182,13 @@ private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedE N> The annotation name must be unique. If there are multiple annotations with the same name in the document, any functions based on the name will only affect the first one identified. -#### Getting annotation’s name for existing annotation +#### Getting annotation's name for existing annotation -The existing annotation’s name can be obtained from [LoadedDocument]( https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument). The following code snippet explains how to get the existing annotation’s name. +The existing annotation's name can be obtained from [LoadedDocument]( https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument). The following code snippet explains how to get the existing annotation's name. {% tabs %} {% highlight C# %} -//Getting existing annotation’s name +//Getting existing annotation's name private void PdfViewer_DocumentLoaded(object sender, EventArgs args) { PdfLoadedDocument loadedDocument = pdfViewer.LoadedDocument; @@ -204,14 +203,14 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args) The PDF Viewer allows users to modify annotations programmatically without user interaction in the following ways. ### Modify an annotation using annotation changed event settings -Annotation’s properties can be modified programmatically through `Settings` in respective annotation changed event. +Annotation's properties can be modified programmatically through `Settings` in respective annotation changed event. -The following code snippet explains how to modify the selected ink annotation’s properties. Similarly, we can implement for all other annotations. +The following code snippet explains how to modify the selected ink annotation's properties. Similarly, we can implement for all other annotations. {% tabs %} {% highlight C# %} -//Modifying the selected annotation’s properties. +//Modifying the selected annotation's properties. private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedEventArgs e) { if (e.Action == AnnotationChangedAction.Select) @@ -228,7 +227,7 @@ private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedE ### Modify an annotation using loadedDocument -Annotations can be modified in the PDF document using the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property in the code behind. +Annotations can be modified in the PDF document using the [PdfViewerControl's loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property in the code behind. The following code snippet demonstrates how to modify an ink annotation at runtime. @@ -253,8 +252,7 @@ private void ModifyAnnotation() {% highlight VB %} 'Modify the ink annotation in the PDF Viewer runtime. -private void ModifyAnnotation() -{ +Private Sub ModifyAnnotation() 'Get the instance of the loadedDocument from the PdfViewerControl. Dim loadedDocument As PdfLoadedDocument = pdfViewer.LoadedDocument Dim inkAnnotation As PdfInkAnnotation = Nothing @@ -264,7 +262,7 @@ private void ModifyAnnotation() 'Modify the color of the ink annotation. inkAnnotation.Color = New PdfColor(System.Drawing.Color.Blue) End If -} +End Sub {% endhighlight %} {% endtabs %} @@ -283,7 +281,7 @@ The following code snippet explains how to hide an ink annotation using the anno {% tabs %} {% highlight C# %} -//Hide ink annotation using annotation’s name +//Hide ink annotation using annotation's name private void HideAnnotation() { bool isHidden = pdfViewer.HideAnnotation(inkAnnotationName); @@ -294,7 +292,7 @@ private void HideAnnotation() N> Similarly, we can implement it for all other annotations. -### Hide an annotation at specific page +### Hide an annotation at a specific page PDF Viewer also allows the user to hide the annotation from a specific page programmatically using the overload [HideAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_HideAnnotation_System_String_System_Int32_) method with a specified page number on which the annotation is located. The annotation name and its page number should be passed as a parameter that needs to be hidden. @@ -305,7 +303,7 @@ The following code snippet explains how to hide an ink annotation on the first p {% tabs %} {% highlight C# %} -//Hide ink annotation from page 1 with the annotation’s name +//Hide ink annotation from page 1 with the annotation's name private void HideAnnotation() { bool isHidden = pdfViewer.HideAnnotation(inkAnnotationName, 1); } {% endhighlight %} @@ -328,7 +326,7 @@ The following code snippet explains how to show a hidden ink annotation using th {% tabs %} {% highlight C# %} -//Show ink annotation using annotation’s name +//Show ink annotation using annotation's name private void ShowAnnotation() { bool isShown = pdfViewer.ShowAnnotation(inkAnnotationName); @@ -339,7 +337,7 @@ private void ShowAnnotation() N> Similarly, we can implement it for all other annotations. -### Show an annotation at specific page +### Show an annotation at a specific page PDF Viewer also allows the user to show the annotation from a specific page programmatically using the overload [ShowAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ShowAnnotation_System_String_System_Int32_) method with a specified page number on which the annotation is located. The annotation name and its page number should be passed as a parameter that needs to be shown. @@ -350,7 +348,7 @@ The following code snippet explains how to show an ink annotation on the first p {% tabs %} {% highlight C# %} -//Show ink annotation from page 1 with the annotation’s name +//Show ink annotation from page 1 with the annotation's name private void ShowAnnotation() { bool isShown = pdfViewer.ShowAnnotation(inkAnnotationName, 1); } {% endhighlight %} @@ -373,7 +371,7 @@ The following code snippet explains how to delete an ink annotation using the an {% tabs %} {% highlight C# %} -//delete ink annotation using annotation’s name +//delete ink annotation using annotation's name private void DeleteAnnotation() { bool isDeleted = pdfViewer.DeleteAnnotation(inkAnnotationName); @@ -384,7 +382,7 @@ private void DeleteAnnotation() N> Similarly, we can implement it for all other annotations. -### Delete an annotation at specific page +### Delete an annotation at a specific page PDF Viewer also allows the user to delete the annotation from a specific page programmatically using the overload [DeleteAnnotation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_DeleteAnnotation_System_String_System_Int32_) method with a specified page number on which the annotation is located. The annotation name and its page number should be passed as a parameter that needs to be deleted. @@ -395,7 +393,7 @@ The following code snippet explains how to delete an ink annotation on the first {% tabs %} {% highlight C# %} -//Delete ink annotation from page 1 with the annotation’s name +//Delete ink annotation from page 1 with the annotation's name private void DeleteAnnotation() { bool isDeleted = pdfViewer.DeleteAnnotation(inkAnnotationName, 1); } {% endhighlight %} @@ -426,17 +424,15 @@ private void DeleteAnnotations() {% highlight VB %} 'delete all annotations -private void DeleteAnnotations() -{ - pdfViewer.ClearAllAnnotations() -} - +Private Sub DeleteAnnotations() + pdfViewer.ClearAllAnnotations() +End Sub {% endhighlight %} {% endtabs %} -### Delete all annotations at specific page +### Delete all annotations at a specific page -PDF Viewer also allows the user to delete all annotations from a specific page programmatically using the overload [ClearAllAnnotations](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ClearAllAnnotations_System_Int32_) method with a specified page number on which the annotations are located. The page number which we pass as a parameter, its annotations get deleted. +PDF Viewer also allows the user to delete all annotations from a specific page programmatically using the overload [ClearAllAnnotations](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_ClearAllAnnotations_System_Int32_) method with a specified page number on which the annotations are located. Annotations on the page specified by the parameter will be deleted. The following code snippet explains how to delete all annotations on the first page of the PDF document. @@ -453,11 +449,9 @@ private void DeleteAnnotation() {% highlight VB %} 'delete all annotations from page 1 -private void DeleteAnnotations() -{ - pdfViewer.ClearAllAnnotations(1) -} - +Private Sub DeleteAnnotations() + pdfViewer.ClearAllAnnotations(1) +End Sub {% endhighlight %} {% endtabs %} @@ -467,7 +461,7 @@ PDF Viewer allows the user to update the [ModifiedDate](https://help.syncfusion. ### How to update the modified date of an annotation using default annotation settings? -User can include a [ModifiedDate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationSettings.html#Syncfusion_Windows_PdfViewer_AnnotationSettings_ModifiedDate) field when adding an annotation to a PDF document using default annotation settings. +You can include a [ModifiedDate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationSettings.html#Syncfusion_Windows_PdfViewer_AnnotationSettings_ModifiedDate) field when adding an annotation to a PDF document using default annotation settings. The following code snippet explains how to set the modified date field of an ink annotation to be included. Similarly, we can implement it for all other annotations. @@ -476,25 +470,24 @@ The following code snippet explains how to set the modified date field of an ink private void Window_Loaded(object sender, RoutedEventArgs e) { - pdfviewer.Load("Input.pdf"); - pdfviewer.InkAnnotationSettings.ModifiedDate = new DateTime(2020, 12, 1, 1, 1, 1); + pdfViewer.Load("Input.pdf"); + pdfViewer.InkAnnotationSettings.ModifiedDate = new DateTime(2020, 12, 1, 1, 1, 1); } {% endhighlight %} {% highlight VB %} -private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) -{ - pdfviewer.Load("Input.pdf") - pdfviewer.InkAnnotationSettings.ModifiedDate = new DateTime(2020, 12, 1, 1, 1, 1) -} +Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) + pdfViewer.Load("Input.pdf") + pdfViewer.InkAnnotationSettings.ModifiedDate = New DateTime(2020, 12, 1, 1, 1, 1) +End Sub {% endhighlight %} {% endtabs %} ### How to update the modified date of an annotation using annotation changed event settings? -User can include a [ModifiedDate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationSettings.html#Syncfusion_Windows_PdfViewer_AnnotationSettings_ModifiedDate) field of an annotation to a PDF document using annotation changed event settings. +You can include a [ModifiedDate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationSettings.html#Syncfusion_Windows_PdfViewer_AnnotationSettings_ModifiedDate) field of an annotation to a PDF document using annotation changed event settings. The following code snippet explains how to set the modified date field of an ink annotation using ink annotation changed event settings. Similarly, we can implement it for all other annotations. @@ -509,10 +502,9 @@ private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedE {% endhighlight %} {% highlight VB %} -private Sub PdfViewer_InkAnnotationChanged(sender As Object, e As InkAnnotationChangedEventArgs) -{ - e.Settings.ModifiedDate = new DateTime(2023, 12, 1, 1, 1, 1) -} +Private Sub PdfViewer_InkAnnotationChanged(sender As Object, e As InkAnnotationChangedEventArgs) + e.Settings.ModifiedDate = New DateTime(2023, 12, 1, 1, 1, 1) +End Sub {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Hyperlinks.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Hyperlinks.md index e9c6337cfe..3f106ec95b 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Hyperlinks.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Hyperlinks.md @@ -23,7 +23,7 @@ Arguments HyperlinkMouseOver This event is triggered when the mouse pointer is placed over the hyperlink. -N/A +HyperlinkMouseOverEventArgs HyperlinkClicked @@ -31,22 +31,29 @@ This event is triggered when the hyperlink in the PDF document is clicked.< HyperlinkClickedEventArgs -N> From the version 19.3, The `HyperLinkClickedEventArgs` is renamed to [HyperlinkClickedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs.html). Also, We recommend you to use [HyperlinkClicked](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_HyperlinkClicked) and [HyperlinkMouseOver](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.HyperLinkMouseOverEventHandler.html) events to notify when the hyperlink is clicked and when mouse is over the hyperlink respectively as shown in the above table. +N> From version 19.3, the `HyperlinkClickedEventArgs` is renamed to [HyperlinkClickedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs.html). Also, we recommend you to use [HyperlinkClicked](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_HyperlinkClicked) and [HyperlinkMouseOver](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.HyperLinkMouseOverEventHandler.html) events to notify when the hyperlink is clicked and when the mouse is over the hyperlink respectively as shown in the above table. ## How to disable hyperlink navigation in PDF viewer control You can disable the hyperlink navigation in PDF viewer control by setting the value of [Handled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs.html#Syncfusion_Windows_PdfViewer_HyperlinkClickedEventArgs_Handled) in the [HyperlinkClickedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs.html) parameter as true in the [HyperlinkClicked](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_HyperlinkClicked) event which is available in the PdfViewerControl and PdfDocumentView class. Please refer to the following example for more details. -N> From the version 19.3, we have introduced [Handled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs.html#Syncfusion_Windows_PdfViewer_HyperlinkClickedEventArgs_Handled) property in the event arguments to disable the hyperlink navigation based on the standards. You need to change its value to `true` to disable the navigation. +N> From version 19.3, we have introduced [Handled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs.html#Syncfusion_Windows_PdfViewer_HyperlinkClickedEventArgs_Handled) property in the event arguments to disable the hyperlink navigation based on the standards. You need to change its value to `true` to disable the navigation. {% tabs %} {% highlight c# %} +using Syncfusion.Windows.PdfViewer; + +// Initialize PDF Viewer. +PdfViewerControl pdfViewerControl = new PdfViewerControl(); +// Load the PDF. +pdfViewerControl.Load("Sample.pdf"); + // Wires the event handler for `HyperlinkClicked` event. pdfViewerControl.HyperlinkClicked += PdfViewerControl_HyperlinkClicked; -private void Pdfviewer_HyperlinkClicked(object sender, Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs args) +private void PdfViewerControl_HyperlinkClicked(object sender, Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs args) { // Gets or sets the value to handle the navigation of hyperlink. args.Handled = true; @@ -57,19 +64,21 @@ private void Pdfviewer_HyperlinkClicked(object sender, Syncfusion.Windows.PdfVie {% highlight vbnet %} -' Hooks the event handler for `HyperlinkClicked` event 'Initialize PDF Viewer. Private pdfViewerControl As New PdfViewerControl() 'Load the PDF. pdfViewerControl.Load("Sample.pdf") -AddHandler pdfviewer.HyperlinkClicked, AddressOf PdfViewerControl_HyperlinkClicked -Private Sub PdfViewerControl_HyperlinkClicked(obj As Object, args As Syncfusion.Windows.PdfViewer.AnnotEventArgs) -'Your code here... +' Hooks the event handler for `HyperlinkClicked` event. +AddHandler pdfViewerControl.HyperlinkClicked, AddressOf PdfViewerControl_HyperlinkClicked + +Private Sub PdfViewerControl_HyperlinkClicked(obj As Object, args As Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs) + ' Gets or sets the value to handle the navigation of hyperlink. + args.Handled = True End Sub ' Unhooks the event handler for `HyperlinkClicked` event. -RemoveHandler pdfviewer.HyperlinkClicked, AddressOf PdfViewerControl_HyperlinkClicked +RemoveHandler pdfViewerControl.HyperlinkClicked, AddressOf PdfViewerControl_HyperlinkClicked {% endhighlight %} {% endtabs %} @@ -83,25 +92,41 @@ Please refer to the following example for more details. {% tabs %} {% highlight c# %} +using Syncfusion.Windows.PdfViewer; + +// Initialize PDF Viewer. +PdfViewerControl pdfViewerControl = new PdfViewerControl(); +// Load the PDF. +pdfViewerControl.Load("Sample.pdf"); + // Wires the event handler for `HyperlinkClicked` event. pdfViewerControl.HyperlinkClicked += PdfViewerControl_HyperlinkClicked; -private void Pdfviewer_HyperlinkClicked(object sender, Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs args) +private void PdfViewerControl_HyperlinkClicked(object sender, Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs args) { - //Returns the URI clicked in the PDF viewer control. - string URI = args.Uri; + // Returns the URI clicked in the PDF viewer control. + string uri = args.Uri; + // Use the URI as needed; for example: + // System.Diagnostics.Debug.WriteLine(uri); } {% endhighlight %} {% highlight vbnet %} -' Hooks the event handler for `HyperlinkClicked` event -AddHandler pdfviewer.HyperlinkClicked, AddressOf PdfViewerControl_HyperlinkClicked +'Initialize PDF Viewer. +Private pdfViewerControl As New PdfViewerControl() +'Load the PDF. +pdfViewerControl.Load("Sample.pdf") -Private Sub PdfViewerControl_HyperlinkClicked(obj As Object, args As Syncfusion.Windows.PdfViewer.AnnotEventArgs) -' Returns the URI clicked in the PDF viewer control. -Dim uri As String = args.URI +' Hooks the event handler for `HyperlinkClicked` event. +AddHandler pdfViewerControl.HyperlinkClicked, AddressOf PdfViewerControl_HyperlinkClicked + +Private Sub PdfViewerControl_HyperlinkClicked(obj As Object, args As Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs) + ' Returns the URI clicked in the PDF viewer control. + Dim uri As String = args.URI + ' Use the URI as needed; for example: + ' Console.WriteLine(uri) End Sub @@ -111,16 +136,23 @@ End Sub ## Redirecting to a different Hyperlink -You can navigate to different hyperlink irrespective of the hyperlink clicked. To redirect a hyperlink, you need to set the value of [Handled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs.html#Syncfusion_Windows_PdfViewer_HyperlinkClickedEventArgs_Handled) parameter as true to stop the navigation of the hyperlink clicked. Then open the desired hyperlink that you want to navigate instead of the hyperlink clicked. +You can navigate to a different hyperlink irrespective of the hyperlink clicked. To redirect a hyperlink, you need to set the value of [Handled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs.html#Syncfusion_Windows_PdfViewer_HyperlinkClickedEventArgs_Handled) parameter as true to stop the navigation of the hyperlink clicked. Then open the desired hyperlink that you want to navigate instead of the hyperlink clicked. Please refer to the following example for more details. {% tabs %} {% highlight c# %} +using Syncfusion.Windows.PdfViewer; + +// Initialize PDF Viewer. +PdfViewerControl pdfViewerControl = new PdfViewerControl(); +// Load the PDF. +pdfViewerControl.Load("Sample.pdf"); + // Wires the event handler for `HyperlinkClicked` event. pdfViewerControl.HyperlinkClicked += PdfViewerControl_HyperlinkClicked; -private void Pdfviewer_HyperlinkClicked(object sender, Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs args) +private void PdfViewerControl_HyperlinkClicked(object sender, Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs args) { // Gets or sets the value to handle the navigation of hyperlink. args.Handled = true; @@ -133,12 +165,19 @@ private void Pdfviewer_HyperlinkClicked(object sender, Syncfusion.Windows.PdfVie {% highlight vbnet %} +'Initialize PDF Viewer. +Private pdfViewerControl As New PdfViewerControl() +'Load the PDF. +pdfViewerControl.Load("Sample.pdf") + ' Hooks the event handler for `HyperlinkClicked` event. -AddHandler pdfviewer.HyperlinkClicked, AddressOf PdfViewerControl_HyperlinkClicked +AddHandler pdfViewerControl.HyperlinkClicked, AddressOf PdfViewerControl_HyperlinkClicked -Private Sub PdfViewerControl_HyperlinkClicked(obj As Object, args As Syncfusion.Windows.PdfViewer.AnnotEventArgs) -' Opens the URI (www.google.com) in a default browser. -System.Diagnostics.Process.Start("www.google.com") +Private Sub PdfViewerControl_HyperlinkClicked(obj As Object, args As Syncfusion.Windows.PdfViewer.HyperlinkClickedEventArgs) + ' Gets or sets the value to handle the navigation of hyperlink. + args.Handled = True + ' Opens the URI (www.google.com) in a default browser. + System.Diagnostics.Process.Start("www.google.com") End Sub @@ -146,38 +185,50 @@ End Sub {% endtabs %} -## How to get notified when a mouse pointer moves over a hyperlink +## How to get notified when a mouse pointer moves over a hyperlink [HyperlinkMouseOver](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.HyperLinkMouseOverEventHandler.html) event is triggered when you place the mouse pointer over the URI in the PDF viewer control. - Please refer to the following example for more details. +Please refer to the following example for more details. {% tabs %} {% highlight c# %} -// Wire the event handler for `HyperlinkMouseOver` event. +using Syncfusion.Windows.PdfViewer; + +// Initialize PDF Viewer. +PdfViewerControl pdfViewerControl = new PdfViewerControl(); +// Load the PDF. +pdfViewerControl.Load("Sample.pdf"); + +// Wires the event handler for `HyperlinkMouseOver` event. pdfViewerControl.HyperlinkMouseOver += PdfViewerControl_HyperlinkMouseOver; -private void Pdfviewer_HyperlinkMouseOver(object sender, EventArgs args) +private void PdfViewerControl_HyperlinkMouseOver(object sender, Syncfusion.Windows.PdfViewer.HyperlinkMouseOverEventArgs args) { //Your code here } -// Unwire the event handler for `HyperlinkMouseOver` event. +// Unwires the event handler for `HyperlinkMouseOver` event. pdfViewerControl.HyperlinkMouseOver -= PdfViewerControl_HyperlinkMouseOver; {% endhighlight %} {% highlight vbnet %} -' Hooks the event handler for `HyperlinkMouseOver` event -AddHandler pdfviewer.HyperlinkMouseOver, AddressOf PdfViewerControl_HyperlinkMouseOver +'Initialize PDF Viewer. +Private pdfViewerControl As New PdfViewerControl() +'Load the PDF. +pdfViewerControl.Load("Sample.pdf") -Private Sub PdfViewerControl_HyperlinkMouseOver(obj As Object, args As Syncfusion.Windows.PdfViewer.AnnotEventArgs) +' Hooks the event handler for `HyperlinkMouseOver` event. +AddHandler pdfViewerControl.HyperlinkMouseOver, AddressOf PdfViewerControl_HyperlinkMouseOver +Private Sub PdfViewerControl_HyperlinkMouseOver(obj As Object, args As Syncfusion.Windows.PdfViewer.HyperlinkMouseOverEventArgs) + 'Your code here End Sub ' Unhooks the event handler for `HyperlinkMouseOver` event. -RemoveHandler pdfviewer.HyperlinkMouseOver, AddressOf PdfViewerControl_HyperlinkMouseOver +RemoveHandler pdfViewerControl.HyperlinkMouseOver, AddressOf PdfViewerControl_HyperlinkMouseOver {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-PDF-Layers.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-PDF-Layers.md index dc42ceaa13..736909dc05 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-PDF-Layers.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-PDF-Layers.md @@ -9,7 +9,7 @@ documentation: UG # Working with PDF Layers in WPF Pdf Viewer -The layer support in PDF viewer allows users to toggle the visibility of individual and group of layers in the PDF document to view, print, save, and export as image. +The layer support in the PDF Viewer allows users to toggle the visibility of individual layers and groups of layers in the PDF document to view, print, save, and export them as images. ## Toggling the visibility of a PDF layer @@ -25,7 +25,7 @@ To toggle the visibility of a group of PDF layers, click the eye icon associated ## Programmatically Toggle the Visibility of a PDF Layer -The WPF PDFViewer allows the user to toggle the visibility of a PDF [Layer](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.Layer.html) using its [IsVisible](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.Layer.html#Syncfusion_Windows_PdfViewer_Layer_IsVisible) property. When this property is set to false, the layer becomes invisible, and when this property is set to true, the layer becomes visible. The following code sample explains how to use the [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) to retrieve the [Layers](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html#Syncfusion_Windows_PdfViewer_PdfDocumentView_Layers) collection and use the [Name](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.Layer.html#Syncfusion_Windows_PdfViewer_Layer_Name) of a PDF layer to toggle its visibility. +The WPF PDF Viewer allows the user to toggle the visibility of a PDF [Layer](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.Layer.html) using its [IsVisible](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.Layer.html#Syncfusion_Windows_PdfViewer_Layer_IsVisible) property. When this property is set to false, the layer becomes invisible, and when this property is set to true, the layer becomes visible. The following code sample explains how to use the [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) to retrieve the [Layers](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html#Syncfusion_Windows_PdfViewer_PdfDocumentView_Layers) collection and use the [Name](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.Layer.html#Syncfusion_Windows_PdfViewer_Layer_Name) of a PDF layer to toggle its visibility. {% tabs %} {% highlight C# %} @@ -93,7 +93,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e) Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) Dim pdf As New PdfLoadedDocument("PdfLayers.pdf") pdfViewer.Load(pdf) - pdfViewer.EnableLayers = false; + pdfViewer.EnableLayers = False End Sub {% endhighlight %} @@ -109,7 +109,7 @@ You can also achieve the same in XAML using the DependencyProperty illustrated a {% endhighlight %} -N> By default, the layer feature is enabled in PDF viewer. +N> By default, the layer feature is enabled in the PDF Viewer. -N> You can refer to our [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the pdfviewer. \ No newline at end of file +N> You can refer to our [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the pdfviewer. diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Thumbnail-Navigation.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Thumbnail-Navigation.md index d14e329e37..1338242c06 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Thumbnail-Navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-Thumbnail-Navigation.md @@ -1,15 +1,15 @@ --- layout: post -title: Thumbnail Navigation in WPF Pdf Viewer control | Syncfusion®; -description: Learn about Thumbnail Navigation support in Syncfusion®; Essential Studio® WPF Pdf Viewer control, its elements and more. +title: Thumbnail Navigation in WPF Pdf Viewer control | Syncfusion® +description: Learn about Thumbnail Navigation support in Syncfusion®; Essential Studio® WPF Pdf Viewer control, its elements and more. platform: document-processing control: PDF Viewer documentation: ug --- -# Thumbnail Navigation in WPF Pdf Viewer +# Thumbnail Navigation in WPF PDF Viewer -The thumbnail navigation support in PDF viewer allows users to view a miniature preview of the PDF pages for fast scrolling and easy navigation purpose. +The thumbnail navigation support in PDF viewer allows users to view a miniature preview of the PDF pages for fast scrolling and easy navigation. ![WPF PDF Viewer Thumbnail Navigation](Thumbnail_images\wpf-pdf-viewer-thumbnail-navigation.png) @@ -33,7 +33,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e) {% highlight vbnet %} Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) - Dim pdf As New PdfLoadedDocument(“Input.pdf”) + Dim pdf As New PdfLoadedDocument("Input.pdf") pdfViewer.Load(pdf) pdfviewer.ThumbnailSettings.IsExpanded = true End Sub @@ -67,7 +67,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e) {% highlight vbnet %} Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) - Dim pdf As New PdfLoadedDocument(“Input.pdf”) + Dim pdf As New PdfLoadedDocument("Input.pdf") pdfViewer.Load(pdf) pdfviewer.ThumbnailSettings.IsVisible = false End Sub diff --git a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-command-binding/Binding-commands-to-a-button.md b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-command-binding/Binding-commands-to-a-button.md index 215e41c005..3f1ecaee1f 100644 --- a/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-command-binding/Binding-commands-to-a-button.md +++ b/Document-Processing/PDF/PDF-Viewer/wpf/Working-with-command-binding/Binding-commands-to-a-button.md @@ -100,14 +100,14 @@ GoToPageCommand allows you to navigate through the pages of the PDF document. Th {% highlight xaml %} - - - + {% endhighlight %} {% endtabs %} -* Include the following namespaces in `app.component.ts` file. +* Include the following namespaces in `app.component.ts`. {% tabs %} {% highlight ts tabtitle="~/app.component.ts" %} @@ -75,7 +122,7 @@ import { PdfDocument, PdfGraphics, PdfPage, PdfFontFamily, PdfFontStyle, PdfFont {% endhighlight %} {% endtabs %} -* Include the following code example in the click event of the button in `app.component.ts` to generate a PDF document. +* Include the following code in the click event of the button in `app.component.ts` to generate a PDF document. {% tabs %} {% highlight ts tabtitle="app.component.ts" %} @@ -100,14 +147,45 @@ document.getElementById('normalButton').onclick = (): void => { {% endhighlight %} {% endtabs %} -## Run the application +## Code Explanation + +- `PdfDocument` — creates a new PDF document instance. +- `addPage()` — appends a blank page to the document and returns the `PdfPage` object. +- `page.graphics` — returns the `PdfGraphics` drawing surface for the page. +- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfFont` object. +- `new PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black. +- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`. +- `save('Output.pdf')` — saves the PDF and triggers a browser download with the specified file name. The file is sent to the browser's default downloads folder. +- `destroy()` — releases native resources held by the document. -Use the following command to run the application in browser. +## Run the Application + +Use the following command to run the application in the browser: ```bash ng serve --open ``` -By executing the program, you will get the PDF document as follows. +When you click **Create PDF document**, the PDF file is generated in the browser and downloaded as `Output.pdf` to your default downloads folder. + +![Output PDF document](Getting_started_images/Output.png) + +## Troubleshooting + +| Problem | Cause | Resolution | +|---|---|---| +| `TS2304: Cannot find name 'PdfDocument'` (or similar) | The import line is missing or the package is not installed | Confirm `npm install @syncfusion/ej2-pdf` ran successfully and that the import is in `app.component.ts` | +| `Error: Cannot find module '@syncfusion/ej2-pdf'` | The package is not installed | Run `npm install @syncfusion/ej2-pdf --save` | +| `ReferenceError: document is not defined` during build | The PDF code ran during server-side rendering | Move the PDF generation into a click handler or another browser-only lifecycle hook | +| Button click does nothing | The button ID does not match the ID used in `getElementById` | Confirm the button's `id` is `normalButton` | +| PDF file does not download | The browser blocks the download | Check the browser's download settings and the downloads folder | +| Build fails with TypeScript errors | The Angular TypeScript version is incompatible with the PDF package | Update Angular to 20 or later and run `npm install` again | +| `registerLicense` warning at runtime | The license key is missing or invalid | Confirm the key is set in `main.ts` and is the correct key for your Syncfusion account | + +## Additional Resources -![Output PDF document](Getting_started_images/Output.png) \ No newline at end of file +- [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) +- [JavaScript PDF Library documentation](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/overview) +- [JavaScript PDF Library API reference](https://ej2.syncfusion.com/documentation/api/pdf) +- [JavaScript PDF Library examples](https://document.syncfusion.com/demos/pdf/angular/#/fluent2/pdf/default) +- [Syncfusion licensing documentation](https://help.syncfusion.com/document-processing/licensing/overview) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md index 211af02fc7..113bd3834d 100644 --- a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md +++ b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md @@ -1,30 +1,52 @@ --- layout: post -title: Create or Generate PDF in ASP.NET Core | Syncfusion -description: Learn how to create or generate a PDF file in ASP.NET Core applications with easy steps using JavaScript PDF Library without depending on Adobe. +title: Create or Generate a PDF in ASP.NET Core | Syncfusion +description: Learn how to create or generate a PDF file in an ASP.NET Core application with easy steps using the JavaScript PDF Library without depending on Adobe. platform: document-processing control: PDF documentation: ug keywords: .net core create pdf, edit pdf, merge, pdf form, fill form, digital sign, table, javascript, dotnet core pdf, asp generate pdf, aspx generate pdf +canonical_url: https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-asp-net-core --- -# Create or Generate PDF in ASP.NET Core +# Create or Generate a PDF in ASP.NET Core The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) is used to create, read, and edit PDF documents. The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) also offers functionality to merge, split, stamp, fill forms, and secure PDF files. -This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into an ASP.NET Core application. +This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into an ASP.NET Core application. The PDF is generated **client-side in the browser** using the Syncfusion JavaScript PDF Library loaded from a CDN; ASP.NET Core is used to host the page that triggers the download. + +## Prerequisites + +Before you begin, make sure you have the following installed: + +- Visual Studio 2022 (any edition) with the **ASP.NET and web development** workload. +- .NET SDK 8.0 (LTS) or 9.0. +- An active internet connection (the sample loads the JavaScript PDF Library from the Syncfusion CDN). +- A supported browser such as the latest versions of Microsoft Edge, Google Chrome, or Mozilla Firefox. + +To verify your .NET SDK version, run: + +```bash +dotnet --version +``` ## Integrate the PDF Library into an ASP.NET Core application Step 1: Start Visual Studio and select **Create a new project**. + Step 2: In the **Create a new project** dialog, select **ASP.NET Core Web App**. + ![ASP.NET Core PDF creation1](Getting_started_images/Asp-net-core-creation1.png) + Step 3: In the **Configure your new project** dialog, enter the project name and select **Next**. + ![ASP.NET Core PDF creation2](Getting_started_images/Asp-net-core-creation2.png) -Step 4: In the **Additional information** dialog, select a .NET LTS version (for example, **.NET 8.0 (Long-term Support)**) and then select **Create**. + +Step 4: In the **Additional information** dialog, select a .NET LTS version (for example, **.NET 8.0 (Long-term support)**) and then select **Create**. + ![ASP.NET Core PDF creation3](Getting_started_images/Asp-net-core-creation3.png) -Step 5: **Add script reference**: Add the required scripts using the CDN inside the `` of `~/Views/Shared/_Layout.cshtml` as follows: +Step 5: Add the script reference: open `~/Views/Shared/_Layout.cshtml` and add the Syncfusion CDN reference inside the `` element. Also confirm that the layout contains `@await RenderSectionAsync("Scripts", required: false)` so the `@section Scripts` block in Step 6 can render. {% tabs %} {% highlight cshtml tabtitle="~/_Layout.cshtml" %} @@ -32,17 +54,19 @@ Step 5: **Add script reference**: Add the required scripts using the CDN inside + + @RenderBody() + @await RenderSectionAsync("Scripts", required: false) + {% endhighlight %} {% endtabs %} N> Check out the following topics for including script references in an ASP.NET Core application to enable PDF creation using the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library): -* [CDN](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#cdn-reference) -* [NPM Package](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#node-package-manager-npm) -* [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator) -For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on. -Ensure that your application includes an `ej2-pdf-lib` folder within a publicly accessible static directory (such as wwwroot, public, or dist). This folder must contain the required `.js` and `.wasm` files needed for image and data extraction. +- [CDN](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#cdn-reference) +- [NPM Package](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#node-package-manager-npm) +- [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator) -Step 6: **Create a PDF document**: Add the script in `~/Views/Home/Index.cshtml` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document. +Step 6: Create a PDF document: open `~/Views/Home/Index.cshtml` and add a button plus a click handler that uses the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) to generate a PDF in the browser. {% tabs %} {% highlight cshtml tabtitle="~/Views/Home/Index.cshtml" %} @@ -54,32 +78,70 @@ Step 6: **Create a PDF document**: Add the script in `~/Views/Home/Index.cshtml` @section Scripts { } {% endhighlight %} {% endtabs %} -step 7: **Build the project**: Click on Build > Build Solution or press Ctrl + Shift + B to build the project. +## Code Explanation + +- `ej.pdf.PdfDocument` — creates a new PDF document instance. All PDF types are namespaced under `ej.pdf` when loaded from the Syncfusion CDN. +- `addPage()` — appends a blank page to the document and returns the `PdfPage` object. +- `page.graphics` — returns the `PdfGraphics` drawing surface for the page. +- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfStandardFont` object. +- `new ej.pdf.PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black. +- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`. +- `graphics.clientSize.width` — the writable width of the page in points. +- `save('output.pdf')` — saves the PDF and **triggers a client-side browser download** with the specified file name. The file is sent to the browser's default downloads folder; nothing is written to the server. +- `destroy()` — releases native resources held by the document. + +## Build and Run the Application + +Step 7: Build the project: click **Build** > **Build Solution** or press **Ctrl + Shift + B** to build the project. + +Step 8: Run the project: click the **Start** button (green arrow) or press **F5** to run the app. Visual Studio launches the app in your default browser. + +After running the application, click **Generate PDF document**. The browser downloads `output.pdf`, which contains a single page with the text "Hello World!!!" drawn at the top-left. + +![ASP.NET Core PDF output](Getting_started_images/Output.png) + +## Additional Configuration + +N> For image and data extraction features, install the `@syncfusion/ej2-pdf-data-extract` package as an add-on (NPM approach), then copy the `ej2-pdf-lib` folder from `node_modules/@syncfusion/ej2-pdf-data-extract/dist/ej2-pdf-lib` into a publicly accessible location under `wwwroot/` (for example, `wwwroot/lib/ej2-pdf-lib/`). The folder must contain the required `.js` and `.wasm` files. This setup is not required for **basic PDF creation** as shown in this guide. + +## Troubleshooting -Step 8: **Run the project**: Click the Start button (green arrow) or press F5 to run the app. +| Problem | Cause | Resolution | +|---|---|---| +| `ej is not defined` in the browser console | The CDN script tag is missing or blocked | Confirm the ` + + @RenderBody() + @await RenderSectionAsync("Scripts", required: false) + {% endhighlight %} {% endtabs %} -N> Check out the following topics for including script references in an ASP.NET MVC application to enable PDF creation using the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library): -* [CDN](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references) -* [NPM Package](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references#node-package-manager-npm) -* [CRG](https://ej2.syncfusion.com/aspnetmvc/documentation/common/custom-resource-generator) -For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on. -Ensure that your application includes an `ej2-pdf-lib` folder within a publicly accessible static directory (such as wwwroot, public, or dist). This folder must contain the required `.js` and `.wasm` files needed for image and data extraction. +N> Check out the following topics for including script references in an ASP.NET Core MVC application to enable PDF creation using the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library): +- [CDN](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references) +- [NPM Package](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references#node-package-manager-npm) +- [CRG](https://ej2.syncfusion.com/aspnetmvc/documentation/common/custom-resource-generator) + +N> The `31.2.15` CDN version is compatible with the .NET 8 and .NET 9 target frameworks. If you use a different Syncfusion version in your application, replace the CDN URL with the matching version. + +## Generate the PDF -Step 6: **Create a PDF document**: Add the script in `~/Views/Home/Index.cshtml` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document. +Step 6: Create a PDF document: open `~/Views/Home/Index.cshtml` and add a button plus a click handler that uses the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) to generate a PDF in the browser. {% tabs %} {% highlight cshtml tabtitle="~/Index.cshtml" %} @@ -55,32 +87,81 @@ Step 6: **Create a PDF document**: Add the script in `~/Views/Home/Index.cshtml` @section Scripts { } {% endhighlight %} {% endtabs %} -Step 7: **Build the project**: Click on Build > Build Solution or press Ctrl + Shift + B to build the project. +## Code Explanation -Step 8: **Run the project**: Click the Start button (green arrow) or press F5 to run the app. +- `ej.pdf.PdfDocument` — creates a new PDF document instance. All PDF types are namespaced under `ej.pdf` when loaded from the Syncfusion CDN. +- `addPage()` — appends a blank page to the document and returns the `PdfPage` object. +- `page.graphics` — returns the `PdfGraphics` drawing surface for the page. +- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfStandardFont` object. +- `new ej.pdf.PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black. +- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`. The rectangle object has the shape `{ x, y, width, height }`. +- `graphics.clientSize.width` — the writable width of the page in points. +- `save('output.pdf')` — saves the PDF and **triggers a client-side browser download** with the specified file name. The file is sent to the browser's default downloads folder; nothing is written to the server. The call is synchronous in the browser build. +- `destroy()` — releases native resources held by the document. It is safe to call immediately after `save()` because the download is initiated before the document is destroyed. -When you run the application and click the button, it generates the following PDF document. +## Build and Run the Application + +Step 7: Build the project: click **Build** > **Build Solution** or press **Ctrl + Shift + B** to build the project. + +Step 8: Run the project: click the **Start** button (green arrow) or press **F5** to run the app. Visual Studio launches the app in your default browser. + +After running the application, click **Generate PDF document**. The browser downloads `output.pdf`, which contains a single page with the text "Hello World!!!" drawn at the top-left. ![ASP.NET Core MVC PDF output](Getting_started_images/Output.png) + +## Additional Configuration (Optional) + +N> The following steps are required **only** if you need image or data extraction features. They are not required for the basic PDF creation shown in this guide. + +If you need image and data extraction, install the data-extraction add-on and copy the `ej2-pdf-lib` folder into your project. + +1. Install the add-on package: + + ```bash + npm install @syncfusion/ej2-pdf-data-extract --save + ``` + +2. Copy the `ej2-pdf-lib` folder from `node_modules/@syncfusion/ej2-pdf-data-extract/dist/ej2-pdf-lib` into `wwwroot/lib/ej2-pdf-lib/`. The folder must contain the required `.js` and `.wasm` files. + +3. Confirm that the `ej2-pdf-lib` folder is reachable at runtime (for example, at `https://localhost:xxxx/lib/ej2-pdf-lib/`). + +## Troubleshooting + +| Problem | Cause | Resolution | +|---|---|---| +| `ej is not defined` in the browser console | The CDN script tag is missing or blocked | Confirm the ` @@ -36,43 +56,131 @@ Step 3: Create a HTML page (index.html) in `my-app` location and add the CDN lin {% endhighlight %} {% endtabs %} -N> For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on. -Ensure that your application includes an `ej2-pdf-lib` folder within a publicly accessible static directory (such as wwwroot, public, or dist). This folder must contain the required `.js` and `.wasm` files needed for image and data extraction. - -Step 4: **Create a PDF document**: Add the script in `index.html` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document. +Step 3: Create a complete `index.html` inside `my-app` with the following content. The CDN reference is loaded in the `` and the PDF generation script is placed at the end of `` so the button exists before the click handler is attached. {% tabs %} -{% highlight javascript tabtitle="index.html" %} -
    -

    Create PDF document

    -

    Click the button to generate and download a PDF.

    - -
    -@section Scripts { +{% highlight html tabtitle="index.html" %} + + + + + Create PDF document + + + + +
    +

    Create PDF document

    +

    Click the button to generate and download a PDF.

    + +
    -} + + {% endhighlight %} {% endtabs %} -By executing the program, you will get the PDF document as follows. +N> The script tag is placed at the end of `` so that `document.getElementById('btnCreatePdf')` finds the button. If you prefer to put the script in ``, wrap the listener registration in a `DOMContentLoaded` event. + +## Code Explanation + +- `ej.pdf.PdfDocument` — creates a new PDF document instance. All PDF types are namespaced under `ej.pdf` when loaded from the Syncfusion CDN. +- `addPage()` — appends a blank page to the document and returns the `PdfPage` object. +- `page.graphics` — returns the `PdfGraphics` drawing surface for the page. +- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfStandardFont` object. +- `new ej.pdf.PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black. +- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`. The layout rect is `{ x, y, width, height }`. +- `graphics.clientSize.width` — the writable width of the page in points. +- `save('Output.pdf')` — saves the PDF and **triggers a client-side browser download** with the specified file name. The file is sent to the browser's default downloads folder; nothing is written to the server. +- `destroy()` — releases native resources held by the document. + +## Run the Sample + +Step 4: Open a terminal in the `my-app` folder and start a static file server. + +Using `npx serve` (no install required): + +```bash +npx serve +``` + +Or using Python 3: + +```bash +python -m http.server 8000 +``` + +Step 5: Open the served URL in your browser. For `npx serve`, the default URL is `http://localhost:3000`. For Python, the default URL is `http://localhost:8000`. + +Click **Generate PDF document**. The browser downloads `Output.pdf`, which contains a single page with the text "Hello World!!!" drawn at the top-left. + +![Output PDF document](Getting_started_images/JavaScript-Output.png) + +## Additional Configuration (Optional) + +N> The following steps are required **only** if you need image or data extraction features. They are not required for the basic PDF creation shown in this guide. + +If you need image and data extraction, install the data-extraction add-on and copy the `ej2-pdf-lib` folder into the served directory. + +1. Install the add-on package: + + ```bash + npm install @syncfusion/ej2-pdf-data-extract --save + ``` + +2. Copy the `ej2-pdf-lib` folder from `node_modules/@syncfusion/ej2-pdf-data-extract/dist/ej2-pdf-lib` into the same folder as `index.html`. The folder must contain the required `.js` and `.wasm` files. + +3. Confirm that the `ej2-pdf-lib` folder is reachable from the served page (for example, at `http://localhost:3000/ej2-pdf-lib/`). + +## License Registration + +N> This guide uses the CDN distribution of the JavaScript PDF Library. No client-side `registerLicense` call is required when loading the library from the Syncfusion CDN; licensing is handled at the account level. If you switch to the NPM-based packages, add a `registerLicense('YOUR_LICENSE_KEY')` call in your entry script. + +## Troubleshooting + +| Problem | Cause | Resolution | +|---|---|---| +| `ej is not defined` in the browser console | The CDN script tag is missing or blocked | Confirm the `` reference is reachable and not blocked by an ad blocker or network policy | +| `@section Scripts` appears as plain text on the page | The file is a static `.html`, not an ASP.NET view | Replace the Razor block with a plain ` {% endhighlight %} @@ -62,22 +148,22 @@ import { PdfDocument, PdfGraphics, PdfPage, PdfFont, PdfFontFamily, PdfFontStyle {% endhighlight %} {% endtabs %} -* Include the following code example in the click event of the button in `index.ts` to generate a PDF document +* Include the following code example in the click event of the button in `index.ts` to generate a PDF document {% tabs %} {% highlight typescript tabtitle="index.ts" %} document.getElementById('normalButton').onclick = (): void => { // Create a new PDF document - let pdf = new PdfDocument(); + const pdf = new PdfDocument(); // Add a new page - let page: PdfPage = pdf.addPage(); + const page: PdfPage = pdf.addPage(); // Get graphics from the page - let graphics: PdfGraphics = page.graphics; + const graphics: PdfGraphics = page.graphics; // Set font - let font: PdfFont = pdf.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular); + const font: PdfFont = pdf.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular); // Create a new black brush - let brush = new PdfBrush({r: 0, g: 0, b: 0}); + const brush = new PdfBrush({r: 0, g: 0, b: 0}); // Draw text graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush); // Save and download PDF @@ -89,14 +175,54 @@ document.getElementById('normalButton').onclick = (): void => { {% endhighlight %} {% endtabs %} -* **Run the application** +## Code Explanation + +- `registerLicense(key)` — registers the Syncfusion license key at application startup. Required for commercial usage. +- `PdfDocument` — creates a new PDF document instance. +- `addPage()` — appends a blank page to the document and returns the `PdfPage` object. +- `page.graphics` — returns the `PdfGraphics` drawing surface for the page. +- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfFont` object. +- `new PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black. +- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`. +- `graphics.clientSize.width` — the writable width of the page in points. +- `save('output.pdf')` — saves the PDF and triggers a browser download with the specified file name. The file is sent to the browser's default downloads folder. +- `destroy()` — releases native resources held by the document. -The quickstart project is configured to compile and run in the browser. Use the following command to start the application: +## Run the application + +The quickstart project is configured to compile and run in the browser. Use the following command from the project root to start the application: ```bash npm start ``` +Vite serves the application at `http://localhost:5173`. Open this URL in a browser and click **Create PDF document** to download the generated file as `output.pdf`. + +The generated PDF contains a single page with the text "Hello World!!!" drawn at the top-left. + By executing the program, you will get the PDF document as follows. -![Output PDF document](Getting_started_images/Output.png) \ No newline at end of file +![Output PDF document](Getting_started_images/TypeScript-Output.png) + +N> The first run may take a few seconds while Vite optimizes dependencies. Subsequent runs are faster. + +## Troubleshooting + +| Problem | Cause | Resolution | +|---|---|---| +| `Error: Cannot find module '@syncfusion/ej2-pdf'` | The package is not installed | Run `npm install @syncfusion/ej2-pdf --save` | +| `TS2304: Cannot find name 'PdfDocument'` (or similar) | The import line is missing | Confirm the `import` block at the top of `index.ts` is present | +| Button click does nothing | The button ID does not match | Confirm the button's `id` is `normalButton` | +| `Failed to resolve import "@syncfusion/ej2-pdf"` | The bundler cannot resolve the package | Confirm `node_modules/` exists and that you ran `npm install` | +| `ReferenceError: document is not defined` | The code ran in a Node-only context (e.g., SSR) | This sample is browser-only; run it in a browser via `npm start` | +| `Cannot GET /` | The dev server is not running | Run `npm start` and wait for "Local: http://localhost:5173/" | +| PDF does not download | The browser blocks the download | Check the browser's download settings and downloads folder | +| `registerLicense` warning at runtime | The license key is missing or invalid | Confirm the key is set in `index.ts` and is the correct key for your Syncfusion account | + +## See Also + +- [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) +- [JavaScript PDF Library documentation](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/overview) +- [JavaScript PDF Library API reference](https://ej2.syncfusion.com/documentation/api/pdf) +- [JavaScript PDF Library examples](https://document.syncfusion.com/demos/pdf/javascript/#/fluent2/pdf/default) +- [Syncfusion licensing documentation](https://help.syncfusion.com/document-processing/licensing/overview) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-vue.md b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-vue.md index a66fb8ec30..d3c72c7042 100644 --- a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-vue.md +++ b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-vue.md @@ -1,109 +1,248 @@ --- layout: post -title: Create or Generate PDF file in Vue | Syncfusion -description: Learn how to create a PDF file in Vue with easy steps using JavaScript PDF Library without depending on Adobe +title: Create or Generate a PDF File in a Vue Application | Syncfusion +description: Learn how to create a PDF file in a Vue application with easy steps using the JavaScript PDF Library without requiring Adobe Acrobat. control: PDF platform: document-processing documentation: ug -keywords: pdf, script, vue, javascript +keywords: pdf, vue, vue 3, vue 2, javascript +canonical_url: https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-vue --- -# Create or Generate PDF file in Vue application +# Create or Generate a PDF File in a Vue Application -The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) is used to create, read, and edit PDF documents. The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) also offers functionality to merge, split, stamp, fill forms, and secure PDF files. +The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) is used to create, read, and edit PDF documents. The [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) also offers functionality to merge, split, stamp, fill PDF forms, and secure PDF files. -This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into an Vue application. +This guide explains how to integrate the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library) into a Vue application that runs in the browser. The generated PDF is downloaded directly from the browser; no server-side PDF rendering is required. -## Setting up the Vue 2 project +> Vue 2 reached end-of-life on December 31, 2023. This guide leads with **Vue 3** (recommended) and provides a separate Vue 2 path for legacy projects. -To generate a Vue 2 project using Vue-CLI, use the [Vue create](https://cli.vuejs.org/#getting-started) command. Follow these steps to install Vue CLI and create a new project: +## Prerequisites + +Before you begin, make sure you have the following installed: + +- Node.js 18 or later. +- npm 9 or later, or Yarn 1.22 or later. +- Visual Studio Code, Code Studio, or another code editor. +- A supported browser such as the latest versions of Microsoft Edge, Google Chrome, or Mozilla Firefox. + +To verify your Node.js and npm versions, run: ```bash -npm install -g @vue/cli -vue create quickstart -cd quickstart +node --version +npm --version ``` -or +## Create a Vue 3 Project (Recommended) + +Create a new Vue 3 project using the official scaffolding tool. This guide uses [Vite](https://vitejs.dev/) as the bundler. ```bash -yarn global add @vue/cli +npm create vue@latest my-pdf-app +cd my-pdf-app +npm install +``` + +When prompted, choose the default options (TypeScript is optional; this guide uses plain JavaScript). + +The final project structure is: + +```text +my-pdf-app/ +├── public/ +├── src/ +│ ├── App.vue +│ ├── main.js +│ └── components/ +├── index.html +└── package.json +``` + +## Create a Vue 2 Project (Legacy) + +N> Vue 2 reached end-of-life on December 31, 2023. Use Vue 2 only for legacy projects. `@vue/cli` is in maintenance mode. + +To create a Vue 2 project using the legacy Vue CLI: + +```bash +npm install -g @vue/cli vue create quickstart cd quickstart ``` -When creating a new project, choose the option `Default ([Vue 2] babel, es-lint)` from the menu. +When prompted, choose `Default ([Vue 2] babel, es-lint)`. ![Vue 2 project](Getting_started_images/vue2-terminal.png) -Once the `quick start` project is set up with default settings, proceed to add Syncfusion® components to the project. - -* **Installing JavaScript PDF package** +## Install the JavaScript PDF Library -All Syncfusion JS 2 packages are published in `npmjs.com` registry. +All Syncfusion® JS 2 packages are published in the `npmjs.com` registry. The `npm install` command below resolves `@syncfusion/ej2-pdf` to the latest stable version compatible with Vue 2.7+ or Vue 3.4+. * To install the [JavaScript PDF Library](https://www.syncfusion.com/document-sdk/javascript-pdf-library), use the following command. ```bash npm install @syncfusion/ej2-pdf --save ``` -or + +* If you prefer Yarn, use the following command. + ```bash yarn add @syncfusion/ej2-pdf ``` -N> For image and data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on. -* Copy the `ej2-pdf-lib` folder from the @syncfusion/ej2-pdf-data-extract package into your project's **public, dist, or assets** directory (where your static files are served). -* Make sure the `ej2-pdf-lib` folder exists in your final build output if you need to extract images or data from PDF files. -* Ensure your server serves .wasm files with the **Content-Type: application/wasm** MIME type. -* This setup is not required for **basic PDF creation**. +N> For image and data extraction features, install the `@syncfusion/ej2-pdf-data-extract` package as an add-on. Note the following: +- Copy the `ej2-pdf-lib` folder from the `@syncfusion/ej2-pdf-data-extract` package into your project's `public/`, `dist/`, or `assets/` directory (wherever your static files are served). +- Make sure the `ej2-pdf-lib` folder exists in your final build output if you need to extract images or data from PDF files. +- Ensure your server serves `.wasm` files with the **Content-Type: application/wasm** MIME type. Vite and Vue CLI dev servers already handle this; configure production servers manually. +- This setup is not required for **basic PDF creation**. + +### Transitive Dependencies + +The following packages are included automatically by `@syncfusion/ej2-pdf` and do not need to be installed separately: + +- `@syncfusion/ej2-base` — common utilities used by the library. +- `@syncfusion/ej2-compression` — compression support used by PDF features. + +## License Registration + +If your project requires a Syncfusion license, register the license key before using the PDF API. Add the following code at the top of `src/App.vue`'s ` + + {% endhighlight %} {% endtabs %} -## Run the project +N> This sample uses **named imports** from the npm package (`import { PdfDocument, ... } from '@syncfusion/ej2-pdf'`). The npm package does not expose a global `ej` namespace; using `ej.pdf.PdfDocument` without an import will throw `ReferenceError: ej is not defined` in a Vite or Vue CLI build. If you prefer the UMD-style global, load `ej2.min.js` from the Syncfusion CDN in `index.html` (or `public/index.html`) instead of importing the npm package. + +N> A click handler is used in this example, so no lifecycle hooks (`mounted`, `onMounted`) are required. The PDF classes load when the import runs at module evaluation time, which happens before any user interaction. + +## Code Explanation + +- `registerLicense(key)` — registers the Syncfusion license key at application startup. Required for commercial usage. +- `PdfDocument` — creates a new PDF document instance. +- `addPage()` — appends a blank page to the document and returns the `PdfPage` object. +- `page.graphics` — returns the `PdfGraphics` drawing surface for the page. +- `embedFont(family, size, style)` — embeds one of the standard PDF font families (here, Helvetica 36pt regular) and returns a `PdfFont` object. +- `new PdfBrush({ r, g, b })` — creates a solid color brush from an RGB object (each channel `0`-`255`); here, black. +- `drawString(text, font, layoutRect, brush)` — draws the text inside the rectangle defined by `x`, `y`, `width`, and `height`. +- `graphics.clientSize.width` — the writable width of the page in points. +- `save('Output.pdf')` — saves the PDF and triggers a browser download with the specified file name. The file is sent to the browser's default downloads folder. +- `destroy()` — releases native resources held by the document. -To run the project, use the following command: +## Run the Application + +### Vue 3 (Vite) + +Open a terminal in the project root and start the Vite development server: ```bash -npm run serve +npm run dev ``` -or + +Vite serves the application at `http://localhost:5173`. Open this URL in a browser and click **Create PDF document** to download the generated file as `Output.pdf`. + +### Vue 2 (Vue CLI) + +Open a terminal in the project root and start the Vue CLI development server: ```bash -yarn run serve +npm run serve ``` -By executing the program, you will generate the following PDF document. +Vue CLI serves the application at `http://localhost:8080`. Open this URL in a browser and click **Create PDF document** to download the generated file as `Output.pdf`. + +The generated PDF contains a single page with the text "Hello World!!!" drawn at the top-left. + +![Vue PDF output](Getting_started_images/Vue-Output.png) + +## Troubleshooting + +| Problem | Cause | Resolution | +|---|---|---| +| `ReferenceError: ej is not defined` | The code uses the global `ej.pdf` namespace but the npm package does not expose it | Switch to named imports: `import { PdfDocument, ... } from '@syncfusion/ej2-pdf'` | +| `SyntaxError: Unexpected token ':'` in `App.vue` | TypeScript type annotations were left in a plain ` + + {% endhighlight %} {% endtabs %} N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to explore supported ways (such as static assets, CDN, and CRG) to apply themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application. -## Add Syncfusion® Blazor Spreadsheet component +## Add Blazor Spreadsheet component -Add the Syncfusion® Blazor Spreadsheet component in any Razor file. In this example, the Spreadsheet component is added to the **~/Home.razor** page under the **~/Components/Pages** folder. +Add the Blazor Spreadsheet component in any Razor file. In this example, the Spreadsheet component is added to the **Components/Pages/Home.razor** page. {% tabs %} {% highlight razor tabtitle="Home.razor" %} @@ -113,6 +141,10 @@ Add the Syncfusion® Blazor Spreadsheet comp {% endhighlight %} {% endtabs %} +N> `SpreadsheetRibbon` is the optional ribbon toolbar child component of `SfSpreadsheet`. Omit it if you want to render the spreadsheet without the ribbon UI. + +N> .NET MAUI Blazor Hybrid apps run components natively on the device; no interactive render mode (such as `InteractiveServer` or `InteractiveWebAssembly`) is required. + ## Run on Windows In the Visual Studio toolbar, click the **Windows Machine** to build and run the app. Ensure the run profile is set to `Windows Machine` before starting the app. @@ -127,17 +159,22 @@ After the application launches, the output will appear as shown below: To run the Spreadsheet on Android using the Android emulator, follow these steps: -Refer [here](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/device-manager#android-device-manager-on-windows) to install and launch Android emulator. +1. Refer to [Android Device Manager on Windows](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/device-manager#android-device-manager-on-windows) to install and launch the Android emulator. +2. In the Visual Studio toolbar, select the **Android Emulators** run profile. +3. Click the **Android Emulators** button (or press F5) to build and deploy the app to the emulator. N> If any errors occur while using the Android Emulator, see [Troubleshooting Android Emulator](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/troubleshooting). +N> To run the app on iOS or Mac Catalyst, see [Publish a .NET MAUI app for iOS](https://learn.microsoft.com/en-us/dotnet/maui/ios/deployment/overview) and [Publish a .NET MAUI app for Mac Catalyst](https://learn.microsoft.com/en-us/dotnet/maui/mac-catalyst/deployment/?view=net-maui-10.0). + ![Blazor Spreadsheet running in the Android emulator](images/android-emulator.png) To learn how to open workbooks, bind data, or save files in the Spreadsheet component, see [Open and Save](open-and-save). -N> [View Sample In GitHub.](https://github.com/SyncfusionExamples/syncfusion-maui-blazor-spreadsheet-integration). +N> [View sample in GitHub](https://github.com/SyncfusionExamples/syncfusion-maui-blazor-spreadsheet-integration). Looking for the full Blazor Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [Blazor Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/blazor-spreadsheet-editor) page + ## See Also - [Getting started with the Blazor Spreadsheet in a Blazor WebAssembly App](./getting-started) -- [Getting started with the Blazor Spreadsheet in a Blazor Web app Server app](./getting-started-webapp) \ No newline at end of file +- [Getting started with the Blazor Spreadsheet in a Blazor Web App](./getting-started-webapp) \ No newline at end of file diff --git a/Document-Processing/Excel/Spreadsheet/Blazor/getting-started-webapp.md b/Document-Processing/Excel/Spreadsheet/Blazor/getting-started-webapp.md index 0b034eeb9c..f96575242f 100644 --- a/Document-Processing/Excel/Spreadsheet/Blazor/getting-started-webapp.md +++ b/Document-Processing/Excel/Spreadsheet/Blazor/getting-started-webapp.md @@ -7,9 +7,9 @@ control: Spreadsheet documentation: ug --- -# Getting Started with the Blazor Spreadsheet in Web App +# Getting Started with the Blazor Spreadsheet in Blazor Web App -This section briefly explains how to include the [Syncfusion® Blazor Spreadsheet](https://www.syncfusion.com/blazor-components/blazor-spreadsheet) component in a Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/). +This section briefly explains how to include the [Blazor Spreadsheet Editor](https://www.syncfusion.com/blazor-components/blazor-spreadsheet) component in a Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/). {% tabcontents %} @@ -25,9 +25,9 @@ Create a **Blazor Web App** using Visual Studio 2022 via [Microsoft Templates](h N> Configure the appropriate [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-10.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-10.0&pivots=vs) while creating a Blazor Web App. For detailed information, refer to the [interactive render mode documentation](https://blazor.syncfusion.com/documentation/common/interactive-render-mode). -## Install Syncfusion® Blazor Spreadsheet NuGet Packages +## Install Blazor Spreadsheet NuGet Packages -If you utilize `WebAssembly or Auto` render modes in the Blazor Web App need to be install Syncfusion® Blazor components NuGet packages within the client project. +If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install the Blazor components NuGet packages within the client project. To add **Syncfusion Blazor Spreadsheet** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: @@ -55,7 +55,7 @@ Install-Package Syncfusion.Blazor.Themes -Version {{ site.releaseversion }} ## Create a New Blazor Web App in Visual Studio Code -Create a **Blazor Web App** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vsc) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project). +Create a **Blazor Web App** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vsc) or the [Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project). N> Configure the appropriate [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-10.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-10.0&pivots=vs) while creating a Blazor Web App. For detailed information, refer to the [interactive render mode documentation](https://blazor.syncfusion.com/documentation/common/interactive-render-mode). @@ -73,9 +73,11 @@ cd BlazorWebApp.Client N> For more information on creating a Blazor Web App with various interactive modes and locations, see [Render interactive modes](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app?tabcontent=visual-studio-code#render-interactive-modes). -## Install Syncfusion® Blazor Spreadsheet NuGet Packages +N> If you selected the `Server` interactive render mode (no client project is created), skip the `cdn BlazorWebApp.Client` command and run package commands from the server project directory. -If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App need to be install Syncfusion® Blazor components NuGet packages within the client project. +## Install Blazor Spreadsheet NuGet Packages + +If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install the Blazor components NuGet packages within the client project. * Press Ctrl+` to open the integrated terminal in Visual Studio Code. * Ensure you’re in the project root directory where your `.csproj` file is located. @@ -93,13 +95,16 @@ dotnet restore {% endtabs %} +N> After running `dotnet restore`, ensure there are no error messages in the terminal. If restore fails, verify your NuGet source (`https://api.nuget.org/v3/index.json`) is configured, clear the local cache with `dotnet nuget locals all --clear`, and retry. + + {% endtabcontent %} {% tabcontent .NET CLI %} ## Prerequisites -Install the latest version of [.NET SDK](https://dotnet.microsoft.com/en-us/download). If you previously installed the SDK, you can determine the installed version by executing the following command in a command prompt (Windows) or terminal (macOS) or command shell (Linux). +Install the latest version of [.NET SDK](https://dotnet.microsoft.com/en-us/download). If you previously installed the SDK, you can determine the installed version by executing the following command in a command prompt (Windows) or terminal (macOS) or command shell (Linux). Also, review the [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements). {% tabs %} {% highlight c# tabtitle=".NET CLI" %} @@ -125,9 +130,11 @@ cd BlazorWebApp.Client {% endhighlight %} {% endtabs %} +N> If you selected the `Server` interactive render mode (no client project is created), skip the `cdn BlazorWebApp.Client` command and run package commands from the server project directory. + ## Install Syncfusion® Blazor Spreadsheet and Themes NuGet in the App -If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App need to be install Syncfusion® Blazor components NuGet packages within the client project. +If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install the Blazor components NuGet packages within the client project. * Open a command prompt, terminal, or shell. * Ensure you’re in the project root directory where your `.csproj` file is located (or the Client project if applicable). @@ -145,13 +152,15 @@ dotnet restore {% endtabs %} +N> After running `dotnet restore`, ensure there are no error messages in the terminal. If restore fails, verify your NuGet source (`https://api.nuget.org/v3/index.json`) is configured, clear the local cache with `dotnet nuget locals all --clear`, and retry. + {% endtabcontent %} {% endtabcontents %} ## Add import namespaces -After the packages are installed, open the **~/_Imports.razor** file in the client project and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Spreadsheet` namespaces. +After the packages are installed, open the **_Imports.razor** file (typically located at `Components/_Imports.razor` in Blazor Web App templates; in older templates or WebAssembly apps it may be at the project root) and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Spreadsheet` namespaces. {% tabs %} {% highlight C# tabtitle="_Imports.razor" %} @@ -162,6 +171,7 @@ After the packages are installed, open the **~/_Imports.razor** file in the clie {% endhighlight %} {% endtabs %} + ## Register Syncfusion® Blazor Service Register the Syncfusion Blazor service in the **Program.cs** file of your Blazor Web App. @@ -169,55 +179,68 @@ Register the Syncfusion Blazor service in the **Program.cs** file of your Blazor {% tabs %} {% highlight c# tabtitle="Program.cs" %} -.... using Syncfusion.Blazor; -.... +// Register Syncfusion Blazor service builder.Services.AddSyncfusionBlazor(); -.... {% endhighlight %} {% endtabs %} -N> If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, register the Syncfusion® Blazor service in **Program.cs** files of both the server and client projects in your Blazor Web App. +N> If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, register the Blazor service in **Program.cs** files of both the server and client projects in your Blazor Web App. For `Server` render mode, register it in the server project's **Program.cs** only. + +N> `AddSyncfusionBlazor()` accepts optional configuration options such as enabling script isolation. See the [Blazor service registration](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.GlobalOptions.html) topic for available configuration options. -## Add stylesheet and script resources +## Register Syncfusion License Key -The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet reference in the section and the script reference at the end of the in the **~/Components/App.razor** file as shown below. +Register the Syncfusion license key in your application startup to avoid a license warning at runtime. Add the following line in the **Program.cs** file of your Blazor Web App (and in the client project's **Program.cs** for `WebAssembly`/`Auto` render modes), after the `AddSyncfusionBlazor()` call: {% tabs %} -{% highlight razor tabtitle="App.razor" %} +{% highlight c# tabtitle="Program.cs" %} - - .... - - - - .... - - +// Register Syncfusion license key +Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY"); {% endhighlight %} {% endtabs %} -N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to explore supported ways (such as static assets, CDN, and CRG) to apply themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application. +N> Replace `YOUR_LICENSE_KEY` with your actual Syncfusion license key. For details on generating and registering a license key, see [Licensing](https://blazor.syncfusion.com/documentation/licensing). + +## Add stylesheet resource + +The theme stylesheet can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet at the end of the `` section in the **Components/App.razor** file to apply proper layout and theme styling. + +{% tabs %} +{% highlight razor tabtitle="App.razor" %} -## Add Syncfusion® Blazor Spreadsheet component + + -Add the Syncfusion Blazor Spreadsheet component in the **~/Components/Pages/*.razor** file. If the interactivity location is set to `Per page/component` in the Web App, define a render mode at the top of the `~/Pages/*.razor` file. (For example, `InteractiveServer`, `InteractiveWebAssembly` or `InteractiveAuto`). +{% endhighlight %} +{% endtabs %} -N> If the **Interactivity Location** is set to `Global` with `Auto` or `WebAssembly`, the render mode is automatically configured in the `App.razor` file by default. +## Add script resource + +The Spreadsheet Editor script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the required script at the end of the `` section in the **Components/App.razor** file to enable component functionality. {% tabs %} -{% highlight razor %} +{% highlight razor tabtitle="App.razor" %} -@* desired render mode define here *@ -@rendermode InteractiveServer + + {% endhighlight %} {% endtabs %} +N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to explore supported ways (such as static assets, CDN, and CRG) to apply themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application. + +## Add Blazor Spreadsheet component + +Add the Syncfusion Blazor Spreadsheet component in the **Components/Pages/Home.razor** file (the default page template). If the interactivity location is set to `Per page/component` in the Web App, define a render mode at the top of the `Components/Pages/Home.razor` file. (For example, `InteractiveServer`, `InteractiveWebAssembly` or `InteractiveAuto`). + +N> If the **Interactivity Location** is set to `Global` with `Auto` or `WebAssembly`, the render mode is automatically configured in the `App.razor` file by default and does not need to be specified on the page. + {% tabs %} {% highlight razor tabtitle="Home.razor" %} @@ -231,6 +254,8 @@ N> If the **Interactivity Location** is set to `Global` with `Auto` or `WebAssem {% endhighlight %} {% endtabs %} +N> `SpreadsheetRibbon` is the optional ribbon toolbar child component of `SfSpreadsheet`. Omit it if you want to render the spreadsheet without the ribbon UI. + Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion Blazor Spreadsheet in your default web browser. The output will appear as follows: ![Blazor Spreadsheet](images/getting-started.png) @@ -243,6 +268,8 @@ To learn how to open workbooks, bind data, or save files in the Spreadsheet comp N> [View Sample In GitHub.](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/Spreadsheet). +N> Looking for the full Blazor Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [Blazor Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/blazor-spreadsheet-editor) page + ## Video tutorial To get started quickly with Blazor Spreadsheet, you can watch this video: @@ -252,4 +279,4 @@ To get started quickly with Blazor Spreadsheet, you can watch this video: ## See Also - [Getting started with the Blazor Spreadsheet in a Blazor WebAssembly App](./getting-started) -- [Getting Started with .NET MAUI Blazor Hybrid App](./blazor-hybrid-maui-app) +- [Getting Started with .NET MAUI Blazor Hybrid App](./blazor-hybrid-maui-app) \ No newline at end of file diff --git a/Document-Processing/Excel/Spreadsheet/Blazor/getting-started.md b/Document-Processing/Excel/Spreadsheet/Blazor/getting-started.md index 4f4ea5c3cd..c6cf40d28b 100644 --- a/Document-Processing/Excel/Spreadsheet/Blazor/getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/Blazor/getting-started.md @@ -1,7 +1,7 @@ --- layout: post -title: Getting Started with Blazor Spreadsheet Component in WASM| Syncfusion -description: Checkout and learn about getting started with Blazor Spreadsheet component in Blazor WebAssembly Application. +title: Getting Started with Blazor Spreadsheet Component in WASM | Syncfusion +description: Check out and learn about getting started with Blazor Spreadsheet component in Blazor WebAssembly Application. platform: document-processing control: Spreadsheet documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Getting Started with Blazor Spreadsheet Component -This section briefly explains how to include [Syncfusion® Blazor Spreadsheet](https://www.syncfusion.com/blazor-components/blazor-spreadsheet) component in your Blazor WebAssembly App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/). +This section briefly explains how to include [Blazor Spreadsheet Editor](https://www.syncfusion.com/blazor-components/blazor-spreadsheet) component in your Blazor WebAssembly App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/). {% tabcontents %} @@ -21,9 +21,9 @@ This section briefly explains how to include [Syncfusion® Blazor Spreadsheet](h ## Create a new Blazor App in Visual Studio -You can create a **Blazor WebAssembly App (Standalone)** using Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0&pivots=vs) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). +You can create a **Blazor WebAssembly App (Standalone)** using Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0&pivots=vs) or the [Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). -## Install Syncfusion® Blazor Spreadsheet NuGet Packages +## Install Blazor Spreadsheet NuGet Packages To add **Syncfusion Blazor Spreadsheet** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install: @@ -51,7 +51,7 @@ Install-Package Syncfusion.Blazor.Themes -Version {{ site.releaseversion }} ## Create a new Blazor App in Visual Studio Code -You can create a **Blazor WebAssembly App (Standalone)** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0&pivots=vsc) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project). +You can create a **Blazor WebAssembly App (Standalone)** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0&pivots=vsc) or the [Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project). Alternatively, you can create a WebAssembly application using the following command in the terminal(Ctrl+`). @@ -66,11 +66,11 @@ cd BlazorApp {% endtabs %} -## Install Syncfusion® Blazor Spreadsheet NuGet Packages +## Install Blazor Spreadsheet NuGet Packages * Press Ctrl+` to open the integrated terminal in Visual Studio Code. * Ensure you’re in the project root directory where your `.csproj` file is located. -* Run the following command to install a [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed. +* Run the following command to install the [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet packages and ensure all dependencies are installed. {% tabs %} @@ -84,13 +84,15 @@ dotnet restore {% endtabs %} +N> After running `dotnet restore`, ensure there are no error messages in the terminal. If restore fails, verify your NuGet source (`https://api.nuget.org/v3/index.json`) is configured, clear the local cache with `dotnet nuget locals all --clear`, and retry. + {% endtabcontent %} {% tabcontent .NET CLI %} ## Prerequisites -Install the latest version of [.NET SDK](https://dotnet.microsoft.com/en-us/download). If the .NET SDK is already installed, determine the installed version by running the following command in a command prompt (Windows), terminal (macOS), or command shell (Linux). +Install the latest version of [.NET SDK](https://dotnet.microsoft.com/en-us/download). If the .NET SDK is already installed, determine the installed version by running the following command in a command prompt (Windows), terminal (macOS), or command shell (Linux). Also, review the [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements). {% tabs %} {% highlight c# tabtitle=".NET CLI" %} @@ -113,13 +115,13 @@ cd BlazorApp {% endhighlight %} {% endtabs %} -## Install Syncfusion® Blazor Spreadsheet and Themes NuGet in the App +## Install Blazor Spreadsheet and Themes NuGet in the App After creating the Blazor WebAssembly App, install the required Syncfusion NuGet packages using the .NET CLI. * Open a command prompt, terminal, or shell. * Ensure you’re in the project root directory where your `.csproj` file is located. -* Run the following command to install a [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed. +* Run the following command to install the [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet packages and ensure all dependencies are installed. {% tabs %} @@ -133,13 +135,15 @@ dotnet restore {% endtabs %} +N> After running `dotnet restore`, ensure there are no error messages in the terminal. If restore fails, verify your NuGet source (`https://api.nuget.org/v3/index.json`) is configured, clear the local cache with `dotnet nuget locals all --clear`, and retry. + {% endtabcontent %} {% endtabcontents %} ## Add import namespaces -After the packages are installed, open the **~/_Imports.razor** file and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Spreadsheet` namespaces. +After the packages are installed, open the **_Imports.razor** file (typically located at the project root in a Blazor WebAssembly App) and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Spreadsheet` namespaces. {% tabs %} {% highlight razor tabtitle="_Imports.razor" %} @@ -150,34 +154,66 @@ After the packages are installed, open the **~/_Imports.razor** file and import {% endhighlight %} {% endtabs %} -## Register Syncfusion® Blazor Service +## Register Blazor Service -Register the Syncfusion Blazor service in the **~/Program.cs** file of your Blazor WebAssembly App. +Register the Syncfusion Blazor service in the **Program.cs** file of your Blazor WebAssembly App. Place the registration after the host builder is created and before `await builder.Build().RunAsync();`. {% tabs %} {% highlight C# tabtitle="Program.cs" %} -.... using Syncfusion.Blazor; -.... +var builder = WebAssemblyHostBuilder.CreateDefault(args); + +// Register Syncfusion Blazor service builder.Services.AddSyncfusionBlazor(); -.... +await builder.Build().RunAsync(); + +{% endhighlight %} +{% endtabs %} + +N> `AddSyncfusionBlazor()` accepts optional configuration options such as enabling script isolation. See the [Blazor service registration](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.GlobalOptions.html) topic for available configuration options. + +## Register Syncfusion License Key + +Register the Syncfusion license key in your application startup to avoid a license warning at runtime. Add the following line in the **Program.cs** file of your Blazor WebAssembly App, after the `AddSyncfusionBlazor()` call: + +{% tabs %} +{% highlight c# tabtitle="Program.cs" %} + +// Register Syncfusion license key +Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY"); {% endhighlight %} {% endtabs %} -## Add stylesheet and script resources +N> Replace `YOUR_LICENSE_KEY` with your actual Syncfusion license key. For details on generating and registering a license key, see [Licensing](https://blazor.syncfusion.com/documentation/licensing). + +## Add stylesheet resource -The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet and script references in the `` section of the **~/index.html** file. +The theme stylesheet can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet reference in the `` section of the **index.html** file. {% tabs %} {% highlight html tabtitle="index.html" %} - .... + + + +{% endhighlight %} +{% endtabs %} + +## Add script resource + +The Spreadsheet Editor script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the script reference in the `` section of the **index.html** file. + +{% tabs %} +{% highlight html tabtitle="index.html" %} + + + @@ -186,9 +222,9 @@ The theme stylesheet and script can be accessed from NuGet through [Static Web A N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to explore supported ways (such as static assets, CDN, and CRG) to apply themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application. -## Add Syncfusion® Blazor Spreadsheet component +## Add the Blazor Spreadsheet component -Add the Syncfusion® Blazor Spreadsheet component in the **~/Pages/Home.razor** file. +Add the Blazor Spreadsheet component in the **Pages/Home.razor** file. {% tabs %} {% highlight razor tabtitle="Home.razor" %} @@ -203,6 +239,8 @@ Add the Syncfusion® Blazor Spreadsheet comp {% endhighlight %} {% endtabs %} +N> `SpreadsheetRibbon` is the optional ribbon toolbar child component of `SfSpreadsheet`. Omit it if you want to render the spreadsheet without the ribbon UI. + Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion Blazor Spreadsheet in your default web browser. The output will appear as follows: ![Blazor Spreadsheet](images/getting-started.png) @@ -215,8 +253,9 @@ To learn how to open workbooks, bind data, or save files in the Spreadsheet comp N> [View Sample In GitHub.](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/Spreadsheet). -## See Also +N> Looking for the full Blazor Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [Blazor Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/blazor-spreadsheet-editor) page -- [Getting started with the Blazor Spreadsheet in a Blazor Web app Server app](./getting-started-webapp) -- [Getting Started with .NET MAUI Blazor Hybrid App](./blazor-hybrid-maui-app) +## See Also +- [Getting started with the Blazor Spreadsheet in a Blazor Web App (Server)](./getting-started-webapp) +- [Getting Started with .NET MAUI Blazor Hybrid App](./blazor-hybrid-maui-app) \ No newline at end of file diff --git a/Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md b/Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md index 682e45250b..607733574a 100644 --- a/Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md +++ b/Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md @@ -11,8 +11,13 @@ documentation: ug The **Open** and **Save** functionalities in the Blazor Spreadsheet component allow for efficient management of Excel files. You can open existing Excel files for analysis and modification, and save new or modified spreadsheets in a compatible format. +## New +To create a new, blank workbook through the UI, select **File > New** from the **Ribbon**. This action initializes a blank spreadsheet component, ready for data entry or formatting. If unsaved changes are present, a confirmation dialog will appear, indicating that these changes will be lost. The dialog presents options to proceed with creating the new workbook by selecting **OK**, or to cancel the operation by selecting **Cancel**. + +![UI showing file menu with new option](./images/file-new-feature.png) + ## Open -The Blazor Spreadsheet component preserves all data, cell styles, formatting, and other spreadsheet elements when opening Excel files. These files can be loaded through the user interface action or programmatic methods. +The [Blazor Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/blazor-spreadsheet-editor) component preserves all data, cell styles, formatting, and other spreadsheet elements when opening Excel files. These files can be loaded through the user interface action or programmatic methods. ### Open an Excel file via UI @@ -78,6 +83,8 @@ An Excel file encoded as a Base64 string can be loaded into the Spreadsheet comp The Blazor Spreadsheet component accepts data only as a byte array through the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_DataSource) property. To load JSON data into the Spreadsheet, convert the JSON data into an Excel file format using [XlsIO](https://help.syncfusion.com/file-formats/xlsio/overview), then convert it to a byte array. This approach allows importing JSON data from a local file or a remote URL. +N> To run the following examples, install the [Syncfusion.XlsIORenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIORenderer.Net.core) NuGet package in your project to access the XlsIO APIs used for converting JSON data to Excel format. + #### Load an Excel file from a local JSON file JSON data can be loaded from a local JSON file, converted to Excel format using XlsIO, and displayed in the Spreadsheet component. This approach is useful when working with static JSON data files within the application. The implementation reads the JSON file, converts it to Excel format using XlsIO, and binds it to the Spreadsheet as a byte array. @@ -231,6 +238,8 @@ JSON data can be loaded from a local JSON file, converted to Excel format using Remote JSON data can be integrated into the Spreadsheet component by converting it into an Excel-compatible format. The process begins with asynchronous retrieval of JSON from the specified endpoint using HttpClient. The fetched data is then transformed into an Excel workbook through XlsIO, and the resulting byte array is passed to the Spreadsheet for rendering. This approach is particularly useful for integrating real-time data from REST APIs or other web services. +N> Before using HttpClient, register it in the **Program.cs** file of your application. For Blazor WebAssembly, add `builder.Services.AddHttpClient();` before `await builder.Build().RunAsync();`. For Blazor Server, add `builder.Services.AddHttpClient();` in the service configuration section. + {% tabs %} {% highlight razor tabtitle="Index.razor" %} @@ -504,7 +513,7 @@ The Spreadsheet component supports opening the following file formats: The Spreadsheet component allows you to save data, styles, formatting, and other content as an Excel file. This functionality ensures that all modifications are preserved in a compatible format. ### Save an Excel file using UI -To save the Spreadsheet content through the user interface, select the **File > Save As** option from the **Ribbon**.You can then specify the file name and format in the save dialog. +To save the Spreadsheet content through the user interface, select the **File > Save As** option from the **Ribbon**. You can then specify the file name and format in the save dialog. ![UI showing file menu with save option](./images/file-save-feature.png) @@ -572,6 +581,8 @@ N> If options are not provided, the default settings are **FileName**: `"Spreads The [SaveAsStreamAsync()](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_SaveAsStreamAsync) method retrieves the spreadsheet content as a [MemoryStream](https://learn.microsoft.com/dotnet/api/system.io.memorystream) for further processing, such as saving to a database or cloud storage. +N> The following example uses `File.Create` to persist the stream to disk, which works only in Blazor Server (where the server has file system access). In Blazor WebAssembly, browser security prevents direct file system writes; use JavaScript interop (`IJSRuntime`) to trigger a client-side download, or send the stream to a backend API for storage. + {% tabs %} {% highlight razor tabtitle="Index.razor" %} @@ -608,7 +619,7 @@ The Blazor Spreadsheet component supports exporting spreadsheet data to multiple **Supported Save Formats:** | SaveType | File Extension | Description | -|---|---|---|---| +|---|---|---| | `Xlsx` | `.xlsx` | Microsoft Excel 2007 and later format | | `Xls` | `.xls` | Microsoft Excel 97-2003 format | | `Csv` | `.csv` | Comma Separated Values format | @@ -677,6 +688,15 @@ PDF export from the Blazor Spreadsheet component supports customization of layou | `Orientation` | `PdfPageOrientation` | `Portrait` | Controls page orientation: `Portrait` (8.5" × 11") or `Landscape` (11" × 8.5"). Choose Portrait for standard letter-sized documents or Landscape for wide data ranges. | | `FitSheetOnOnePage` | `bool` | `false` | Determines content scaling behavior: `true` scales content proportionally to fit entire sheet on single page; `false` allows content to span multiple pages using normal printing pagination. | +**Configuring PDF Layout Settings via BeforeSave Event:** + +The [BeforeSaveEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.BeforeSaveEventArgs.html) class provides properties that can be used to customize the PDF layout settings during the save operation. + +| Property | Type | Description | +|---|---|---| +| `SaveType` | Enum | Gets the export format specified in the [SaveOptions](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SaveOptions.html) during the save operation. Use this to apply conditional logic (for example, only configure PDF layout when `SaveType.Pdf` is detected). | +| `PdfLayoutSettings` | Class | Gets or sets the PDF layout configuration (page orientation and scaling behavior). Assign a `PdfLayoutSettings` instance to apply custom layout before the PDF is generated. | + **Layout Configuration Guide:** **Orientation Selection:** @@ -732,7 +752,13 @@ The following code example demonstrates saving the spreadsheet as PDF with diffe ### Preserve fonts when saving PDF (Blazor WebAssembly) -In Blazor WebAssembly, to preserve fonts in exported PDF use the `CustomFont` property of the SfSpreadsheet component. Provide local TrueType font (.ttf) files from wwwroot and reference them via the component. +In Blazor WebAssembly, to preserve fonts in exported PDF use the `CustomFonts` property of the SfSpreadsheet component. Provide local TrueType font (.ttf) files from wwwroot and reference them via the component. + +**CustomFonts Parameter:** + +| Property | Type | Description | +|---|---|---| +| `CustomFonts` | `List` | Gets or sets the list of local TrueType font (.ttf) file paths (relative to `wwwroot`) that the WASM PDF exporter fetches and embeds in the generated PDF. Only local `.ttf` files are supported; remote URLs are not allowed.| #### How to use - Place .ttf files under wwwroot (for example: wwwroot/Arial.ttf). @@ -763,9 +789,4 @@ In Blazor WebAssembly, to preserve fonts in exported PDF use the `CustomFont` pr {% endhighlight %} {% endtabs %} -N> Only local TrueType (.ttf) files referenced in `CustomFonts` are fetched and embedded by the WASM PDF exporter. If a font used in the sheet is not provided, a fallback font will be used and the appearance may change. - -## New -To create a new, blank workbook through the UI, select **File > New** from the **Ribbon**. This action initializes a blank spreadsheet component, ready for data entry or formatting. If unsaved changes are present, a confirmation dialog will appear, indicating that these changes will be lost. The dialog presents options to proceed with creating the new workbook by selecting **OK**, or to cancel the operation by selecting **Cancel**. - -![UI showing file menu with new option](./images/file-new-feature.png) +N> Only local TrueType (.ttf) files referenced in `CustomFonts` are fetched and embedded by the WASM PDF exporter. If a font used in the sheet is not provided, a default font will be used and the appearance may change. From a7f0426c79296c70a8ecacb10b28e6ade3d76415 Mon Sep 17 00:00:00 2001 From: RahulRavikumar Date: Fri, 17 Jul 2026 14:29:14 +0530 Subject: [PATCH 109/127] 1041836: Modified codes as of review corrections --- .../create-react-app.md | 77 ++---------- .../nextjs-getting-started.md | 9 +- .../Spreadsheet/React/getting-started.md | 113 ++---------------- 3 files changed, 19 insertions(+), 180 deletions(-) diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md index 7edc330b9d..d7135b9371 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md @@ -7,7 +7,7 @@ platform: document-processing documentation: ug --- -# Getting Started with the React Spreadsheet Component in a Create React App Project +# Getting Started with the React Spreadsheet Editor in a Create React App Project This article provides a step-by-step guide for setting up a React application using Create React App and integrating React Spreadsheet Editor. @@ -65,45 +65,9 @@ or yarn add @syncfusion/ej2-react-spreadsheet ``` -## Verify the Package Installation +## Add CSS references -After installing the Syncfusion® React Spreadsheet package, verify that it has been added successfully to your project. - -Run the following command: - -``` -npm list @syncfusion/ej2-react-spreadsheet -``` - -If the package is installed correctly, you will see output similar to the following: - -``` -spreadsheet-app -└── @syncfusion/ej2-react-spreadsheet@x.x.x -``` - -You can also verify the installation by checking the `dependencies` section in your `package.json` file: - -```json -{ - "dependencies": { - "@syncfusion/ej2-react-spreadsheet": "^x.x.x" - } -} -``` - -If the package is not listed, run the installation command again: - -``` -npm install @syncfusion/ej2-react-spreadsheet --save -``` - -> **Note:** The version number may vary depending on the latest package available on npm. Ensure that the package appears in both the `package.json` file and the `node_modules` folder before proceeding to the next steps. - - -## Import CSS - -The React Spreadsheet Editor comes with built-in [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme). Import the CSS styles for the Spreadsheet component and its dependent components in the `src/App.css` file. **Replace the entire default contents of that file** - Create React App's default `App.css` ships with demo styles that are not needed here. Open the file, delete everything in it, and paste the code below. The example below demonstrates importing the `Tailwind 3` theme. +Add the following Spreadsheet and dependent component style references to the `src/App.css` file. **Replace the contents of src/App.css** by removing all existing default styles and pasting the following theme import code. The example below demonstrates importing the `Tailwind 3` theme. ```css @import '../node_modules/@syncfusion/ej2-base/styles/tailwind3.css'; @@ -118,19 +82,13 @@ The React Spreadsheet Editor comes with built-in [themes](https://ej2.syncfusion @import '../node_modules/@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css'; ``` -Syncfusion also ships additional built-in themes - Material, Bootstrap, Fabric, Fluent, Bootstrap 5, and Bootstrap 4. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `material.css` or `bootstrap.css`) in all `@import` statements. - -For more details on built-in themes and usage, refer to the [Themes topic](https://ej2.syncfusion.com/react/documentation/appearance/theme). - -## Register the Syncfusion License Key +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,..) in all `@import` statements. -Syncfusion licensing is mandatory for production use. Register a valid Syncfusion license key in your application's entry point **before** rendering the `SpreadsheetComponent`. - -For step-by-step registration guidance, see [Licensing](../../../../Licensing/overview.md). +> To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. ## Add the Syncfusion® React Spreadsheet Component -Now, you can import the `SpreadsheetComponent` into your `src/App.js` file. **Replace the entire default contents of that file** - Create React App's default `App.js` ships with demo markup (logo and CSS classes) that is not needed here. Open the file, delete everything in it, and paste the code below. +Now, you can import the `SpreadsheetComponent` into your `src/App.js` file. **Replace the contents of `src/App.js`** by removing all existing default codes and pasting the following spreadsheet component code. {% tabs %} {% highlight js tabtitle="app.jsx" %} @@ -164,26 +122,6 @@ or yarn start ``` -## Stop the Development Server - -When you are finished testing the application, you can stop the Create React App development server running on localhost. - -In the terminal where the server is running, press: - -``` -Ctrl + C -``` - -You will see a confirmation prompt similar to the following: - -``` -Terminate batch job (Y/N)? -``` - -Type `Y` and press Enter to stop the server. - -> **Note:** Stopping the development server only ends the local hosting process. Your project files and application configuration remain unchanged and can be started again at any time by running `npm start` or `yarn start`. - N> Looking for the full React Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [React Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/react-spreadsheet-editor) page. ## See Also @@ -192,5 +130,4 @@ N> Looking for the full React Spreadsheet Editor component overview, features, p * [Open Excel files](../open-excel-files) * [Save Excel files](../save-excel-files) * [Web Services](../web-services/webservice-overview) -* [Data Binding](../data-binding) -* [FAQ](../../../../Frequently-asked-question.md) \ No newline at end of file +* [Data Binding](../data-binding) \ No newline at end of file diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md index d7541121d0..5ca7abb0cb 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md @@ -122,13 +122,9 @@ Import the `Material` theme into the **src/app/globals.css** file and remove the {% endhighlight %} {% endtabs %} -> To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. - -## Register the Syncfusion License Key +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,..) in all `@import` statements. -Syncfusion licensing is mandatory for production use. Register a valid Syncfusion license key in your application's entry point **before** rendering the `SpreadsheetComponent`. - -For step-by-step registration guidance, see [Licensing](../../../../Licensing/overview.md). +> To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. ## Add Syncfusion® React component @@ -468,6 +464,5 @@ Common setup and runtime issues are listed below with their cause and a resoluti | **License warning or toolbar shows a license banner at runtime.** | Syncfusion license key not registered, or registered after the component renders. | Register the license key in the application entry point **before** rendering any Syncfusion component. See [Register the Syncfusion License Key](../../register-the-syncfusion-license-key) and [Licensing FAQ](../../../../Licensing/licensing-faq/). | | **Open/Save actions fail with network or CORS errors.** | The `openUrl` / `saveUrl` endpoints are unreachable from the browser, or in production the Syncfusion demo services are rate-limited / blocked. | Host your own Spreadsheet open/save web service and ensure CORS is enabled. Refer to the [Web Services](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/web-services/webservice-overview) section. | -For additional questions, refer to the [FAQ](../../../../Frequently-asked-question.md) or contact [Syncfusion support](https://www.syncfusion.com/support). N> Looking for the full React Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [React Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/react-spreadsheet-editor) page. \ No newline at end of file diff --git a/Document-Processing/Excel/Spreadsheet/React/getting-started.md b/Document-Processing/Excel/Spreadsheet/React/getting-started.md index 65d9dfd36a..6d15141011 100644 --- a/Document-Processing/Excel/Spreadsheet/React/getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/getting-started.md @@ -15,12 +15,6 @@ This section explains how to create a simple React application and add the [Reac [System requirements for React components](https://ej2.syncfusion.com/react/documentation/system-requirement) -## Video tutorial - -To get started quickly with React Spreadsheet, you can watch this video: - -{% youtube "https://www.youtube.com/watch?v=3Cx9AnKAHdY" %} - ## Create a React application Use [`Vite`](https://vite.dev/guide/) to create a new React application, as it provides a faster development environment, smaller bundle sizes, and optimized builds. @@ -50,44 +44,9 @@ Install the [Syncfusion® React Spreadsheet](https://www.npmjs.com/package/@sync npm install @syncfusion/ej2-react-spreadsheet --save ``` -## Verify the package installation - -After installing the Syncfusion® React Spreadsheet package, verify that it has been added successfully to your project. - -Run the following command: - -``` -npm list @syncfusion/ej2-react-spreadsheet -``` - -If the package is installed correctly, you will see output similar to the following: - -``` -spreadsheet-app -└── @syncfusion/ej2-react-spreadsheet@x.x.x -``` - -You can also verify the installation by checking the `dependencies` section in your `package.json` file: - -```json -{ - "dependencies": { - "@syncfusion/ej2-react-spreadsheet": "^x.x.x" - } -} -``` - -If the package is not listed, run the installation command again: - -``` -npm install @syncfusion/ej2-react-spreadsheet --save -``` - -> **Note:** The version number may vary depending on the latest package available on npm. Ensure that the package appears in both the `package.json` file and the `node_modules` folder before proceeding to the next steps. - ## Add CSS references -Add the following Spreadsheet and dependent component style references to the `src/index.css` file. **Replace the entire default contents of that file** - Vite's starter `App` component ships with demo styles that is not needed here. Open the file, delete everything in it, and paste the code below. The example below demonstrates importing the `Tailwind 3` theme. +Add the following Spreadsheet and dependent component style references to the `src/index.css` file. **Replace the contents of src/index.css** by removing all existing default styles and pasting the following theme import code. The example below demonstrates importing the `Tailwind 3` theme. ```css @import '@syncfusion/ej2-base/styles/tailwind3.css'; @@ -102,17 +61,13 @@ Add the following Spreadsheet and dependent component style references to the `s @import '@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css'; ``` -Syncfusion also ships additional built-in themes - Material, Bootstrap, Fabric, Fluent, Bootstrap 5, and Bootstrap 4. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `material.css` or `bootstrap.css`) in all `@import` statements. +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,..) in all `@import` statements. -## Register the Syncfusion License Key - -Syncfusion licensing is mandatory for production use. Register a valid Syncfusion license key in your application's entry point **before** rendering the `SpreadsheetComponent`. - -For step-by-step registration guidance, see [Licensing](../../../Licensing/overview.md). +> To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. ## Add the Syncfusion® React Spreadsheet component -Now, import the `SpreadsheetComponent` into your `src/App.jsx` or `src/App.tsx` file and render it. **Replace the entire default contents of that file** - Vite's starter `App` component ships with demo markup (logo, counter, CSS classes) that is not needed here. Open the file, delete everything in it, and paste the code below. +Now, import the `SpreadsheetComponent` into your `src/App.jsx` or `src/App.tsx` file and render it. **Replace the contents of `src/App.jsx` or `src/App.tsx`** by removing all existing default codes and pasting the following spreadsheet component code. {% tabs %} {% highlight js tabtitle="app.jsx" %} @@ -143,39 +98,6 @@ export default function App() { > **Note:** The [`openUrl`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#openurl) and [`saveUrl`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#saveurl) endpoints used in this example are provided only for demonstration purposes. For development and production use, we strongly recommend configuring your own local or hosted web service for the Open and Save actions instead of relying on the online demo service. For more information, refer to the [`Web Services`](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/web-services/webservice-overview) section. -### Configure additional Spreadsheet properties - -Along with the `openUrl` and `saveUrl` properties, you can configure additional Spreadsheet properties during component initialization to customize the Spreadsheet's behavior and appearance. This allows you to enable or disable specific features, control the user interface, and tailor the Spreadsheet experience to meet your application requirements. - -{% tabs %} -{% highlight js tabtitle="app.jsx" %} -{% raw %} - -import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet'; - -export default function App() { - return (); -} -{% endraw %} -{% endhighlight %} -{% highlight ts tabtitle="app.tsx" %} -{% raw %} - -import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet'; - -export default function App() { - return (); -} -{% endraw %} -{% endhighlight %} -{% endtabs %} - -> **Note:** The React Spreadsheet component provides a rich set of configuration options, including editing, formatting, importing and exporting Excel files, sheet management, and UI customization. You can specify the required properties during initialization to configure the component according to your application's needs. For the complete list of available properties, refer to the https://ej2.syncfusion.com/react/documentation/api/spreadsheet/. - ## Run the application Run the following command to start the development server: @@ -188,29 +110,15 @@ After the application starts, open the localhost URL shown in the terminal to vi ![React Spreadsheet Editor](images/spreadsheet.png) -## Stop the development server - -When you are finished testing the application, you can stop the Vite development server running on localhost. - -In the terminal where the server is running, press: - -``` -Ctrl + C -``` - -You will see a confirmation prompt similar to the following: - -``` -Terminate batch job (Y/N)? -``` +You can also explore the Spreadsheet interactively using the live sample below. -Type `Y` and press Enter to stop the server. +{% previewsample "/document-processing/code-snippet/spreadsheet/react/getting-started-cs1" %} -> **Note:** Stopping the development server only ends the local hosting process. Your project files and application configuration remain unchanged and can be started again at any time by running `npm run dev`. +## Video tutorial -You can also explore the Spreadsheet interactively using the live sample below. +To get started quickly with React Spreadsheet, you can watch this video: -{% previewsample "/document-processing/code-snippet/spreadsheet/react/getting-started-cs1" %} +{% youtube "https://www.youtube.com/watch?v=3Cx9AnKAHdY" %} > [View Sample in GitHub](https://github.com/SyncfusionExamples/getting-started-with-the-react-spreadsheet-component) to explore the complete source code. You can also explore our [React Spreadsheet example](https://document.syncfusion.com/demos/spreadsheet-editor/react/#/tailwind3/spreadsheet/default) that shows you how to present and manipulate data. @@ -221,5 +129,4 @@ N> Looking for the full React Spreadsheet Editor component overview, features, p * [Open Excel files](./open-excel-files) * [Save Excel files](./save-excel-files) * [Web Services](./web-services/webservice-overview) -* [Data Binding](./data-binding) -* [FAQ](../../../Frequently-asked-question.md) +* [Data Binding](./data-binding) \ No newline at end of file From c06b13a7b041c5f2e2c5ecee6be70987d1cf107a Mon Sep 17 00:00:00 2001 From: RahulRavikumar Date: Fri, 17 Jul 2026 14:35:40 +0530 Subject: [PATCH 110/127] 1041836: Modified codes as of review corrections --- .../React/environment-integration/create-react-app.md | 2 +- .../Excel/Spreadsheet/React/getting-started.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md index d7135b9371..246e1f5630 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md @@ -88,7 +88,7 @@ Syncfusion also ships additional built-in themes. To use a different theme, repl ## Add the Syncfusion® React Spreadsheet Component -Now, you can import the `SpreadsheetComponent` into your `src/App.js` file. **Replace the contents of `src/App.js`** by removing all existing default codes and pasting the following spreadsheet component code. +Now, you can import the `SpreadsheetComponent` into your `src/App.js` file. **Replace the contents of `src/App.js`** by removing all existing default codes and pasting the following spreadsheet component codes. {% tabs %} {% highlight js tabtitle="app.jsx" %} diff --git a/Document-Processing/Excel/Spreadsheet/React/getting-started.md b/Document-Processing/Excel/Spreadsheet/React/getting-started.md index 6d15141011..d426521582 100644 --- a/Document-Processing/Excel/Spreadsheet/React/getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/getting-started.md @@ -67,7 +67,7 @@ Syncfusion also ships additional built-in themes. To use a different theme, repl ## Add the Syncfusion® React Spreadsheet component -Now, import the `SpreadsheetComponent` into your `src/App.jsx` or `src/App.tsx` file and render it. **Replace the contents of `src/App.jsx` or `src/App.tsx`** by removing all existing default codes and pasting the following spreadsheet component code. +Now, import the `SpreadsheetComponent` into your `src/App.jsx` or `src/App.tsx` file and render it. **Replace the contents of `src/App.jsx` or `src/App.tsx`** by removing all existing default codes and pasting the following spreadsheet component codes. {% tabs %} {% highlight js tabtitle="app.jsx" %} @@ -114,14 +114,14 @@ You can also explore the Spreadsheet interactively using the live sample below. {% previewsample "/document-processing/code-snippet/spreadsheet/react/getting-started-cs1" %} +> [View Sample in GitHub](https://github.com/SyncfusionExamples/getting-started-with-the-react-spreadsheet-component) to explore the complete source code. You can also explore our [React Spreadsheet example](https://document.syncfusion.com/demos/spreadsheet-editor/react/#/tailwind3/spreadsheet/default) that shows you how to present and manipulate data. + ## Video tutorial To get started quickly with React Spreadsheet, you can watch this video: {% youtube "https://www.youtube.com/watch?v=3Cx9AnKAHdY" %} -> [View Sample in GitHub](https://github.com/SyncfusionExamples/getting-started-with-the-react-spreadsheet-component) to explore the complete source code. You can also explore our [React Spreadsheet example](https://document.syncfusion.com/demos/spreadsheet-editor/react/#/tailwind3/spreadsheet/default) that shows you how to present and manipulate data. - N> Looking for the full React Spreadsheet Editor component overview, features, pricing, and documentation? Visit the [React Spreadsheet Editor](https://www.syncfusion.com/spreadsheet-editor-sdk/react-spreadsheet-editor) page. ## See also From 393ee35b27c7f17a9f15ac946010635016798ecd Mon Sep 17 00:00:00 2001 From: RahulRavikumar Date: Fri, 17 Jul 2026 14:36:47 +0530 Subject: [PATCH 111/127] 1041836: Modified codes as of review corrections --- .../React/environment-integration/create-react-app.md | 2 +- .../React/environment-integration/nextjs-getting-started.md | 2 +- Document-Processing/Excel/Spreadsheet/React/getting-started.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md index 246e1f5630..2d551c1bc7 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md @@ -82,7 +82,7 @@ Add the following Spreadsheet and dependent component style references to the `s @import '../node_modules/@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css'; ``` -Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,..) in all `@import` statements. +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,.) in all `@import` statements. > To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md index 5ca7abb0cb..e9263bae45 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md @@ -122,7 +122,7 @@ Import the `Material` theme into the **src/app/globals.css** file and remove the {% endhighlight %} {% endtabs %} -Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,..) in all `@import` statements. +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,.) in all `@import` statements. > To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. diff --git a/Document-Processing/Excel/Spreadsheet/React/getting-started.md b/Document-Processing/Excel/Spreadsheet/React/getting-started.md index d426521582..f890957ef7 100644 --- a/Document-Processing/Excel/Spreadsheet/React/getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/getting-started.md @@ -61,7 +61,7 @@ Add the following Spreadsheet and dependent component style references to the `s @import '@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css'; ``` -Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,..) in all `@import` statements. +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,.) in all `@import` statements. > To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. From b98bbd126866b06a794f1f953ba7d13f7d8ebae3 Mon Sep 17 00:00:00 2001 From: RahulRavikumar Date: Fri, 17 Jul 2026 14:38:33 +0530 Subject: [PATCH 112/127] 1041836: Modified codes as of review corrections --- .../React/environment-integration/create-react-app.md | 2 +- .../React/environment-integration/nextjs-getting-started.md | 2 +- Document-Processing/Excel/Spreadsheet/React/getting-started.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md index 2d551c1bc7..a54f2b23a1 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md @@ -82,7 +82,7 @@ Add the following Spreadsheet and dependent component style references to the `s @import '../node_modules/@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css'; ``` -Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,.) in all `@import` statements. +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc.) in all `@import` statements. > To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md index e9263bae45..30652d0f4b 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md @@ -122,7 +122,7 @@ Import the `Material` theme into the **src/app/globals.css** file and remove the {% endhighlight %} {% endtabs %} -Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,.) in all `@import` statements. +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc.) in all `@import` statements. > To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. diff --git a/Document-Processing/Excel/Spreadsheet/React/getting-started.md b/Document-Processing/Excel/Spreadsheet/React/getting-started.md index f890957ef7..f2c9ad8877 100644 --- a/Document-Processing/Excel/Spreadsheet/React/getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/getting-started.md @@ -61,7 +61,7 @@ Add the following Spreadsheet and dependent component style references to the `s @import '@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css'; ``` -Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc,.) in all `@import` statements. +Syncfusion also ships additional built-in themes. To use a different theme, replace `tailwind3.css` with the theme of your choice (for example, `bootstrap5.css`, `fluent2.css`, etc.) in all `@import` statements. > To know more about built-in themes and CSS reference for individual components, refer to the [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme) section. From eea3a5c1d660a234bc7dc2e497043746693dbace Mon Sep 17 00:00:00 2001 From: RahulRavikumar Date: Fri, 17 Jul 2026 15:03:22 +0530 Subject: [PATCH 113/127] 1041836: Modified codes as of review corrections --- Document-Processing/Excel/Spreadsheet/React/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/Excel/Spreadsheet/React/getting-started.md b/Document-Processing/Excel/Spreadsheet/React/getting-started.md index f2c9ad8877..b6e0807632 100644 --- a/Document-Processing/Excel/Spreadsheet/React/getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/getting-started.md @@ -41,7 +41,7 @@ cd spreadsheet-app Install the [Syncfusion® React Spreadsheet](https://www.npmjs.com/package/@syncfusion/ej2-react-spreadsheet) package from npm using the following command: ``` -npm install @syncfusion/ej2-react-spreadsheet --save +npm install @syncfusion/ej2-react-spreadsheet ``` ## Add CSS references From 5b1713947c582a8842ed86f2b7aab533a42b554d Mon Sep 17 00:00:00 2001 From: RahulRavikumar Date: Fri, 17 Jul 2026 15:08:23 +0530 Subject: [PATCH 114/127] 1041836: Resolved front matter error --- .../React/environment-integration/create-react-app.md | 2 +- .../React/environment-integration/nextjs-getting-started.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md index a54f2b23a1..f6fd93f60a 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md @@ -7,7 +7,7 @@ platform: document-processing documentation: ug --- -# Getting Started with the React Spreadsheet Editor in a Create React App Project +# Getting Started with the React Spreadsheet Editor in Create React App This article provides a step-by-step guide for setting up a React application using Create React App and integrating React Spreadsheet Editor. diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md index 30652d0f4b..486b1a8825 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md @@ -12,7 +12,7 @@ This section provides a step-by-step guide for setting up a Next.js application ## What is Next.js? -[Next.js](https://nextjs.org/) is a React framework that makes it easy to build fast, SEO-friendly, and user-friendly web applications. It provides features such as server-side rendering, automatic code splitting, routing, and API routes, making it an excellent choice for building modern web applications. +[Next.js](https://nextjs.org) is a React framework that makes it easy to build fast, SEO-friendly, and user-friendly web applications. It provides features such as server-side rendering, automatic code splitting, routing, and API routes, making it an excellent choice for building modern web applications. ## Prerequisites @@ -461,7 +461,7 @@ Common setup and runtime issues are listed below with their cause and a resoluti | **`use client` / hydration error**: `Text content did not match` or error referencing server-rendered HTML. | The Spreadsheet uses browser APIs (DOM, events) and cannot be server-rendered. | Ensure the `'use client'` directive is present at the top of `src/app/page.tsx`. If the component is imported into a Server Component, move it to a separate Client Component file. See [React Server and Client Components](https://react.dev/reference/rsc/use-client). | | **CSS not applied / unstyled component** (plain HTML layout, broken toolbar icons). | Theme stylesheets were not imported or imported with the wrong relative path. | Verify the `@import` blocks for all dependency CSS files (`ej2-base`, `ej2-inputs`, etc.) are present in `src/app/globals.css` and the paths resolve from the `src/app/` location. Restart the dev server after editing CSS. | | **`Cannot find module '@syncfusion/ej2...'` or peer dependency warnings during `npm install`.** | Package not installed, or React version mismatch. | Re-run `npm install @syncfusion/ej2-react-spreadsheet`. For peer dependency conflicts, ensure React is on a version supported by the package (see the [NuGet package / npm version](../../../../NuGet-Packages.md) notes) and use `--legacy-peer-deps` only as a temporary workaround. | -| **License warning or toolbar shows a license banner at runtime.** | Syncfusion license key not registered, or registered after the component renders. | Register the license key in the application entry point **before** rendering any Syncfusion component. See [Register the Syncfusion License Key](../../register-the-syncfusion-license-key) and [Licensing FAQ](../../../../Licensing/licensing-faq/). | +| **License warning or toolbar shows a license banner at runtime.** | Syncfusion license key not registered, or registered after the component renders. | Register the license key in the application entry point **before** rendering any Syncfusion component. See [Register the Syncfusion License Key](../../register-the-syncfusion-license-key) and [Licensing FAQ](../../../../Licensing/licensing-faq). | | **Open/Save actions fail with network or CORS errors.** | The `openUrl` / `saveUrl` endpoints are unreachable from the browser, or in production the Syncfusion demo services are rate-limited / blocked. | Host your own Spreadsheet open/save web service and ensure CORS is enabled. Refer to the [Web Services](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/web-services/webservice-overview) section. | From 8ea7bac338b451353f0166d0ae9aa5609839333a Mon Sep 17 00:00:00 2001 From: "AzureAD\\DhakshinPrasathDhanr" Date: Fri, 17 Jul 2026 15:30:34 +0530 Subject: [PATCH 115/127] 1041294: Resolved issues in mvc page --- .../javascript/Create-PDF-document-asp-net-mvc.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md index 698fc93687..e964364781 100644 --- a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md +++ b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md @@ -20,7 +20,7 @@ This guide explains how to integrate the [JavaScript PDF Library](https://www.sy Before you begin, make sure you have the following installed: - Visual Studio 2019 or later (Visual Studio 2022 recommended) with the **ASP.NET and web development** workload. -- .NET SDK 8.0 (LTS) or later. +- .NET Framwork 4.6.2 or later. - An active internet connection (the sample loads the JavaScript PDF Library from the Syncfusion CDN). - A supported browser such as the latest versions of Microsoft Edge, Google Chrome, or Mozilla Firefox. @@ -30,15 +30,15 @@ N> This guide uses the CDN distribution of the JavaScript PDF Library. No client Step 1: Start Visual Studio and select **Create a new project**. -Step 2: In the **Create a new project** dialog, select **ASP.NET MVC Web App (Model-View-Controller)**. +Step 2: In the **Create a new project** dialog, select **ASP.NET MVC Web Application project (.NET Framework)**. ![ASP.NET MVC PDF creation1](Getting_started_images/Asp-net-mvc-creation1.png) -Step 3: In the **Configure your new project** dialog, enter the project name, choose the target framework (for example, **.NET 8.0 (Long-term support)**), and select **Next**. +Step 3: In the **Configure your new project** dialog, enter the project name, choose the target framework (for example, **.NET Framework 4.7.2**). ![ASP.NET MVC PDF creation2](Getting_started_images/Asp-net-mvc-creation2.png) -Step 4: Confirm that **Web Application (Model-View-Controller)** is selected in the additional information dialog, and then select the **Create** button. +Step 4: Confirm that **Web Application pattern (Model-View-Controller)** is selected in the additional information dialog, and then select the **Create** button. ![ASP.NET MVC PDF creation3](Getting_started_images/Asp-net-mvc-creation3.png) From 60b3e7bc9d5475e3505b8dc4fa89eea78c760281 Mon Sep 17 00:00:00 2001 From: RahulRavikumar Date: Fri, 17 Jul 2026 15:39:35 +0530 Subject: [PATCH 116/127] 1041836: Modified codes as of review corrections --- .../create-react-app.md | 3 +-- .../nextjs-getting-started.md | 22 +++++++++---------- .../Spreadsheet/React/getting-started.md | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md index f6fd93f60a..a6cfa74e27 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md @@ -88,7 +88,7 @@ Syncfusion also ships additional built-in themes. To use a different theme, repl ## Add the Syncfusion® React Spreadsheet Component -Now, you can import the `SpreadsheetComponent` into your `src/App.js` file. **Replace the contents of `src/App.js`** by removing all existing default codes and pasting the following spreadsheet component codes. +Now, import the `SpreadsheetComponent` into `src/App.js` file and replace the existing code with the following: {% tabs %} {% highlight js tabtitle="app.jsx" %} @@ -129,5 +129,4 @@ N> Looking for the full React Spreadsheet Editor component overview, features, p * [Getting Started with the React Spreadsheet Component in a Next.js Project](./nextjs-getting-started) * [Open Excel files](../open-excel-files) * [Save Excel files](../save-excel-files) -* [Web Services](../web-services/webservice-overview) * [Data Binding](../data-binding) \ No newline at end of file diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md index 486b1a8825..514be3d6a2 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md @@ -103,21 +103,21 @@ yarn add @syncfusion/ej2-react-spreadsheet React components come with [built-in themes](https://ej2.syncfusion.com/react/documentation/appearance/theme), which are available in the installed packages. It’s easy to adapt the Syncfusion® React components to match the style of your application by referring to one of the built-in themes. -Import the `Material` theme into the **src/app/globals.css** file and remove the existing styles in that file, as shown below: +Import the `Tailwind 3` theme into the **src/app/globals.css** file and remove the existing styles in that file, as shown below: {% tabs %} {% highlight css tabtitle="globals.css" %} -@import '@syncfusion/ej2-base/styles/material.css'; -@import '@syncfusion/ej2-inputs/styles/material.css'; -@import '@syncfusion/ej2-buttons/styles/material.css'; -@import '@syncfusion/ej2-splitbuttons/styles/material.css'; -@import '@syncfusion/ej2-lists/styles/material.css'; -@import '@syncfusion/ej2-navigations/styles/material.css'; -@import '@syncfusion/ej2-popups/styles/material.css'; -@import '@syncfusion/ej2-dropdowns/styles/material.css'; -@import '@syncfusion/ej2-grids/styles/material.css'; -@import '@syncfusion/ej2-react-spreadsheet/styles/material.css'; +@import '@syncfusion/ej2-base/styles/tailwind3.css'; +@import '@syncfusion/ej2-inputs/styles/tailwind3.css'; +@import '@syncfusion/ej2-buttons/styles/tailwind3.css'; +@import '@syncfusion/ej2-splitbuttons/styles/tailwind3.css'; +@import '@syncfusion/ej2-lists/styles/tailwind3.css'; +@import '@syncfusion/ej2-navigations/styles/tailwind3.css'; +@import '@syncfusion/ej2-popups/styles/tailwind3.css'; +@import '@syncfusion/ej2-dropdowns/styles/tailwind3.css'; +@import '@syncfusion/ej2-grids/styles/tailwind3.css'; +@import '@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css'; {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/React/getting-started.md b/Document-Processing/Excel/Spreadsheet/React/getting-started.md index b6e0807632..3f1b04c781 100644 --- a/Document-Processing/Excel/Spreadsheet/React/getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/getting-started.md @@ -46,7 +46,7 @@ npm install @syncfusion/ej2-react-spreadsheet ## Add CSS references -Add the following Spreadsheet and dependent component style references to the `src/index.css` file. **Replace the contents of src/index.css** by removing all existing default styles and pasting the following theme import code. The example below demonstrates importing the `Tailwind 3` theme. +Add the following Spreadsheet and dependent component styles to `src/index.css` file. Replace the existing content with the theme import code below. The following example uses the `Tailwind 3` theme. ```css @import '@syncfusion/ej2-base/styles/tailwind3.css'; @@ -67,7 +67,7 @@ Syncfusion also ships additional built-in themes. To use a different theme, repl ## Add the Syncfusion® React Spreadsheet component -Now, import the `SpreadsheetComponent` into your `src/App.jsx` or `src/App.tsx` file and render it. **Replace the contents of `src/App.jsx` or `src/App.tsx`** by removing all existing default codes and pasting the following spreadsheet component codes. +Import and render the `SpreadsheetComponent` in `src/App.jsx` or `src/App.tsx`. Replace the existing content with the following code. {% tabs %} {% highlight js tabtitle="app.jsx" %} From 236045626200f2056d06fbc33a34e44a499b58f8 Mon Sep 17 00:00:00 2001 From: "AzureAD\\DhakshinPrasathDhanr" Date: Fri, 17 Jul 2026 15:52:06 +0530 Subject: [PATCH 117/127] 1041294: Resolved CI issues in mvc page --- .../PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md index e964364781..29fe04852a 100644 --- a/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md +++ b/Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md @@ -20,7 +20,7 @@ This guide explains how to integrate the [JavaScript PDF Library](https://www.sy Before you begin, make sure you have the following installed: - Visual Studio 2019 or later (Visual Studio 2022 recommended) with the **ASP.NET and web development** workload. -- .NET Framwork 4.6.2 or later. +- .NET Framework 4.6.2 or later. - An active internet connection (the sample loads the JavaScript PDF Library from the Syncfusion CDN). - A supported browser such as the latest versions of Microsoft Edge, Google Chrome, or Mozilla Firefox. From da6a22c0c812feda73be31431e1cef66b6534bc7 Mon Sep 17 00:00:00 2001 From: RahulRavikumar Date: Fri, 17 Jul 2026 15:58:24 +0530 Subject: [PATCH 118/127] 1041836: Modified codes as of review corrections --- .../React/environment-integration/create-react-app.md | 2 +- .../React/environment-integration/nextjs-getting-started.md | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md index a6cfa74e27..c84801efc5 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/create-react-app.md @@ -67,7 +67,7 @@ yarn add @syncfusion/ej2-react-spreadsheet ## Add CSS references -Add the following Spreadsheet and dependent component style references to the `src/App.css` file. **Replace the contents of src/App.css** by removing all existing default styles and pasting the following theme import code. The example below demonstrates importing the `Tailwind 3` theme. +Add the following Spreadsheet and dependent component style references to the `src/App.css` file. Replace the existing content with the theme import code below. The following example uses the `Tailwind 3` theme. ```css @import '../node_modules/@syncfusion/ej2-base/styles/tailwind3.css'; diff --git a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md index 514be3d6a2..e4ec5d4a01 100644 --- a/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md +++ b/Document-Processing/Excel/Spreadsheet/React/environment-integration/nextjs-getting-started.md @@ -101,9 +101,7 @@ yarn add @syncfusion/ej2-react-spreadsheet ## Import Syncfusion® CSS styles -React components come with [built-in themes](https://ej2.syncfusion.com/react/documentation/appearance/theme), which are available in the installed packages. It’s easy to adapt the Syncfusion® React components to match the style of your application by referring to one of the built-in themes. - -Import the `Tailwind 3` theme into the **src/app/globals.css** file and remove the existing styles in that file, as shown below: +Add the following Spreadsheet and dependent component style references to the `src/app/globals.css` file. Replace the existing content with the theme import code below. The following example uses the `Tailwind 3` theme. {% tabs %} {% highlight css tabtitle="globals.css" %} From 37c8880502fae60fac345284d215dfb8e2a16f98 Mon Sep 17 00:00:00 2001 From: Silambharasan K Date: Fri, 17 Jul 2026 16:20:47 +0530 Subject: [PATCH 119/127] Modified all maui links to document processing links --- .../maui/Add-Remove-Modify-Annotations.md | 32 ++-- .../PDF-Viewer/maui/Annotation-Collection.md | 8 +- .../PDF-Viewer/maui/Annotations-Comment.md | 2 +- .../PDF-Viewer/maui/Annotations-Overview.md | 4 +- .../PDF-Viewer/maui/Coordinates-Conversion.md | 22 +-- .../PDF/PDF-Viewer/maui/Custom-Bookmark.md | 22 +-- .../maui/Document-Link-Annotations.md | 2 +- .../PDF/PDF-Viewer/maui/Document-Outline.md | 10 +- .../maui/DocumentLoadNotifications.md | 12 +- .../maui/Form-Filling-Collection.md | 10 +- .../maui/Form-Filling-Customization.md | 6 +- .../PDF-Viewer/maui/Form-Filling-Events.md | 10 +- .../maui/Form-Filling-Import-Export.md | 10 +- .../PDF-Viewer/maui/Form-Filling-Overview.md | 4 +- .../PDF-Viewer/maui/Form-Filling-Show-Hide.md | 2 +- .../maui/Form-Filling-Validation.md | 2 +- .../PDF/PDF-Viewer/maui/Free-Text.md | 26 +-- .../PDF/PDF-Viewer/maui/Gesture-Events.md | 16 +- .../PDF/PDF-Viewer/maui/Getting-Started.md | 24 +-- .../PDF-Viewer/maui/Hyperlink-Navigation.md | 6 +- .../maui/Import-Export-Annotations.md | 18 +- .../PDF/PDF-Viewer/maui/Ink-Eraser.md | 14 +- .../PDF/PDF-Viewer/maui/Ink.md | 26 +-- .../PDF/PDF-Viewer/maui/Localization.md | 4 +- .../PDF/PDF-Viewer/maui/Lock-Unlock.md | 22 +-- .../PDF/PDF-Viewer/maui/Magnification.md | 14 +- .../PDF/PDF-Viewer/maui/Migration.md | 180 +++++++++--------- .../maui/Open-a-Document-From-Base64String.md | 4 +- .../Open-a-Document-From-Local-Storage.md | 4 +- .../maui/Open-a-Document-From-URL.md | 2 +- .../PDF/PDF-Viewer/maui/Open-a-Document.md | 22 +-- .../Open-a-Password-Protected-Document.md | 14 +- .../PDF/PDF-Viewer/maui/Page-Navigation.md | 18 +- .../PDF/PDF-Viewer/maui/Print-a-Document.md | 20 +- .../PDF/PDF-Viewer/maui/Redaction.md | 28 +-- .../PDF/PDF-Viewer/maui/Right-To-Left.md | 2 +- .../PDF/PDF-Viewer/maui/Save-a-Document.md | 16 +- .../maui/Select-Deselect-Annotations.md | 26 +-- .../PDF/PDF-Viewer/maui/Shapes.md | 32 ++-- .../PDF/PDF-Viewer/maui/Show-Hide.md | 2 +- .../PDF/PDF-Viewer/maui/Signature.md | 26 +-- .../PDF/PDF-Viewer/maui/Stamps.md | 16 +- .../PDF/PDF-Viewer/maui/Sticky-Notes.md | 26 +-- .../PDF/PDF-Viewer/maui/Text-Markups.md | 22 +-- .../PDF/PDF-Viewer/maui/Text-Search.md | 26 +-- .../PDF/PDF-Viewer/maui/Text-Selection.md | 14 +- .../PDF-Viewer/maui/Toolbar-Customization.md | 16 +- .../PDF/PDF-Viewer/maui/Toolbar.md | 8 +- .../PDF/PDF-Viewer/maui/UI-Customization.md | 2 +- .../PDF/PDF-Viewer/maui/Undo-Redo.md | 10 +- .../PDF-Viewer/maui/liquid-glass-effect.md | 12 +- 51 files changed, 438 insertions(+), 438 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md b/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md index 615537db41..03bf75e6c5 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Add-Remove-Modify-Annotations.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Add, Remove, and Edit Annotations -This section explains the various functions in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for adding, removing, and editing annotations in a PDF document. +This section explains the various functions in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for adding, removing, and editing annotations in a PDF document. ## Add annotations to a PDF document @@ -18,7 +18,7 @@ This section explains how to add annotations to a PDF document programmatically. ### Add annotations programmatically -You can add a new annotation to the PDF document programmatically by creating an annotation instance and providing it as a parameter to the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The following example shows how to create an instance of a circle annotation and add it to the PDF document. Similarly, you can create and add other types of annotations. For more information on the available annotation types, refer to the [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview). +You can add a new annotation to the PDF document programmatically by creating an annotation instance and providing it as a parameter to the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The following example shows how to create an instance of a circle annotation and add it to the PDF document. Similarly, you can create and add other types of annotations. For more information on the available annotation types, refer to the [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview). {% tabs %} {% highlight c# %} @@ -45,13 +45,13 @@ void AddCircleAnnotation() ### AnnotationAdded event -The [AnnotationAdded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded) event occurs when an annotation is added successfully to the PDF document. The following example explains how to wire and handle the event. +The [AnnotationAdded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded) event occurs when an annotation is added successfully to the PDF document. The following example explains how to wire and handle the event. {% tabs %} {% highlight c# %} void WireAnnotationAddedEvent() { - // Wire the annotation added event of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. + // Wire the annotation added event of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. PdfViewer.AnnotationAdded += OnAnnotationAdded; } @@ -69,13 +69,13 @@ This section explains different methods of removing annotations from a PDF docum ### Remove a specific annotation -You can remove an annotation from the document programmatically by providing the specific annotation instance as the parameter to the [RemoveAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example shows how to remove the first annotation in the annotation collection from a PDF document. +You can remove an annotation from the document programmatically by providing the specific annotation instance as the parameter to the [RemoveAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example shows how to remove the first annotation in the annotation collection from a PDF document. {% tabs %} {% highlight c# %} void RemoveFirstAnnotation() { - //Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + //Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection annotations = PdfViewer.Annotations; //Obtain the first annotation in the annotation collection. @@ -89,13 +89,13 @@ void RemoveFirstAnnotation() ### Remove all the annotations -You can remove all the annotations from a document programmatically by calling the [RemoveAllAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllAnnotations) method. The following example shows how to remove all the annotations from a PDF document. +You can remove all the annotations from a document programmatically by calling the [RemoveAllAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllAnnotations) method. The following example shows how to remove all the annotations from a PDF document. {% tabs %} {% highlight c# %} void RemoveAllAnnotations() { - // Removes all the annotations from a PDF document using [RemoveAllAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllAnnotations) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). + // Removes all the annotations from a PDF document using [RemoveAllAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllAnnotations) method of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). PdfViewer.RemoveAllAnnotations(); } {% endhighlight %} @@ -103,13 +103,13 @@ void RemoveAllAnnotations() ### AnnotationRemoved event -The [AnnotationRemoved](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved) event occurs when an annotation is removed successfully from the PDF document. The following example explains how to wire and handle the event. +The [AnnotationRemoved](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved) event occurs when an annotation is removed successfully from the PDF document. The following example explains how to wire and handle the event. {% tabs %} {% highlight c# %} void WireAnnotationRemovedEvent() { - // Wire the annotation removed event of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). + // Wire the annotation removed event of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). PdfViewer.AnnotationRemoved += OnAnnotationRemoved; } @@ -127,13 +127,13 @@ This section will go through different methods of editing annotations in a PDF d ### Edit a specific annotation -You can edit the properties of an annotation from the document programmatically by accessing the specific annotation instance from the [Annotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) property of the SfPdfViewer. The following example shows how to edit the first annotation in the annotation collection. Similarly, you can also modify the other properties. +You can edit the properties of an annotation from the document programmatically by accessing the specific annotation instance from the [Annotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) property of the SfPdfViewer. The following example shows how to edit the first annotation in the annotation collection. Similarly, you can also modify the other properties. {% tabs %} {% highlight c# %} void EditFirstAnnotation() { - // Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection annotations = PdfViewer.Annotations; // Obtain the first annotation in the annotation collection. @@ -156,13 +156,13 @@ void EditFirstAnnotation() ### AnnotationEdited event -The [AnnotationEdited](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited) event occurs when an annotation is edited in the PDF document. The following example explains how to wire and handle the event. +The [AnnotationEdited](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited) event occurs when an annotation is edited in the PDF document. The following example explains how to wire and handle the event. {% tabs %} {% highlight c# %} void WireAnnotationEditedEvent() { - // Wire the annotation edited event of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). + // Wire the annotation edited event of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). PdfViewer.AnnotationEdited += OnAnnotationEdited; } @@ -176,9 +176,9 @@ private void OnAnnotationEdited(object sender, AnnotationEventArgs e) ## Adding custom information to an annotation -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to assign custom information to annotations. The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property is utilized to store additional information about each annotation instance for reference. However, it's essential to note that this data is solely intended for reference purposes and will not be displayed in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) interface. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to assign custom information to annotations. The [CustomData](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property is utilized to store additional information about each annotation instance for reference. However, it's essential to note that this data is solely intended for reference purposes and will not be displayed in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) interface. -The provided code sample illustrates how to set the [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property for an annotation. In this code sample, the custom data is set to represent the creation date of the annotation. +The provided code sample illustrates how to set the [CustomData](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_CustomData) property for an annotation. In this code sample, the custom data is set to represent the creation date of the annotation. {% tabs %} {% highlight C# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md index 95bf34ed27..538aae276b 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotation-Collection.md @@ -10,14 +10,14 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Annotation Collection in .NET MAUI PDF Viewer (SfPdfViewer) -The existing annotations in a PDF document can be accessed using the [Annotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This read-only property will have the annotation collection information as soon as the document is loaded into the PDF Viewer. +The existing annotations in a PDF document can be accessed using the [Annotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This read-only property will have the annotation collection information as soon as the document is loaded into the PDF Viewer. The following example explains how to use the property to obtain information about the first annotation in a specific document. {% tabs %} {% highlight c# %} public void WireDocumentLoadedEvent() { - // Wire the document loaded event of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to occur when a PDF document is loaded. + // Wire the document loaded event of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to occur when a PDF document is loaded. PdfViewer.DocumentLoaded += OnDocumentLoaded; } @@ -43,7 +43,7 @@ private void OnDocumentLoaded(object sender, EventArgs e) {% endtabs %} ## AnnotationsLoaded event -The [AnnotationsLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationsLoaded) event occurs after all annotations in the PDF have finished loading, either when the document is opened or when annotations are imported. The `AnnotationsLoaded` event fires after the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event, once all annotations are fully available in the viewer. You can use this event to perform actions once annotations are fully available in the viewer. +The [AnnotationsLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationsLoaded) event occurs after all annotations in the PDF have finished loading, either when the document is opened or when annotations are imported. The `AnnotationsLoaded` event fires after the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event, once all annotations are fully available in the viewer. You can use this event to perform actions once annotations are fully available in the viewer. The following example explains how to wire and handle the event. {% tabs %} @@ -51,7 +51,7 @@ The following example explains how to wire and handle the event. void WireAnnotationsLoadedEvent() { - // Wire the annotations loaded event of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). + // Wire the annotations loaded event of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). PdfViewer.AnnotationsLoaded += OnAnnotationsLoaded; } diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md index 5f81f1d590..6e9aa5289c 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Comment.md @@ -19,7 +19,7 @@ The PDF Viewer control provides options to add, edit, and delete comments for th 7. Signature annotation ## Showing or hiding the comment panel -The built-in Comment Panel in the PDF Viewer displays annotation comments. You can show or hide this panel using the [IsCommentsPanelVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsCommentsPanelVisible) property. The default value of this property is false. +The built-in Comment Panel in the PDF Viewer displays annotation comments. You can show or hide this panel using the [IsCommentsPanelVisible](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsCommentsPanelVisible) property. The default value of this property is false. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md index 0680e65c08..df57d26bef 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Annotations-Overview.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify annotations in PDF documents. Annotations are useful for marking up document content — for example, highlighting important text, drawing shapes to indicate areas of interest, adding sticky notes for reviewer comments, or stamping a document with a status indicator. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify annotations in PDF documents. Annotations are useful for marking up document content — for example, highlighting important text, drawing shapes to indicate areas of interest, adding sticky notes for reviewer comments, or stamping a document with a status indicator. This section covers the annotation types and common functionalities available in the PDF Viewer. For detailed instructions on each annotation type, refer to the individual sections listed below. @@ -20,7 +20,7 @@ To learn how to work with annotations, you can also check out our video tutorial ## Supported annotation types -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the following annotation types, grouped by category. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the following annotation types, grouped by category. ### Text markup annotations diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md b/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md index dc38f98042..405f75e334 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Coordinates-Conversion.md @@ -14,11 +14,11 @@ PDF Viewer allows users to obtain the PDF page coordinates relative to the PDF V ## Client rectangle -The [ClientRectangle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) in the MAUI PdfViewer control is a rectangular area that represents the dimensions of the client area or viewport. The client area denotes the visible portion of the PDF document within the control. In the MAUI PDF Viewer, this client rectangle is illustrated by the red rectangle in the following figure. +The [ClientRectangle](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) in the MAUI PdfViewer control is a rectangular area that represents the dimensions of the client area or viewport. The client area denotes the visible portion of the PDF document within the control. In the MAUI PDF Viewer, this client rectangle is illustrated by the red rectangle in the following figure. -![Client rectangle in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Client-Coordinates.png) +![Client rectangle in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Client-Rectangle.png) -The client rectangle can be obtained by the [ClientRectangle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) property of the PDF Viewer. The following code sample explains the same. +The client rectangle can be obtained by the [ClientRectangle](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClientRectangle) property of the PDF Viewer. The following code sample explains the same. {% tabs %} {% highlight c# %} @@ -31,11 +31,11 @@ Rect clientRectangle = PdfViewer.ClientRectangle; The MAUI PDF Viewer specifies the position of points in the client area (viewport) using client coordinates. The upper-left corner of the client area (viewport) of the control is the origin for client coordinates. The client coordinates in the MAUI PDF Viewer are shown in the following figure. -![Client coordinates in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Client-Coordinates.png) +![Client coordinates in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Client-Coordinates.png) ### Get the page number from a client point -You can obtain the page number of the client point using the [GetPageNumberFromClientPoint(Point clientPoint)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GetPageNumberFromClientPoint_Microsoft_Maui_Graphics_Point_) method by passing the client point as an input parameter. The following code sample explains how to get the page number from the client point. +You can obtain the page number of the client point using the [GetPageNumberFromClientPoint(Point clientPoint)](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GetPageNumberFromClientPoint_Microsoft_Maui_Graphics_Point_) method by passing the client point as an input parameter. The following code sample explains how to get the page number from the client point. {% tabs %} {% highlight c# %} @@ -57,14 +57,14 @@ private void PdfViewer_Tapped(object sender, GestureEventArgs e) PDF page coordinates are represented in terms of a device-independent coordinate system called user space, which is independent of the output device that will be used for printing or display. The user space coordinates system is initialized to a default state for each page of a PDF document. The length of a unit is 1/72 inch, which is equivalent to one point (pt). As an example, the dimensions of a letter-sized paper in PDF page coordinates are shown in the diagram below. -![Page coordinates in .NET MAUI PDF Viewer](Images\Coordinates-Conversion\Page-Coordinates.png) +![Page coordinates in .NET MAUI PDF Viewer](Images/Coordinates-Conversion/Page-Coordinates.png) ## Scroll coordinates Scroll coordinates in the MAUI PDF Viewer denote pixel-based positions as pages are scrolled. They indicate precise locations within the entire document. The coordinate system originates from the top-left corner of the visible area. ## Convert PDF Viewer's coordinates to PDF page coordinates -You can obtain the PDF page coordinates using the [ConvertClientPointToPagePoint(clientPoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertClientPointToPagePoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the client point and page number as input parameters. The following code sample explains how to convert a tapped client area position to a page point. +You can obtain the PDF page coordinates using the [ConvertClientPointToPagePoint(clientPoint, pageNumber)](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertClientPointToPagePoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the client point and page number as input parameters. The following code sample explains how to convert a tapped client area position to a page point. {% tabs %} {% highlight c# %} @@ -86,11 +86,11 @@ private void PdfViewer_Tapped(object sender, GestureEventArgs e) ## Convert PDF page coordinates to PDF Viewer's coordinates -You can obtain the PDF Viewer's coordinates using the [ConvertPagePointToClientPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToClientPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code sample explains how to convert a square annotation's position in the page coordinates to a client point. +You can obtain the PDF Viewer's coordinates using the [ConvertPagePointToClientPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToClientPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code sample explains how to convert a square annotation's position in the page coordinates to a client point. {% tabs %} {% highlight c# %} -// Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. +// Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection annotations = PdfViewer.Annotations; // Obtain the first annotation in the annotation collection. @@ -113,11 +113,11 @@ if (annotation is SquareAnnotation squareAnnotation) ## Convert PDF page coordinates to scroll coordinates -You can obtain the PDF Viewer's scroll coordinates using the [ConvertPagePointToScrollPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToScrollPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code example explains how to convert a square annotation's position in the page coordinates to a scroll point. +You can obtain the PDF Viewer's scroll coordinates using the [ConvertPagePointToScrollPoint(pagePoint, pageNumber)](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ConvertPagePointToScrollPoint_Microsoft_Maui_Graphics_Point_System_Int32_) method by passing the page point and page number as input parameters. The following code example explains how to convert a square annotation's position in the page coordinates to a scroll point. {% tabs %} {% highlight c# %} -// Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. +// Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection annotations = PdfViewer.Annotations; // Obtain the first annotation in the annotation collection. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md b/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md index 3e6f0d14b1..d387635191 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Custom-Bookmark.md @@ -14,7 +14,7 @@ PDF documents can include custom bookmarks that allow the user to bookmark pages ## Showing or hiding the custom bookmarks pane -The built-in custom bookmark view of the PDF Viewer displays the custom bookmarks and can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. +The built-in custom bookmark view of the PDF Viewer displays the custom bookmarks and can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. {% tabs %} {% highlight XAML %} @@ -31,7 +31,7 @@ pdfViewer.IsOutlineViewVisible = true; ## Accessing the Custom Bookmarks Collection -To retrieve the list of custom bookmarks in a PDF document, use the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) property. +To retrieve the list of custom bookmarks in a PDF document, use the [CustomBookmarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) property. {% tabs %} {% highlight c# %} @@ -43,7 +43,7 @@ var customBookmarks = pdfViewer.CustomBookmarks; ## Add, rename, and remove custom bookmarks -You can manage custom bookmarks in the PDF viewer using the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. This property allows you to add, rename, or remove bookmarks that appear in the viewer's bookmark pane. +You can manage custom bookmarks in the PDF viewer using the [CustomBookmarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. This property allows you to add, rename, or remove bookmarks that appear in the viewer's bookmark pane. ### Add custom bookmarks @@ -57,7 +57,7 @@ Use the floating action button in the bookmark pane to add a custom bookmark. #### Add Programmatically -Create a new instance of the Bookmark class and add it to the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection: +Create a new instance of the Bookmark class and add it to the [CustomBookmarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection: {% tabs %} {% highlight c# %} @@ -75,7 +75,7 @@ pdfViewer.CustomBookmarks.Add(newBookmark); #### Track Bookmark Additions -To track when a custom bookmark is added, subscribe to the [CollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.collectionchanged?view=net-9.0) event of the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection inside the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler. +To track when a custom bookmark is added, subscribe to the [CollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.collectionchanged?view=net-9.0) event of the [CustomBookmarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection inside the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler. Within the [CollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.collectionchanged?view=net-9.0) event handler, use the [NotifyCollectionChangedAction](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.notifycollectionchangedaction?view=net-9.0) enumeration to determine the type of change. If the action is `Add`, iterate through `e.NewItems` to access the newly added bookmarks and perform any necessary tracking or logging. {% tabs %} @@ -123,7 +123,7 @@ To rename a custom bookmark from the UI: #### Rename Programmatically -To rename an existing custom bookmark, retrieve it from the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection and update its Name property: +To rename an existing custom bookmark, retrieve it from the [CustomBookmarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection and update its Name property: {% tabs %} {% highlight c# %} @@ -177,7 +177,7 @@ private void Bookmark_PropertyChanged(object? sender, PropertyChangedEventArgs e ##### For Existing Bookmarks -To track rename changes for bookmarks that already exist when the document is loaded, wire the [PropertyChanged](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged.propertychanged?view=net-9.0#system-componentmodel-inotifypropertychanged-propertychanged) event for each bookmark in the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler: +To track rename changes for bookmarks that already exist when the document is loaded, wire the [PropertyChanged](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged.propertychanged?view=net-9.0#system-componentmodel-inotifypropertychanged-propertychanged) event for each bookmark in the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler: {% tabs %} {% highlight c# %} @@ -220,7 +220,7 @@ To remove a custom bookmark from the UI: #### Remove Programmatically -To remove a custom bookmark programmatically, retrieve it from the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection and remove it: +To remove a custom bookmark programmatically, retrieve it from the [CustomBookmarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection and remove it: {% tabs %} {% highlight c# %} @@ -236,7 +236,7 @@ if (bookmarkToRemove != null) #### Track Bookmark Removal -To track when a custom bookmark is removed, handle the [CollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.collectionchanged?view=net-9.0) event of the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. Use the [NotifyCollectionChangedAction](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.notifycollectionchangedaction?view=net-9.0) enum to check if the action is `Remove`. If so, iterate through `e.OldItems` to access the removed bookmarks: +To track when a custom bookmark is removed, handle the [CollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.collectionchanged?view=net-9.0) event of the [CustomBookmarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. Use the [NotifyCollectionChangedAction](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.notifycollectionchangedaction?view=net-9.0) enum to check if the action is `Remove`. If so, iterate through `e.OldItems` to access the removed bookmarks: {% tabs %} {% highlight c# %} @@ -265,7 +265,7 @@ You can navigate to custom bookmarks either through the UI or programmatically u ### Navigate using UI To navigate using the UI: -1. Ensure the outline view is visible by setting the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property to `true`. +1. Ensure the outline view is visible by setting the [IsOutlineViewVisible](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property to `true`. 2. Once the outline view is displayed, tap on any custom bookmark to navigate to the corresponding page. ![Custom bookmark in .NET MAUI PDF Viewer](Images\custom-bookmark.png) @@ -274,7 +274,7 @@ N>A custom bookmark currently stores only the target page information. It does n ### 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. +To navigate to a custom bookmark programmatically, use the [GoToBookmark](https://help.syncfusion.com/cr/document-processing/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. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md b/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md index 412b046a14..c91e078894 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Document-Link-Annotations.md @@ -18,7 +18,7 @@ N> Document link annotations differ from hyperlink annotations. Document links n ## Enable or disable document link navigation -The document link navigation can be turned on or off using the [EnableDocumentLinkNavigation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableDocumentLinkNavigation) property. The default value of this property is `true`. The code snippet below illustrates disabling the document link navigation. +The document link navigation can be turned on or off using the [EnableDocumentLinkNavigation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableDocumentLinkNavigation) property. The default value of this property is `true`. The code snippet below illustrates disabling the document link navigation. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md b/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md index 1b5f20b2a8..7f16ac10d9 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Document-Outline.md @@ -14,7 +14,7 @@ A PDF document may optionally have a document outline (also called bookmarks) wh ## Showing / hiding the outline view -The PDF Viewer's built-in outline view, which displays the document outline in a tree-like structure, can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. +The PDF Viewer's built-in outline view, which displays the document outline in a tree-like structure, can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. The default value of this property is `false`. {% tabs %} {% highlight XAML %} @@ -31,7 +31,7 @@ pdfViewer.IsOutlineViewVisible = true; ## Accessing outline elements -To access the document outline and its elements, you can use the [DocumentOutline](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentOutline) property. This property provides a list of outline elements. +To access the document outline and its elements, you can use the [DocumentOutline](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentOutline) property. This property provides a list of outline elements. {% tabs %} {% highlight c# %} @@ -43,7 +43,7 @@ var documentOutline = pdfViewer.DocumentOutline; ## Accessing nested child elements -The outline elements nested within each outline element can be accessed from the [OutlineElement.Children](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.OutlineElement.html#Syncfusion_Maui_PdfViewer_OutlineElement_Children) property. The following code snippet illustrates accessing the third element in the document outline and then accessing its fourth child (using zero-based indexing). +The outline elements nested within each outline element can be accessed from the [OutlineElement.Children](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.OutlineElement.html#Syncfusion_Maui_PdfViewer_OutlineElement_Children) property. The following code snippet illustrates accessing the third element in the document outline and then accessing its fourth child (using zero-based indexing). {% tabs %} {% highlight c# %} @@ -58,13 +58,13 @@ OutlineElement nestedElement = outlineElement.Children[3]; ### Navigating using the UI -After showing the outline view using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property as described above, you can tap on any element to navigate to the destination pointed to by that element. +After showing the outline view using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property as described above, you can tap on any element to navigate to the destination pointed to by that element. ![Document outline in .NET MAUI PDF Viewer](Images/outline-view.png) ### Navigating programmatically -The PDF Viewer allows users to navigate to an outline element using the [GoToOutlineElement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToOutlineElement_Syncfusion_Maui_PdfViewer_OutlineElement_) method. The following code snippet illustrates how to navigate to an outline element. +The PDF Viewer allows users to navigate to an outline element using the [GoToOutlineElement](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToOutlineElement_Syncfusion_Maui_PdfViewer_OutlineElement_) method. The following code snippet illustrates how to navigate to an outline element. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md b/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md index d2974239e9..416590f6a1 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/DocumentLoadNotifications.md @@ -10,11 +10,11 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Document Load Events in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) and [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) events to notify whether the document has been opened and displayed in the view or not. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) and [DocumentLoadFailed](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) events to notify whether the document has been opened and displayed in the view or not. ## Document loaded event -The [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event triggers after the document is loaded in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). Refer to the following code example: +The [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event triggers after the document is loaded in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). Refer to the following code example: {% tabs %} {% highlight XAML hl_lines="3" %} @@ -49,18 +49,18 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs e) ## Document load failures -When a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event notifies the application with a context-specific error message. This event helps developers identify the cause of the failure and implement custom error handling for a smoother user experience. +When a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), the [DocumentLoadFailed](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event notifies the application with a context-specific error message. This event helps developers identify the cause of the failure and implement custom error handling for a smoother user experience. ### Document load failed event -The [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event alerts users when a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) due to one of the following conditions: +The [DocumentLoadFailed](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event alerts users when a document fails to load in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) due to one of the following conditions: * A corrupted document is loaded. * A password-protected document is provided with an invalid or empty password. * A non-PDF file is loaded. * The document contains an XFA form, which is currently unsupported. * Exceptions occur during PDF loading or page rendering due to limitations or issues in platform-specific native PDF renderers. -The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) returns the error [Message](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Message) and [Exception](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Exception) details for the failure. The following code example explains how to handle the event. +The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) returns the error [Message](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Message) and [Exception](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Exception) details for the failure. The following code example explains how to handle the event. {% tabs %} {% highlight XAML hl_lines="3" %} @@ -82,7 +82,7 @@ private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEvent ### Handling document load failures -By default, the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) displays its own error message when a document fails to load. If you prefer to handle the failure at the application level with custom logic instead, set the [Handled](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Handled) property of the [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) to `true` to suppress the control's default error messages and implement your own handling using the error information. +By default, the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) displays its own error message when a document fails to load. If you prefer to handle the failure at the application level with custom logic instead, set the [Handled](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Handled) property of the [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html) to `true` to suppress the control's default error messages and implement your own handling using the error information. {% tabs %} {% highlight XAML hl_lines="3" %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md index 89a7226654..99002b406c 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Collection.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Form Fields Collection in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer.FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) property provides access to all form fields present in the loaded PDF document. The collection is available after the document finishes loading and can be accessed from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event. For a broader overview of form-filling support, see [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview). +The [SfPdfViewer.FormFields](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) property provides access to all form fields present in the loaded PDF document. The collection is available after the document finishes loading and can be accessed from the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event. For a broader overview of form-filling support, see [Form Filling Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-overview). ## Accessing the FormFields collection @@ -34,7 +34,7 @@ private void OnDocumentLoaded(object sender, EventArgs e) ## Retrieve a specific form field by name -You can retrieve a specific form field from the collection by filtering on the [Name](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_Name) property. The following example retrieves a text form field whose name is `name`. +You can retrieve a specific form field from the collection by filtering on the [Name](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_Name) property. The following example retrieves a text form field whose name is `name`. {% tabs %} {% highlight c# %} @@ -49,7 +49,7 @@ if (formField is TextFormField nameTextBox) ## Restrict form field editing -Form fields can be prevented from being modified by setting the [ReadOnly](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_ReadOnly) property to `true`. The following example makes all form fields read-only. +Form fields can be prevented from being modified by setting the [ReadOnly](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_ReadOnly) property to `true`. The following example makes all form fields read-only. {% tabs %} {% highlight c# %} @@ -63,7 +63,7 @@ foreach (FormField formField in PdfViewer.FormFields) ## Clear form data -The [ClearFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClearFormData_System_Int32_) method clears the data in all form fields in the PDF document. +The [ClearFormData](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ClearFormData_System_Int32_) method clears the data in all form fields in the PDF document. {% tabs %} {% highlight c# %} @@ -83,7 +83,7 @@ PdfViewer.ClearFormData(2); ## Attach custom data to a form field -The [CustomData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_CustomData) property allows you to store additional reference information for any form field instance. This data is for application use only and is not displayed or saved in the PDF document. To use this example, wire the `FormFieldValueChanged` event of the `SfPdfViewer` (for more details, see [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events)). +The [CustomData](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_CustomData) property allows you to store additional reference information for any form field instance. This data is for application use only and is not displayed or saved in the PDF document. To use this example, wire the `FormFieldValueChanged` event of the `SfPdfViewer` (for more details, see [Form Field Events](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/form-filling-events)). The following example stores the modification timestamp for a form field whenever its value changes. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md index ad67c14cdf..9dc7dec434 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Customization.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Customize form fields in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to customize the visual appearance of form fields by modifying properties on their [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) objects. A form field can have one or more `Widget` instances (the visual representations of the field on the page). You can change the background color, foreground (text) color, border color, and border width. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to customize the visual appearance of form fields by modifying properties on their [Widget](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Widget.html) objects. A form field can have one or more `Widget` instances (the visual representations of the field on the page). You can change the background color, foreground (text) color, border color, and border width. N> * Appearance customizations support undo and redo. N> * Customizations cannot be applied when a form field is locked. For details, see [Lock and Unlock Form Fields](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/lock-unlock). @@ -18,7 +18,7 @@ N> * Customized colors and border width are preserved during import, export, pri ## Customize the background color -The [BackgroundColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html#Syncfusion_Maui_PdfViewer_Widget_BackgroundColor) property sets the fill color behind the field content. The following example applies a uniform background color to all form fields in the document. +The [BackgroundColor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Widget.html#Syncfusion_Maui_PdfViewer_Widget_BackgroundColor) property sets the fill color behind the field content. The following example applies a uniform background color to all form fields in the document. {% tabs %} {% highlight c# %} @@ -92,7 +92,7 @@ foreach (FormField formField in PdfViewer.FormFields) ## Detect widget property changes -In addition to setting widget properties, you can also track when a widget property changes at runtime. The `PropertyChanged` event on a [Widget](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Widget.html) fires whenever a widget property — such as `BorderColor`, `BackgroundColor`, `BorderWidth`, or `ForegroundColor` — changes. Subscribe to this event after the document loads. +In addition to setting widget properties, you can also track when a widget property changes at runtime. The `PropertyChanged` event on a [Widget](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Widget.html) fires whenever a widget property — such as `BorderColor`, `BackgroundColor`, `BorderWidth`, or `ForegroundColor` — changes. Subscribe to this event after the document loads. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md index 8529a57802..7e90cf2d4c 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Events.md @@ -10,16 +10,16 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Form Field Events in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) exposes events that allow you to track and respond to user interactions with form fields. The following table summarizes the available events: +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) exposes events that allow you to track and respond to user interactions with form fields. The following table summarizes the available events: | Event | Description | |---|---| -| [FormFieldValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged) | Raised when the value of a form field changes. | -| [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) | Raised when a text or signature field gains or loses focus. | +| [FormFieldValueChanged](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged) | Raised when the value of a form field changes. | +| [FormFieldFocusChanged](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) | Raised when a text or signature field gains or loses focus. | ## Detect value changes -The [FormFieldValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged) event is raised whenever the value of a form field changes. You can use the [OldValue](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldValueChangedEventArgs_OldValue) and [NewValue](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldValueChangedEventArgs_NewValue) properties of [FormFieldValueChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html) to read the before and after values. +The [FormFieldValueChanged](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged) event is raised whenever the value of a form field changes. You can use the [OldValue](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldValueChangedEventArgs_OldValue) and [NewValue](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldValueChangedEventArgs_NewValue) properties of [FormFieldValueChangedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormFieldValueChangedEventArgs.html) to read the before and after values. Subscribe to the event in XAML: @@ -50,7 +50,7 @@ N> The `OldValue` and `NewValue` types vary by field type. For a checkbox, cast ## Detect focus changes -The [FormFieldFocusChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) event is raised when a text or signature field gains or loses focus. This event is raised only for text and signature form fields. Use the [HasFocus](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldFocusChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldFocusChangedEventArgs_HasFocus) property of the [FormFieldFocusChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormFieldFocusChangedEventArgs.html) to determine whether the field is being focused or unfocused. +The [FormFieldFocusChanged](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldFocusChanged) event is raised when a text or signature field gains or loses focus. This event is raised only for text and signature form fields. Use the [HasFocus](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormFieldFocusChangedEventArgs.html#Syncfusion_Maui_PdfViewer_FormFieldFocusChangedEventArgs_HasFocus) property of the [FormFieldFocusChangedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormFieldFocusChangedEventArgs.html) to determine whether the field is being focused or unfocused. Subscribe to the event in XAML: diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md index 86ce0c2546..fffab55f5a 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Import-Export.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Import and Export Form Data in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to import form data into a PDF document and export filled form data from it. This is useful for pre-populating forms, backing up responses, or transferring data between systems. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to import form data into a PDF document and export filled form data from it. This is useful for pre-populating forms, backing up responses, or transferring data between systems. ## Supported data formats @@ -23,13 +23,13 @@ The following formats are supported for both import and export: | JSON | Syncfusion-specific format for structured form data exchange across Syncfusion PDF viewers (WPF, Flutter, JavaScript, etc.). | | XML | Syncfusion-specific format for hierarchical form data exchange across Syncfusion PDF viewers (WPF, Flutter, JavaScript, etc.). | -The required format can be selected from the [DataFormat](https://help.syncfusion.com/cr/maui/Syncfusion.Pdf.Parsing.DataFormat.html) enumeration. +The required format can be selected from the [DataFormat](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Parsing.DataFormat.html) enumeration. N> XFDF and FDF are standard formats compatible with global PDF viewers. JSON and XML are Syncfusion-specific formats for cross-platform use within Syncfusion products only. ## Import form data -Use the [ImportFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportFormData_System_IO_Stream_Syncfusion_Pdf_Parsing_DataFormat_System_Boolean_) method to populate form fields from an external data file. Pass the file stream and the data format as parameters. +Use the [ImportFormData](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportFormData_System_IO_Stream_Syncfusion_Pdf_Parsing_DataFormat_System_Boolean_) method to populate form fields from an external data file. Pass the file stream and the data format as parameters. The following example imports form data from an XFDF file stored in the application's data directory. @@ -61,9 +61,9 @@ void ImportFormDataWithOnError() ## Export form data -Use the [ExportFormData](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportFormData_System_IO_Stream_Syncfusion_Pdf_Parsing_DataFormat_) method to write the current form field values to a file. Pass an empty writable stream and the desired format. +Use the [ExportFormData](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportFormData_System_IO_Stream_Syncfusion_Pdf_Parsing_DataFormat_) method to write the current form field values to a file. Pass an empty writable stream and the desired format. -The following example exports form data to an XFDF file in the application's data directory. Ensure the PDF document is loaded before exporting — call `ExportFormData` from the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler. +The following example exports form data to an XFDF file in the application's data directory. Ensure the PDF document is loaded before exporting — call `ExportFormData` from the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler. First, wire the `DocumentLoaded` event after loading the document: diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md index b495b3ea1b..515882e601 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Overview.md @@ -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](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) API. +The .NET MAUI PDF Viewer [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/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. For saving filled forms, see [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document). @@ -28,7 +28,7 @@ The viewer supports saving filled forms, flattening form fields to make them non ## XFA forms -The PDF Viewer supports only AcroForms. PDF documents that contain an XFA form cannot be loaded in the PDF Viewer. When you attempt to load a PDF with an XFA form, the [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event is raised. +The PDF Viewer supports only AcroForms. PDF documents that contain an XFA form cannot be loaded in the PDF Viewer. When you attempt to load a PDF with an XFA form, the [DocumentLoadFailed](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event is raised. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Show-Hide.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Show-Hide.md index 67fec5269c..1c3300e283 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Show-Hide.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Show-Hide.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Show and Hide Form Fields in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to control the visibility of form fields using the `IsHidden` property. This is useful when you need to hide fields containing confidential data before sharing or presenting a document, or to reduce visual clutter in forms with many fields. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to control the visibility of form fields using the `IsHidden` property. This is useful when you need to hide fields containing confidential data before sharing or presenting a document, or to reduce visual clutter in forms with many fields. N> * Hiding and showing form fields supports undo and redo. N> * A form field that is locked cannot be hidden. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Validation.md b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Validation.md index c0a3885d72..67aabe53dc 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Validation.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Form-Filling-Validation.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Form Data Validation in .NET MAUI PDF Viewer (SfPdfViewer) -Before saving a filled PDF form, you may want to validate that all required fields contain acceptable values. Validation is performed by iterating the [FormFields](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) collection, checking each field's value against your rules, and only proceeding with save if all criteria are met. +Before saving a filled PDF form, you may want to validate that all required fields contain acceptable values. Validation is performed by iterating the [FormFields](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFields) collection, checking each field's value against your rules, and only proceeding with save if all criteria are met. ## Validation example diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md index eff456741b..9929f1786a 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Free-Text.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Free Text Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify free text annotations in the PDF document. This is useful for adding text notes, comments, or feedback to the PDF pages. This section explains the functions available in the PDF Viewer for working with free text annotations. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify free text annotations in the PDF document. This is useful for adding text notes, comments, or feedback to the PDF pages. This section explains the functions available in the PDF Viewer for working with free text annotations. ## Add free text annotations @@ -32,10 +32,10 @@ The following image represents how to add the free text annotation using the too You can add free text annotation to a PDF document by tapping with a touch (or mouse down) on a PDF page. The following steps explain how to add free text annotation in a PDF. -1. Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html) property of the SfPdfViewer to [FreeText](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_FreeText). It activates the free text annotation mode. +1. Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html) property of the SfPdfViewer to [FreeText](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_FreeText). It activates the free text annotation mode. 2. Tap (or mouse down) on a PDF page, where you want to add the free text annotation. This will add a text box with a default style and allow you to write your text inline on the Desktop platforms. In mobile, a popup will be displayed to write and submit the text. 3. You can add multiple free text annotations in this mode in a similar manner. -4. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). It will disable the annotation mode. +4. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html) to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). It will disable the annotation mode. 5. You can later select and edit the annotations if required. The following code explains how to enable the free text annotation mode. @@ -45,7 +45,7 @@ The following code explains how to enable the free text annotation mode. // Enable or activate the free text mode. void EnableFreetextMode() { - // Set the annotation mode to FreeText using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the annotation mode to FreeText using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationMode = AnnotationMode.FreeText; } {% endhighlight %} @@ -58,7 +58,7 @@ Similarly, refer to the following code to disable the free text annotation mode. // Disable or deactivate the free text mode. void DisableFreetextMode() { - // Set the annotation mode to none using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the annotation mode to none using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationMode = AnnotationMode.None; } {% endhighlight %} @@ -66,7 +66,7 @@ void DisableFreetextMode() ### Add annotations programmatically -You can create and add a free text annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a free text annotation and add it to the first page of a PDF document. +You can create and add a free text annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a free text annotation and add it to the first page of a PDF document. {% tabs %} {% highlight C# %} @@ -102,7 +102,7 @@ void AddFreeTextAnnotation() ## Free text annotation settings -In the free text annotation mode, the annotation will be added with a default appearance. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance before adding free text annotation on the document, you can change its default settings using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). For that, you need to obtain the default free text annotation settings. +In the free text annotation mode, the annotation will be added with a default appearance. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance before adding free text annotation on the document, you can change its default settings using the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). For that, you need to obtain the default free text annotation settings. The following example explains how to obtain the default free text annotation settings and modify some of its properties. Similarly, you can modify all the other properties. @@ -110,7 +110,7 @@ The following example explains how to obtain the default free text annotation se {% highlight C# %} void CustomizeDefaultFreeTextSettings() { - // Obtain the default free text annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the default free text annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. FreeTextAnnotationSettings freeTextSettings = PdfViewer.AnnotationSettings.FreeText; // Modify the default appearance properties. @@ -126,7 +126,7 @@ void CustomizeDefaultFreeTextSettings() ### Create a free text annotation without a border -The PDF Viewer allows you to customize annotation properties using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property. By default, free text annotations include a visible border. To create a free text annotation without a border, set the [BorderWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FreeTextAnnotationSettings.html#Syncfusion_Maui_PdfViewer_FreeTextAnnotationSettings_BorderWidth) property to 0 using the [FreeTextAnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FreeTextAnnotationSettings.html#properties). +The PDF Viewer allows you to customize annotation properties using the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property. By default, free text annotations include a visible border. To create a free text annotation without a border, set the [BorderWidth](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FreeTextAnnotationSettings.html#Syncfusion_Maui_PdfViewer_FreeTextAnnotationSettings_BorderWidth) property to 0 using the [FreeTextAnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FreeTextAnnotationSettings.html#properties). The following example demonstrates how to create a free text annotation without a border: @@ -153,7 +153,7 @@ Double-tapping the selected free text annotation will allow you to edit its text ### Edit free text annotation properties programmatically -You can also edit the properties of the selected free text annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected free text annotation. Similarly, you can modify the other free text properties. +You can also edit the properties of the selected free text annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected free text annotation. Similarly, you can modify the other free text properties. {% tabs %} {% highlight C# %} @@ -180,7 +180,7 @@ void EditSelectedFreeTextAnnotation(Annotation selectedAnnotation) ## Free text modal view -The free text modal view appears when text needs to be input by the user for creating and editing free text annotations in Android and iOS platforms. The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) notifies when the modal view is appearing and disappearing through events. The events help you in hiding and showing elements that are part of the app UI that are not necessary as long as the modal view is visible. +The free text modal view appears when text needs to be input by the user for creating and editing free text annotations in Android and iOS platforms. The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) notifies when the modal view is appearing and disappearing through events. The events help you in hiding and showing elements that are part of the app UI that are not necessary as long as the modal view is visible. ![Free text modal view](Images/Annotations/free-text-modal-view.png) @@ -216,7 +216,7 @@ private void PdfViewer_FreeTextModalViewDisappearing(object? sender, EventArgs e ### Suppressing the free text modal view and implementing your own UI -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the free text modal view and use your own UI in its place. This can be achieved by setting the [AnnotationModalViewAppearingEventArgs.Cancel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ModalViewAppearingEventArgs.html#Syncfusion_Maui_PdfViewer_ModalViewAppearingEventArgs_Cancel) property to `true` in the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) event handler. The `ShowCustomDialog()` and `customDialog.Text` used in the sample below are user-defined and must be implemented by the developer. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the free text modal view and use your own UI in its place. This can be achieved by setting the [AnnotationModalViewAppearingEventArgs.Cancel](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ModalViewAppearingEventArgs.html#Syncfusion_Maui_PdfViewer_ModalViewAppearingEventArgs_Cancel) property to `true` in the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) event handler. The `ShowCustomDialog()` and `customDialog.Text` used in the sample below are user-defined and must be implemented by the developer. The following code snippet illustrates suppressing the free text modal view and using a UI implemented in the app in its place. The free text annotation instance that is created or edited can be obtained from the event args. Once the user enters the text in the custom dialog and confirms, the text can be assigned to this free text annotation instance. @@ -247,7 +247,7 @@ private void customDialogOkButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} -N> For WinUI and MacCatalyst platforms, there is no separate modal view to receive text input from the users. As a result, the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) and [FreeTextModalViewDisappearing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewDisappearing) events are not applicable for these platforms. +N> For WinUI and MacCatalyst platforms, there is no separate modal view to receive text input from the users. As a result, the [FreeTextModalViewAppearing](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewAppearing) and [FreeTextModalViewDisappearing](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FreeTextModalViewDisappearing) events are not applicable for these platforms. ## See Also diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Gesture-Events.md b/Document-Processing/PDF/PDF-Viewer/maui/Gesture-Events.md index 3aa7d3d0f1..d3990e095d 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Gesture-Events.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Gesture-Events.md @@ -12,8 +12,8 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne ## Tapped event -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) provides a [Tapped](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Tapped) event that occurs when a tap gesture is detected in the control and allows you to perform custom actions when a tap occurs. This event provides information about the page number and position at the tapped location through the [GestureEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.GestureEventArgs.html). -The following code example demonstrates how to subscribe to the [Tapped](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Tapped) event. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) provides a [Tapped](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Tapped) event that occurs when a tap gesture is detected in the control and allows you to perform custom actions when a tap occurs. This event provides information about the page number and position at the tapped location through the [GestureEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.GestureEventArgs.html). +The following code example demonstrates how to subscribe to the [Tapped](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Tapped) event. {% tabs %} {% highlight xaml %} @@ -26,7 +26,7 @@ PdfViewer.Tapped += PdfViewer_Tapped; {% endhighlight %} {% endtabs %} -In the above example, the `PdfViewer_Tapped` method is registered as the event handler for the Tapped event of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The `PdfViewer_Tapped` method will be invoked whenever a tap occurs on the PDF Viewer. You can handle the custom action in the method as demonstrated in the following code example. +In the above example, the `PdfViewer_Tapped` method is registered as the event handler for the Tapped event of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The `PdfViewer_Tapped` method will be invoked whenever a tap occurs on the PDF Viewer. You can handle the custom action in the method as demonstrated in the following code example. {% tabs %} {% highlight c# %} @@ -39,13 +39,13 @@ private void PdfViewer_Tapped(object sender, GestureEventArgs e) ### GestureEventArgs -The [GestureEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.GestureEventArgs.html) provides information available on the tapped location, and it includes the following properties. +The [GestureEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.GestureEventArgs.html) provides information available on the tapped location, and it includes the following properties. -1. [PageNumber](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.GestureEventArgs.html#Syncfusion_Maui_PdfViewer_GestureEventArgs_PageNumber) – This property returns the page number on which the tap took place. The value ranges from 1 to the total number of pages in the PDF document. If the tap occurs outside of any PDF page boundaries, the result will be -1. -2. [PagePosition](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.GestureEventArgs.html#Syncfusion_Maui_PdfViewer_GestureEventArgs_PagePosition) – The property returns the page’s tapped position in the PDF coordinates. The coordinates have their origin at the top-left of the page. The number of the tapped page is identified by the [PageNumber](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.GestureEventArgs.html#Syncfusion_Maui_PdfViewer_GestureEventArgs_PageNumber) property. If the tap occurs outside of any PDF page boundaries, the result will be (-1, -1). -3. [Position](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.GestureEventArgs.html#Syncfusion_Maui_PdfViewer_GestureEventArgs_Position) – This property returns the tapped position on the PDF Viewer control. The coordinate space starts at the top left of the control. +1. [PageNumber](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.GestureEventArgs.html#Syncfusion_Maui_PdfViewer_GestureEventArgs_PageNumber) – This property returns the page number on which the tap took place. The value ranges from 1 to the total number of pages in the PDF document. If the tap occurs outside of any PDF page boundaries, the result will be -1. +2. [PagePosition](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.GestureEventArgs.html#Syncfusion_Maui_PdfViewer_GestureEventArgs_PagePosition) – The property returns the page’s tapped position in the PDF coordinates. The coordinates have their origin at the top-left of the page. The number of the tapped page is identified by the [PageNumber](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.GestureEventArgs.html#Syncfusion_Maui_PdfViewer_GestureEventArgs_PageNumber) property. If the tap occurs outside of any PDF page boundaries, the result will be (-1, -1). +3. [Position](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.GestureEventArgs.html#Syncfusion_Maui_PdfViewer_GestureEventArgs_Position) – This property returns the tapped position on the PDF Viewer control. The coordinate space starts at the top left of the control. -The following code example demonstrates how to retrieve information from the [GestureEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.GestureEventArgs.html) and handle the tapped event. +The following code example demonstrates how to retrieve information from the [GestureEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.GestureEventArgs.html) and handle the tapped event. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md b/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md index 9df2e8d005..e83edfe8fc 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Getting-Started.md @@ -82,7 +82,7 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma {% endhighlight %} {% endtabs %} -2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. +2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} @@ -157,7 +157,7 @@ xmlns:local="clr-namespace:PdfViewerExample" {% endhighlight %} {% endtabs %} -5. Set an instance of the `PdfViewerViewModel` class as the `BindingContext`. Bind the PDF viewer's [DocumentSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) to the `PdfDocumentStream` property of the `PdfViewerViewModel` class. +5. Set an instance of the `PdfViewerViewModel` class as the `BindingContext`. Bind the PDF viewer's [DocumentSource](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) to the `PdfDocumentStream` property of the `PdfViewerViewModel` class. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} @@ -169,8 +169,8 @@ xmlns:local="clr-namespace:PdfViewerExample" {% endhighlight %} {% 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. 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> 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/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +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/document-processing/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/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method. ## Step 6: Running the Application @@ -246,7 +246,7 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma {% endhighlight %} {% endtabs %} -2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. +2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} @@ -336,7 +336,7 @@ xmlns:local="clr-namespace:PdfViewerExample" {% endhighlight %} {% endtabs %} -5. Set an instance of the `PdfViewerViewModel` class as the `BindingContext`. Bind the PDF viewer's [DocumentSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) to the `PdfDocumentStream` property of the `PdfViewerViewModel` class. +5. Set an instance of the `PdfViewerViewModel` class as the `BindingContext`. Bind the PDF viewer's [DocumentSource](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) to the `PdfDocumentStream` property of the `PdfViewerViewModel` class. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} @@ -348,8 +348,8 @@ xmlns:local="clr-namespace:PdfViewerExample" {% endhighlight %} {% 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. 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> 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/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +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/document-processing/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/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method. ## Step 6: Running the Application @@ -432,7 +432,7 @@ xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Ma {% endhighlight %} {% endtabs %} -2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. +2. Add the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} @@ -519,7 +519,7 @@ xmlns:local="clr-namespace:PdfViewerExample" {% endhighlight %} {% endtabs %} -5. Set an instance of the `PdfViewerViewModel` class as the `BindingContext`. Bind the PDF viewer's [DocumentSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) to the `PdfDocumentStream` property of the `PdfViewerViewModel` class. +5. Set an instance of the `PdfViewerViewModel` class as the `BindingContext`. Bind the PDF viewer's [DocumentSource](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) to the `PdfDocumentStream` property of the `PdfViewerViewModel` class. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} @@ -531,8 +531,8 @@ xmlns:local="clr-namespace:PdfViewerExample" {% endhighlight %} {% 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. 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> 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/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +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/document-processing/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/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method. ## Step 6: Running the Application diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Hyperlink-Navigation.md b/Document-Processing/PDF/PDF-Viewer/maui/Hyperlink-Navigation.md index fe5e584f51..ffb25f11a2 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Hyperlink-Navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Hyperlink-Navigation.md @@ -10,11 +10,11 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Hyperlink navigation in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) lets you open URLs or website links in the default browser. When a user taps or clicks a hyperlink on a PDF page, the SfPdfViewer recognizes the link and prompts a hyperlink dialog asking the user if they want to open the link. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) lets you open URLs or website links in the default browser. When a user taps or clicks a hyperlink on a PDF page, the SfPdfViewer recognizes the link and prompts a hyperlink dialog asking the user if they want to open the link. ## Handling hyperlink navigation -The [HyperlinkClicked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_HyperlinkClicked) event occurs when a hyperlink is tapped or clicked and allows you to handle the hyperlink navigation at the application level in your own way. Set the [Handled](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.HyperlinkClickedEventArgs.html#Syncfusion_Maui_PdfViewer_HyperlinkClickedEventArgs_Handled) property of the [HyperlinkClickedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.HyperlinkClickedEventArgs.html) to `true` to suppress the default hyperlink dialog and handle your logic with the hyperlink information. The following example explains how to open a link directly in the system's default browser without confirmation prompts. +The [HyperlinkClicked](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_HyperlinkClicked) event occurs when a hyperlink is tapped or clicked and allows you to handle the hyperlink navigation at the application level in your own way. Set the [Handled](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.HyperlinkClickedEventArgs.html#Syncfusion_Maui_PdfViewer_HyperlinkClickedEventArgs_Handled) property of the [HyperlinkClickedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.HyperlinkClickedEventArgs.html) to `true` to suppress the default hyperlink dialog and handle your logic with the hyperlink information. The following example explains how to open a link directly in the system's default browser without confirmation prompts. {% tabs %} {% highlight XAML hl_lines="3" %} @@ -43,7 +43,7 @@ private async void PdfHyperlinkClicked(object sender, HyperlinkClickedEventArgs ## Enable or disable hyperlink navigation -Enable or disable the recognition of hyperlinks in PDF documents using the [EnableHyperlinkNavigation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableHyperlinkNavigation) property. The following code explains the same. +Enable or disable the recognition of hyperlinks in PDF documents using the [EnableHyperlinkNavigation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableHyperlinkNavigation) property. The following code explains the same. {% tabs %} {% highlight XAML %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Import-Export-Annotations.md b/Document-Processing/PDF/PDF-Viewer/maui/Import-Export-Annotations.md index 8eeb9a0f9c..b742c7873a 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Import-Export-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Import-Export-Annotations.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Import and Export Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -This section will go through the various functions available in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to import and export annotations in a PDF document. +This section will go through the various functions available in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to import and export annotations in a PDF document. The import and export of annotations support the following file data formats: @@ -24,7 +24,7 @@ N> The XFDF and FDF are the standard file data formats that can be used across g ## Import annotations -You can add annotations to a PDF document by importing them from FDF and XFDF files by using the [ImportAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_) method. You need to provide the stream of the file containing the annotations and the data format information as parameters to the method. The following example explains how to import annotations from an XFDF file, assuming that the file is in the application�s data directory. +You can add annotations to a PDF document by importing them from FDF and XFDF files by using the [ImportAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_) method. You need to provide the stream of the file containing the annotations and the data format information as parameters to the method. The following example explains how to import annotations from an XFDF file, assuming that the file is in the application�s data directory. {% tabs %} {% highlight C# %} @@ -35,17 +35,17 @@ void ImportAnnotations() Stream inputFileStream = File.OpenRead(fileName); inputFileStream.Position = 0; - // Provide the file stream and the data format information as parameters to the [ImportAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to import the annotations. + // Provide the file stream and the data format information as parameters to the [ImportAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_) method of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to import the annotations. PdfViewer.ImportAnnotations(inputFileStream, Syncfusion.Pdf.Parsing.AnnotationDataFormat.XFdf); } {% endhighlight %} {% endtabs %} -To import the annotations asynchronously, you may use the [ImportAnnotationsAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportAnnotationsAsync_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Threading_CancellationToken_) method. +To import the annotations asynchronously, you may use the [ImportAnnotationsAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportAnnotationsAsync_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Threading_CancellationToken_) method. ## Export annotations -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to export annotations from a PDF document into FDF and XFDF files. This will help you to save the annotation information in a separate file rather than the complete PDF file. You need to provide the FDF or XFDF file stream as a parameter to the [ExportAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__) method to achieve the same. The annotation information will be exported to the given file stream. The following code explains how to export annotations from a PDF document into an XFDF file in the application�s data directory. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to export annotations from a PDF document into FDF and XFDF files. This will help you to save the annotation information in a separate file rather than the complete PDF file. You need to provide the FDF or XFDF file stream as a parameter to the [ExportAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__) method to achieve the same. The annotation information will be exported to the given file stream. The following code explains how to export annotations from a PDF document into an XFDF file in the application�s data directory. {% tabs %} {% highlight C# %} @@ -61,17 +61,17 @@ private void ExportAnnotations() {% endhighlight %} {% endtabs %} -To import the annotations asynchronously, you may use the [ExportAnnotationsAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotationsAsync_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__System_Threading_CancellationToken_) method. +To import the annotations asynchronously, you may use the [ExportAnnotationsAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotationsAsync_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__System_Threading_CancellationToken_) method. ### Export a specific list of annotations -You can export only a specific list of annotations from a PDF document by providing the list of annotations as an additional parameter to the [ExportAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__) method. You may use the Annotations property of the SfPdfViewer to obtain a specific list of annotations from the total annotations. The following example explains how to export the first five annotations in a PDF document into an XFDF file. +You can export only a specific list of annotations from a PDF document by providing the list of annotations as an additional parameter to the [ExportAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__) method. You may use the Annotations property of the SfPdfViewer to obtain a specific list of annotations from the total annotations. The following example explains how to export the first five annotations in a PDF document into an XFDF file. {% tabs %} {% highlight C# %} List GetAnnotations(int count) { - // Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection annotations = PdfViewer.Annotations; // Create a list of annotations to be exported. @@ -94,7 +94,7 @@ void ExportSpecificAnnotations() // Get the first five annotations in the PDF document List annotationsToBeExported = GetAnnotations(5); - // Export the annotations to the file stream using [ExportAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). + // Export the annotations to the file stream using [ExportAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__) method of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). PdfViewer.ExportAnnotations(fileStream, Syncfusion.Pdf.Parsing.AnnotationDataFormat.XFdf, annotationsToBeExported); } {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Ink-Eraser.md b/Document-Processing/PDF/PDF-Viewer/maui/Ink-Eraser.md index eab1fe3531..3ad5c336a1 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Ink-Eraser.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Ink-Eraser.md @@ -10,20 +10,20 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Ink or Freehand Drawing Eraser in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to erase all or portions of an ink annotation, which will help correct mistakes in freehand drawings. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to erase all or portions of an ink annotation, which will help correct mistakes in freehand drawings. ![Ink eraser](Images/Annotations/ink-eraser.gif) ## Enabling the ink eraser -Enable the ink eraser by setting the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [InkEraser](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_InkEraser). In the ink eraser mode, drag the pointer over the portions of the ink annotations you want to erase. +Enable the ink eraser by setting the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [InkEraser](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_InkEraser). In the ink eraser mode, drag the pointer over the portions of the ink annotations you want to erase. {% tabs %} {% highlight C# %} void EnableInkEraserMode() { - // Set the annotation mode to ink eraser using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the annotation mode to ink eraser using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationMode = AnnotationMode.InkEraser; } @@ -32,7 +32,7 @@ void EnableInkEraserMode() ## Disabling the ink eraser -Once you have erased the ink, disable the ink eraser by setting the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). +Once you have erased the ink, disable the ink eraser by setting the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). {% tabs %} {% highlight C# %} @@ -55,7 +55,7 @@ The following image demonstrates how to use the ink eraser tool from the toolbar ## How to erase ink annotation only using a stylus -The ink eraser operation can be customized so that the ink strokes can be added only using a stylus by setting the [AnnotationSettings.Ink.TouchScreenInputMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TouchScreenInputMode.html) property to TouchScreenInputMode.Stylus. When TouchScreenInputMode is set to TouchScreenInputMode.Stylus, users can easily erase ink strokes using a stylus. However, zooming and scrolling functionality will still be available using their fingers. +The ink eraser operation can be customized so that the ink strokes can be added only using a stylus by setting the [AnnotationSettings.Ink.TouchScreenInputMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TouchScreenInputMode.html) property to TouchScreenInputMode.Stylus. When TouchScreenInputMode is set to TouchScreenInputMode.Stylus, users can easily erase ink strokes using a stylus. However, zooming and scrolling functionality will still be available using their fingers. By default, the TouchScreenInputMode property is set to TouchScreenInputMode.FingerAndStylus, where both finger and stylus inputs are recognized as ink-erasing operations. @@ -71,7 +71,7 @@ N> * At present, this feature is available only in iOS and Android. ## Customize the ink eraser thickness -The default thickness of the ink eraser is 40. You can adjust the thickness using the [InkEraser.Thickness](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkEraserSettings.html#Syncfusion_Maui_PdfViewer_InkEraserSettings_Thickness) property in the annotation settings. +The default thickness of the ink eraser is 40. You can adjust the thickness using the [InkEraser.Thickness](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkEraserSettings.html#Syncfusion_Maui_PdfViewer_InkEraserSettings_Thickness) property in the annotation settings. {% tabs %} {% highlight C# %} @@ -81,7 +81,7 @@ PdfViewer.AnnotationSettings.InkEraser.Thickness = 50; {% endhighlight %} {% endtabs %} -N> When the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) is [InkEraser](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_InkEraser)., only the ink annotations will be erased. Other types of annotations will not be erased. +N> When the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) is [InkEraser](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_InkEraser)., only the ink annotations will be erased. Other types of annotations will not be erased. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Ink.md b/Document-Processing/PDF/PDF-Viewer/maui/Ink.md index b9acb1ef15..f668ae81c3 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Ink.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Ink.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Ink Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The ink annotation feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify freehand drawings (ink) in the PDF document. This is useful for making corrections or emphasizing important points in the document. This section will go through the various functions available in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for working with ink annotations. +The ink annotation feature of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify freehand drawings (ink) in the PDF document. This is useful for making corrections or emphasizing important points in the document. This section will go through the various functions available in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for working with ink annotations. ## Add ink annotations @@ -32,12 +32,12 @@ The following image represents how to add the ink annotations using the toolbar You can draw and add ink annotations to a PDF document with UI interaction using touch or mouse. The following steps explains how to draw ink annotation on a PDF. -1. Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the SfPdfViewer to [Ink](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Ink). It activates the ink drawing mode on the control. +1. Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the SfPdfViewer to [Ink](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Ink). It activates the ink drawing mode on the control. 2. Place your finger (or mouse) on the screen, where you want to start drawing the ink stroke. 3. Draw the stroke by dragging the finger (or cursor) across the screen. 4. Finish the stroke by releasing the finger (or cursor). 5. Repeat steps 2-4 if you want to create multiple strokes on other areas during the ink drawing mode. -6. Once you have done that, set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). It will disable the drawing mode and save the drawn strokes to the PDF page as a single ink annotation. +6. Once you have done that, set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). It will disable the drawing mode and save the drawn strokes to the PDF page as a single ink annotation. 7. You can later move, resize, or edit the annotation. @@ -48,7 +48,7 @@ The following code explains how to enable the ink annotation mode. // Enable or activate the ink drawing mode. void EnableInkDrawingMode() { - // Set the annotation mode to ink using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the annotation mode to ink using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationMode = AnnotationMode.Ink; } {% endhighlight %} @@ -61,7 +61,7 @@ Similarly, refer to the following code to disable the ink annotation mode. // Disable or deactivate the ink drawing mode. void DisableInkDrawingMode() { - // Set the annotation mode to none using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the annotation mode to none using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationMode = AnnotationMode.None; } {% endhighlight %} @@ -69,7 +69,7 @@ void DisableInkDrawingMode() ## Add ink annotations programmatically -You can create and add an ink annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create an ink annotation and add it to the first page of a PDF document. +You can create and add an ink annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create an ink annotation and add it to the first page of a PDF document. {% tabs %} {% highlight C# %} @@ -108,17 +108,17 @@ void AddInkAnnotation() ## Annotation settings -In the ink annotation mode, the ink annotation will be drawn with a default appearance and behavior. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance and behavior before drawing on the document, you can change its default settings using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +In the ink annotation mode, the ink annotation will be drawn with a default appearance and behavior. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance and behavior before drawing on the document, you can change its default settings using the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). ### Customize the default appearance -You can customize the default appearance of ink annotation using the [InkAnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html). The following example explains how to obtain the default ink annotation settings and modify their appearance properties. Similarly, you can also modify other available properties. +You can customize the default appearance of ink annotation using the [InkAnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html). The following example explains how to obtain the default ink annotation settings and modify their appearance properties. Similarly, you can also modify other available properties. {% tabs %} {% highlight C# %} void CustomizeDefaultInkSettings() { - // Obtain the default ink annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the default ink annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. InkAnnotationSettings inkSettings = PdfViewer.AnnotationSettings.Ink; // Modify the default appearance properties @@ -131,13 +131,13 @@ void CustomizeDefaultInkSettings() ### Consider each stroke as a separate ink annotation -When drawing ink annotations on a PDF document interactively, all the strokes that are created during a session are treated as a single ink annotation. The session here refers to the duration between enabling and disabling the ink drawing mode. However, if you wish to consider each stroke as an individual ink annotation, set the [AggregateInkStrokes](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_AggregateInkStrokes) property of the default ink annotation settings to `false`. This allows you to access and modify individual strokes. The following example explains how to access the default ink annotation settings and set the property to `false`. +When drawing ink annotations on a PDF document interactively, all the strokes that are created during a session are treated as a single ink annotation. The session here refers to the duration between enabling and disabling the ink drawing mode. However, if you wish to consider each stroke as an individual ink annotation, set the [AggregateInkStrokes](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_AggregateInkStrokes) property of the default ink annotation settings to `false`. This allows you to access and modify individual strokes. The following example explains how to access the default ink annotation settings and set the property to `false`. {% tabs %} {% highlight C# %} void DisableAggregateInkStrokes() { - // Obtain the default ink annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the default ink annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. InkAnnotationSettings inkSettings = PdfViewer.AnnotationSettings.Ink; // Disable aggregating the ink strokes @@ -148,7 +148,7 @@ void DisableAggregateInkStrokes() ### How to draw an ink annotation only using a stylus -The ink annotation operation can be customized so that the ink strokes can be added only using a stylus by setting the [AnnotationSettings.Ink.TouchScreenInputMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_TouchScreenInputMode) property to TouchScreenInputMode.Stylus. When TouchScreenInputMode is set to TouchScreenInputMode.Stylus, users can easily draw ink strokes using a stylus. However, zooming and scrolling functionality will still be available using their fingers. +The ink annotation operation can be customized so that the ink strokes can be added only using a stylus by setting the [AnnotationSettings.Ink.TouchScreenInputMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_TouchScreenInputMode) property to TouchScreenInputMode.Stylus. When TouchScreenInputMode is set to TouchScreenInputMode.Stylus, users can easily draw ink strokes using a stylus. However, zooming and scrolling functionality will still be available using their fingers. By default, the TouchScreenInputMode property is set to TouchScreenInputMode.FingerAndStylus, where both finger and stylus inputs are recognized as ink operations. @@ -164,7 +164,7 @@ N> * At present, this feature is available only in iOS and Android. ## Edit the selected ink annotation -You can edit the properties of the selected ink annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected ink annotation. Similarly, you can modify the other properties. +You can edit the properties of the selected ink annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected ink annotation. Similarly, you can modify the other properties. {% tabs %} {% highlight C# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Localization.md b/Document-Processing/PDF/PDF-Viewer/maui/Localization.md index b3e1243fe0..f6a43e9705 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Localization.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Localization.md @@ -10,9 +10,9 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Localization in .NET MAUI PDF Viewer (SfPdfViewer) -Localization is the process of translating the application resources into a different language for specific cultures. [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) is set up by default with the language code `en-US`. However, by including a resource file (.resx) in the application with the language code, the static text used in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) can be localized to a different language. +Localization is the process of translating the application resources into a different language for specific cultures. [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) is set up by default with the language code `en-US`. However, by including a resource file (.resx) in the application with the language code, the static text used in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) can be localized to a different language. -Follow the instructions given to apply localization to the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +Follow the instructions given to apply localization to the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). ## Change the current user interface culture diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Lock-Unlock.md b/Document-Processing/PDF/PDF-Viewer/maui/Lock-Unlock.md index 044524659c..9b5f22fe61 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Lock-Unlock.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Lock-Unlock.md @@ -14,19 +14,19 @@ You can lock an annotation to prevent it from being edited. The annotation that ## Lock all annotations in a document -To lock all annotations in a document, set the [IsLocked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.BaseAnnotationSettings.html#Syncfusion_Maui_PdfViewer_BaseAnnotationSettings_IsLocked) property of the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) to `true`. The following example explains how to lock all annotations in a document. +To lock all annotations in a document, set the [IsLocked](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.BaseAnnotationSettings.html#Syncfusion_Maui_PdfViewer_BaseAnnotationSettings_IsLocked) property of the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) to `true`. The following example explains how to lock all annotations in a document. {% tabs %} {% highlight C# %} void LockAllAnnotations() { - // Lock all the annotations in a PDF document using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Lock all the annotations in a PDF document using the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationSettings.IsLocked = true; } {% endhighlight %} {% endtabs %} -* 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`. +* Similarly, to unlock all the annotations, set the [IsLocked](https://help.syncfusion.com/cr/document-processing/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. @@ -34,13 +34,13 @@ For more details on customizing the built-in toolbar, refer to the toolbar [docu ## Lock specific annotation -To lock a specific annotation in a document, access the annotation instance and set the [IsLocked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property of the annotation to `true`. The following example explains how to lock the first annotation in a PDF document. +To lock a specific annotation in a document, access the annotation instance and set the [IsLocked](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property of the annotation to `true`. The following example explains how to lock the first annotation in a PDF document. {% tabs %} {% highlight C# %} void LockFirstAnnotation() { - // Obtain the annotation collection using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the annotation collection using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection annotations = PdfViewer.Annotations; // Obtain the first annotation in the annotation collection. @@ -52,18 +52,18 @@ void LockFirstAnnotation() {% endhighlight %} {% endtabs %} -* Similarly, to unlock the annotation, set the [IsLocked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property value to `false`. +* Similarly, to unlock the annotation, set the [IsLocked](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property value to `false`. ## Lock specific annotation types -You can also use the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property to lock a specific annotation type in a document. The following example explains how to lock all the circle annotations in a document by accessing the circle annotation settings. Similarly, you can lock other types of annotations. +You can also use the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property to lock a specific annotation type in a document. The following example explains how to lock all the circle annotations in a document by accessing the circle annotation settings. Similarly, you can lock other types of annotations. {% tabs %} {% highlight C# %} void LockCircleAnnotations() { - // Obtain the default circle annotation settings using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the default circle annotation settings using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ShapeAnnotationSettings circleAnnotationSettings = PdfViewer.AnnotationSettings.Circle; // Lock all the circle annotations. @@ -72,12 +72,12 @@ void LockCircleAnnotations() {% endhighlight %} {% endtabs %} -* Similarly, to unlock the specific annotation types, set the [IsLocked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property value to `false`. +* Similarly, to unlock the specific annotation types, set the [IsLocked](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property value to `false`. ## Lock the selected annotation -To lock the selected annotation, access the selected annotation instance and set the [IsLocked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property of the annotation to `true`. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example explains how to lock the selected annotation in a PDF document. +To lock the selected annotation, access the selected annotation instance and set the [IsLocked](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property of the annotation to `true`. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example explains how to lock the selected annotation in a PDF document. {% tabs %} {% highlight C# %} @@ -93,7 +93,7 @@ void LockSelectedAnnotation(Annotation selectedAnnotation) {% endhighlight %} {% endtabs %} -* Similarly, to unlock the selected annotation, set the [IsLocked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property value to `false`. +* Similarly, to unlock the selected annotation, set the [IsLocked](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_IsLocked) property value to `false`. ## See Also - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md b/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md index 2bcdd3c2a0..75cedca559 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md @@ -14,7 +14,7 @@ Give users precise control over how PDF content is displayed — from pinch-to-z ## Adjusting the zoom factor -You can control the zoom level using the [ZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ZoomFactor) property. Refer to the following code example. +You can control the zoom level using the [ZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ZoomFactor) property. Refer to the following code example. {% tabs %} {% highlight xaml %} @@ -40,7 +40,7 @@ By default, the zoom range varies by platform: * **Mobile (Android/iOS):** 1.0 to 4.0 * **Desktop (Windows/macOS):** 0.25 to 4.0 -To restrict zoom levels, use the [MinZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MinZoomFactor) and [MaxZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MaxZoomFactor) properties. +To restrict zoom levels, use the [MinZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MinZoomFactor) and [MaxZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MaxZoomFactor) properties. The following code example explains restricting the zoom factor between 0.5 and 2. @@ -55,19 +55,19 @@ PdfViewer.MaxZoomFactor = 2; {% endhighlight %} {% endtabs %} -N> If the [ZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ZoomFactor) is set outside the defined [MinZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MinZoomFactor) and [MaxZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MaxZoomFactor) range, it will be ignored. +N> If the [ZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ZoomFactor) is set outside the defined [MinZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MinZoomFactor) and [MaxZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MaxZoomFactor) range, it will be ignored. You can download a sample project demonstrating magnification features [here](https://github.com/SyncfusionExamples/maui-pdf-viewer-examples). ## Zoom Modes -The PDF Viewer supports the following zoom modes via the [ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) property: +The PDF Viewer supports the following zoom modes via the [ZoomMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) property: 1. **Default** – Restores the viewer to the last user-set zoom level. This is the initial mode when a document is loaded. 2. **Fit to Page** – Displays the entire page within the viewport. 3. **Fit to Width** – Expands the page to fill the width of the viewer. -The default value is [ZoomMode.Default](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_Default). +The default value is [ZoomMode.Default](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_Default). ### Zoom mode via the built-in toolbar @@ -87,7 +87,7 @@ On mobile, the magnification tool appears only after the zoom factor changes. Us #### Fit to Page -You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToPage) enumeration. It magnifies the PDF document so that the entire PDF page is visible in the viewport. +You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToPage](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToPage) enumeration. It magnifies the PDF document so that the entire PDF page is visible in the viewport. Refer to the following code example:  {% tabs %} @@ -103,7 +103,7 @@ pdfViewer.ZoomMode = ZoomMode.FitToPage; #### Fit to Width -You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToWidth) enumeration. It magnifies the PDF document so that the widest page of the PDF document fits the width of the viewport. +You can change the [SfPdfViewer.ZoomMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ZoomMode.html#fields) using the [ZoomMode.FitToWidth](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ZoomMode.html#Syncfusion_Maui_PdfViewer_ZoomMode_FitToWidth) enumeration. It magnifies the PDF document so that the widest page of the PDF document fits the width of the viewport. Refer to the following code example: {% tabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Migration.md b/Document-Processing/PDF/PDF-Viewer/maui/Migration.md index a9258f9e7b..4717586aa3 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Migration.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Migration.md @@ -32,215 +32,215 @@ To simplify migration from [Xamarin SfPdfViewer](https://www.syncfusion.com/xama Description {{'[InputFileStream](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_InputFileStream)'| markdownify }} -{{'[DocumentSource ](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource)'| markdownify }} +{{'[DocumentSource ](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource)'| markdownify }} Represents the source object to load PDF files from the stream or byte array. This property helps to load a PDF document during control initialization and switch the documents dynamically. {{'[ZoomPercentage](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_ZoomPercentage)'| markdownify }} -{{'[ZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ZoomFactor)'| markdownify }} +{{'[ZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ZoomFactor)'| markdownify }} Returns and sets the zoom factor. The default value is 1, which represents 100% zoom. This value can be between 1 and 4. {{'[MinimumZoomPercentage](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_MinimumZoomPercentage)'| markdownify }} -{{'[MinZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MinZoomFactor)'| markdownify }} +{{'[MinZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MinZoomFactor)'| markdownify }} Returns and sets the minimum zoom factor. The default value is 0.25. This value should not exceed `MaxZoomFactor`. {{'[MaximumZoomPercentage](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_MaximumZoomPercentage)'| markdownify }} -{{'[MaxZoomFactor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MaxZoomFactor)'| markdownify }} +{{'[MaxZoomFactor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_MaxZoomFactor)'| markdownify }} Returns and sets the maximum zoom factor. The default value is 4. This value should not be lower than `MinZoomFactor`. {{'[EnableScrollHead](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_EnableScrollHead)'| markdownify }} -{{'[ShowScrollHead](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ShowScrollHead)'| markdownify }} +{{'[ShowScrollHead](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ShowScrollHead)'| markdownify }} Returns and sets the value indicating whether the scroll head can be shown or not. {{'[BookmarkPaneVisible](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_BookmarkPaneVisible)'| markdownify}} -{{'[IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible)'| markdownify}} +{{'[IsOutlineViewVisible](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible)'| markdownify}} Gets or sets a value indicating whether the outline view is visible. {{'[EnableDocumentLinkAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_EnableDocumentLinkAnnotation)'| markdownify}} -{{'[EnableDocumentLinkNavigation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableDocumentLinkNavigation)'| markdownify}} +{{'[EnableDocumentLinkNavigation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableDocumentLinkNavigation)'| markdownify}} Gets or sets a value that indicates whether document link annotations (TOC) in the PDF can be interacted with. {{'[AllowHyperlinkNavigation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_AllowHyperlinkNavigation)'| markdownify}} -{{'[EnableHyperlinkNavigation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableHyperlinkNavigation)'| markdownify}} +{{'[EnableHyperlinkNavigation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableHyperlinkNavigation)'| markdownify}} Gets or sets a value that indicates whether document link annotations (TOC) in the PDF can be interacted with. {{'[Bookmarks](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_Bookmarks)'| markdownify}} -{{'[DocumentOutline](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentOutline)'| markdownify}} +{{'[DocumentOutline](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentOutline)'| markdownify}} Gets the outline for the document. {{'[IsTextSelectionEnabled](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_IsTextSelectionEnabled)'| markdownify}} -{{'[EnableTextSelection](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableTextSelection)'| markdownify}} +{{'[EnableTextSelection](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableTextSelection)'| markdownify}} Gets or sets a value that indicates whether the text selection is enabled or not. The default value is true. {{'[TextSelectionColor](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TextSelectionSettings.html#Syncfusion_SfPdfViewer_XForms_TextSelectionSettings_TextSelectionColor)'| markdownify}} -{{'[HighlightColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSelectionSettings.html#Syncfusion_Maui_PdfViewer_TextSelectionSettings_HighlightColor)'| markdownify}} +{{'[HighlightColor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSelectionSettings.html#Syncfusion_Maui_PdfViewer_TextSelectionSettings_HighlightColor)'| markdownify}} Gets or sets the color to highlight the selected text. The default value is Color.FromRgba(0, 0, 205, 80). {{'[CurrentInstanceColor](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TextSearchSettings.html#Syncfusion_SfPdfViewer_XForms_TextSearchSettings_CurrentInstanceColor)'| markdownify}} -{{'[CurrentMatchHighlightColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchSettings.html#Syncfusion_Maui_PdfViewer_TextSearchSettings_CurrentMatchHighlightColor)'| markdownify}} +{{'[CurrentMatchHighlightColor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchSettings.html#Syncfusion_Maui_PdfViewer_TextSearchSettings_CurrentMatchHighlightColor)'| markdownify}} Gets or sets the color for highlighting the current match of the searched text. The default value is Color.FromRgba(249, 125, 0, 80). {{'[OtherInstanceColor](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TextSearchSettings.html#Syncfusion_SfPdfViewer_XForms_TextSearchSettings_OtherInstanceColor)'| markdownify}} -{{'[OtherMatchesHighlightColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchSettings.html#Syncfusion_Maui_PdfViewer_TextSearchSettings_OtherMatchesHighlightColor)'| markdownify}} +{{'[OtherMatchesHighlightColor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchSettings.html#Syncfusion_Maui_PdfViewer_TextSearchSettings_OtherMatchesHighlightColor)'| markdownify}} Gets or sets the color for highlighting the other matches of the searched text. The default value is Color.FromRgba(255, 255, 0, 50). {{'[AnnotationMode](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_AnnotationMode)'| markdownify}} -{{'[AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode)'| markdownify}} +{{'[AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode)'| markdownify}} Gets or sets a value indicating the type of annotation that should be drawn using UI interaction on the PDF pages. {{'[Annotations](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_AnnotationSettings)'| markdownify}} -{{'[Annotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations)'| markdownify}} +{{'[Annotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations)'| markdownify}} Gets the list of annotations in the PDF. {{'[AnnotationSettings](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_AnnotationSettings)'| markdownify}} -{{'[AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings)'| markdownify}} +{{'[AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings)'| markdownify}} Gets or sets the default annotation settings. {{'[ClearAllAnnotationsCommand](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_ClearAllAnnotationsCommand)'| markdownify}} -{{'[RemoveAllAnnotationsCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllAnnotationsCommand)'| markdownify}} +{{'[RemoveAllAnnotationsCommand](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllAnnotationsCommand)'| markdownify}} The command that removes all annotations from the PDF document. {{'[PerformUndoCommand](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_PerformUndoCommand)'| markdownify}} -{{'[UndoCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UndoCommand)'| markdownify}} +{{'[UndoCommand](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UndoCommand)'| markdownify}} The command that performs the undo operation. {{'[PerformRedoCommand](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_PerformRedoCommand)'| markdownify}} -{{'[RedoCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedoCommand)'| markdownify}} +{{'[RedoCommand](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedoCommand)'| markdownify}} The command that performs the redo operation. {{'[InkPointsCollection](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.InkAnnotation.html#Syncfusion_SfPdfViewer_XForms_InkAnnotation_InkPointsCollection)'| markdownify}} -{{'[PointsCollection](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_PointsCollection)'| markdownify}} +{{'[PointsCollection](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_PointsCollection)'| markdownify}} Gets or sets the series of coordinates that represent the ink points of an ink annotation. {{'[InkAnnotationSettings.Thickness](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.InkAnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_InkAnnotationSettings_Thickness)'| markdownify}} -{{'[InkAnnotationSettings.BorderWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_BorderWidth)'| markdownify}} +{{'[InkAnnotationSettings.BorderWidth](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_BorderWidth)'| markdownify}} Gets or sets the border thickness of an ink annotation. {{'[ShapeAnnotationSettings.Thickness](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.ShapeAnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_ShapeAnnotationSettings_Thickness)'| markdownify }} -{{'[ShapeAnnotationSettings.BorderWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ShapeAnnotationSettings.html#Syncfusion_Maui_PdfViewer_ShapeAnnotationSettings_BorderWidth)'| markdownify}} +{{'[ShapeAnnotationSettings.BorderWidth](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ShapeAnnotationSettings.html#Syncfusion_Maui_PdfViewer_ShapeAnnotationSettings_BorderWidth)'| markdownify}} Gets or sets the border thickness of the shape annotation. {{'[InkAnnotationSettings.EnableSeparateAttributesForEachStroke](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.InkAnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_InkAnnotationSettings_EnableSeparateAttributesForEachStroke)'| markdownify}} -{{'[InkAnnotationSettings.AggregateInkStrokes](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_AggregateInkStrokes)'| markdownify}} +{{'[InkAnnotationSettings.AggregateInkStrokes](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_AggregateInkStrokes)'| markdownify}} Gets or sets a value indicating whether each ink stroke should be treated as a separate ink annotation. {{'[ShapeAnnotationSettings.StrokeColor](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.ShapeAnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_ShapeAnnotationSettings_StrokeColor)'| markdownify}} -{{'[ShapeAnnotationSettings.Color](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationAppearanceSettings.html#Syncfusion_Maui_PdfViewer_AnnotationAppearanceSettings_Color)'| markdownify}} +{{'[ShapeAnnotationSettings.Color](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationAppearanceSettings.html#Syncfusion_Maui_PdfViewer_AnnotationAppearanceSettings_Color)'| markdownify}} Gets or sets the default stroke color of shape annotation. {{'[SelectorSettings.StrokeColor](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SelectorSettings.html#Syncfusion_SfPdfViewer_XForms_SelectorSettings_StrokeColor)'| markdownify }} -{{'[AnnotationSelectorSettings.Color](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSelectorSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSelectorSettings_Color)'| markdownify}} +{{'[AnnotationSelectorSettings.Color](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSelectorSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSelectorSettings_Color)'| markdownify}} Gets or sets the default color of the annotation selector. {{'[LockedStrokeColor](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SelectorSettings.html#Syncfusion_SfPdfViewer_XForms_SelectorSettings_LockedStrokeColor)'| markdownify}} -{{'[LockedColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSelectorSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSelectorSettings_LockedColor)'| markdownify}} +{{'[LockedColor](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSelectorSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSelectorSettings_LockedColor)'| markdownify}} Gets or sets the default color of the annotation selector when the selected annotation is locked. {{'[LinePoints](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.ShapeAnnotation.html#Syncfusion_SfPdfViewer_XForms_ShapeAnnotation_LinePoints)'| markdownify}} -{{'[LineAnnotation.Points](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.LineAnnotation.html#Syncfusion_Maui_PdfViewer_LineAnnotation_Points)'| markdownify}} +{{'[LineAnnotation.Points](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.LineAnnotation.html#Syncfusion_Maui_PdfViewer_LineAnnotation_Points)'| markdownify}} Gets or sets the series of coordinates that represent the starting point and ending point of a line annotation. {{'[Rectangle](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_AnnotationSettings_Rectangle)'| markdownify}} -{{'[ShapeAnnotationSettings.Square](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Square)'| markdownify}} +{{'[ShapeAnnotationSettings.Square](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Square)'| markdownify}} Gets or sets the default settings for square annotations. {{'[Circle](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_AnnotationSettings_Circle)'| markdownify}} -{{'[AnnotationSettings.Circle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Circle)'| markdownify}} +{{'[AnnotationSettings.Circle](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Circle)'| markdownify}} Gets or sets the default settings for circle annotations. {{'[Line](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_AnnotationSettings_Line)'| markdownify}} -{{'[AnnotationSettings.Line](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Line)'| markdownify}} +{{'[AnnotationSettings.Line](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Line)'| markdownify}} Gets or sets the default settings for line annotations. {{'[Arrow](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_AnnotationSettings_Arrow)'| markdownify}} -{{'[AnnotationSettings.Arrow](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Arrow)'| markdownify}} +{{'[AnnotationSettings.Arrow](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Arrow)'| markdownify}} Gets or sets the default settings for arrow annotations. {{'[Ink](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_AnnotationSettings_Ink)'| markdownify}} -{{'[AnnotationSettings.Ink](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Ink)'| markdownify}} +{{'[AnnotationSettings.Ink](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Ink)'| markdownify}} Gets or sets the default settings for ink annotations. {{'[Stamp](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_AnnotationSettings_Stamp)'| markdownify}} -{{'[AnnotationSettings.Stamp](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Stamp)'| markdownify}} +{{'[AnnotationSettings.Stamp](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Stamp)'| markdownify}} Gets or sets the default settings for stamp annotations. {{'[AnnotationMode.HandwrittenSignature](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationMode.html#Syncfusion_SfPdfViewer_XForms_AnnotationMode_HandwrittenSignature)'| markdownify}} - {{'[AnnotationMode.Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Signature)'| markdownify}} + {{'[AnnotationMode.Signature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Signature)'| markdownify}} This will display the signature dialog, allowing the user to create a signature. The created signature can then be added at the tapped location in the PDF Viewer. {{'[Selector](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_AnnotationSettings_Selector)'| markdownify}} -{{'[AnnotationSettings.Selector](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Selector)'| markdownify}} +{{'[AnnotationSettings.Selector](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html#Syncfusion_Maui_PdfViewer_AnnotationSettings_Selector)'| markdownify}} Gets or sets the default settings for the annotation selector. {{'[FormField.CanEdit](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.FormField.html#Syncfusion_SfPdfViewer_XForms_FormField_CanEdit)'| markdownify}} -{{'[FormField.ReadOnly](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_ReadOnly)'| markdownify}} +{{'[FormField.ReadOnly](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_ReadOnly)'| markdownify}} Gets or sets a value that indicates whether the form field can be edited or not. {{'[SignatureFormField.HandwrittenSignature](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SignatureFormField.html#Syncfusion_SfPdfViewer_XForms_SignatureFormField_HandwrittenSignature)'| markdownify}} -{{'[SignatureFormField.Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature)'| markdownify}} +{{'[SignatureFormField.Signature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SignatureFormField.html#Syncfusion_Maui_PdfViewer_SignatureFormField_Signature)'| markdownify}} Gets or sets the ink annotation signature in the signature field. {{'[PageViewMode](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_PageViewMode)'| markdownify}} -{{'[PageLayoutMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PageLayoutMode)'| markdownify}} +{{'[PageLayoutMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PageLayoutMode)'| markdownify}} Gets or sets the layout mode in which the pages will be displayed. {{'[InkAnnotationSettings.TouchMode](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.InkAnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_InkAnnotationSettings_TouchMode)'| markdownify}} -{{'[InkAnnotationSettings.TouchScreenInputMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_TouchScreenInputMode)'| markdownify}} +{{'[InkAnnotationSettings.TouchScreenInputMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotationSettings.html#Syncfusion_Maui_PdfViewer_InkAnnotationSettings_TouchScreenInputMode)'| markdownify}} Gets or sets a value that indicates the input mode in which the ink strokes should be allowed to be drawn. {{'[TouchMode.Direct](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TouchMode.html#Syncfusion_SfPdfViewer_XForms_TouchMode_Direct)'| markdownify}} -{{'[TouchScreenInputMode.FingerAndStylus](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TouchScreenInputMode.html#Syncfusion_Maui_PdfViewer_TouchScreenInputMode_FingerAndStylus)'| markdownify}} +{{'[TouchScreenInputMode.FingerAndStylus](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TouchScreenInputMode.html#Syncfusion_Maui_PdfViewer_TouchScreenInputMode_FingerAndStylus)'| markdownify}} Allows drawing ink using both finger and stylus. {{'[IsToolbarVisible](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_IsToolbarVisible)'| markdownify}} - {{'[ShowToolbars](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ShowToolbars)'| markdownify}} + {{'[ShowToolbars](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ShowToolbars)'| markdownify}} Backing store for the ShowToolbars property. {{'[AnnotationSettings.HandwrittenSignature](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.AnnotationSettings.html#Syncfusion_SfPdfViewer_XForms_AnnotationSettings_HandwrittenSignature)'| markdownify}} API Unavailable - In .NET MAUI PDF Viewer, there is no API to configure common settings for handwritten signatures. However, you can achieve this by handling the {{'[SignatureCreated](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SignatureCreated)'| markdownify }} event, which allows you to access and customize each handwritten signature when it is created using the built-in signature dialog. + In .NET MAUI PDF Viewer, there is no API to configure common settings for handwritten signatures. However, you can achieve this by handling the {{'[SignatureCreated](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SignatureCreated)'| markdownify }} event, which allows you to access and customize each handwritten signature when it is created using the built-in signature dialog.
    Refer to the {{'[Signature Created Event user guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/signature#signature-created-event)'| markdownify }} for instructions on accessing the handwritten signature and setting values like color and border width. @@ -256,17 +256,17 @@ To simplify migration from [Xamarin SfPdfViewer](https://www.syncfusion.com/xama Description {{'[UnhandledConditionOccurred](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_UnhandledConditionOccurred)'| markdownify }} -{{'[DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed)'| markdownify }} +{{'[DocumentLoadFailed](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed)'| markdownify }} Occurs when the PDF Viewer fails to load a PDF document. That is, when any corrupted document is loaded, when any password-protected document is loaded with an invalid or empty password, or when any non-PDF document is loaded. {{'[SearchInitiated](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SearchInitiated)'| markdownify}}, {{'[SearchCompleted](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SearchCompleted)'| markdownify}} -{{'[TextSearchProgress](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_TextSearchProgress)'| markdownify }} +{{'[TextSearchProgress](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_TextSearchProgress)'| markdownify }} Occurs when the text search is in progress. {{'[TextSelectionCompleted](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_TextSelectionCompleted)'| markdownify}} -{{'[TextSelectionChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_TextSelectionChanged)'| markdownify}} +{{'[TextSelectionChanged](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_TextSelectionChanged)'| markdownify}} Occurs when the text is selected or when the selected text is changed. @@ -278,7 +278,7 @@ To simplify migration from [Xamarin SfPdfViewer](https://www.syncfusion.com/xama
    {{'[FreeTextAnnotationAdded](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_FreeTextAnnotationAdded)'| markdownify }}
    {{'[TextMarkupAdded](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_TextMarkupAdded)'| markdownify }}
    -{{'[AnnotationAdded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded)'| markdownify }} +{{'[AnnotationAdded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded)'| markdownify }} Occurs when an annotation is added to a page. @@ -290,7 +290,7 @@ To simplify migration from [Xamarin SfPdfViewer](https://www.syncfusion.com/xama
    {{'[FreeTextAnnotationDeselected](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_FreeTextAnnotationDeselected)'| markdownify }},
    {{'[TextMarkupDeselected](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_TextMarkupDeselected)'| markdownify }}
    -{{'[AnnotationDeselected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationDeselected)'| markdownify }} +{{'[AnnotationDeselected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationDeselected)'| markdownify }} Occurs when a selected annotation gets deselected. @@ -302,7 +302,7 @@ To simplify migration from [Xamarin SfPdfViewer](https://www.syncfusion.com/xama
    {{'[FreeTextAnnotationEdited](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_FreeTextAnnotationEdited)'| markdownify }},
    {{'[TextMarkupEdited](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_TextMarkupEdited)'| markdownify }}
    -{{'[AnnotationEdited](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited)'| markdownify }} +{{'[AnnotationEdited](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited)'| markdownify }} Occurs when an annotation is modified. @@ -314,7 +314,7 @@ To simplify migration from [Xamarin SfPdfViewer](https://www.syncfusion.com/xama
    {{'[FreeTextAnnotationRemoved](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_FreeTextAnnotationRemoved)'| markdownify }},
    {{'[TextMarkupRemoved](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_TextMarkupRemoved)'| markdownify }}
    -{{'[AnnotationRemoved](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved)'| markdownify }} +{{'[AnnotationRemoved](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved)'| markdownify }} Occurs when an annotation is removed from the page. @@ -326,7 +326,7 @@ To simplify migration from [Xamarin SfPdfViewer](https://www.syncfusion.com/xama
    {{'[FreeTextAnnotationSelected](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_FreeTextAnnotationSelected)'| markdownify }},
    {{'[TextMarkupSelected](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_TextMarkupSelected)'| markdownify }}
    -{{'[AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected)'| markdownify }} +{{'[AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected)'| markdownify }} Occurs when an annotation is selected. @@ -367,7 +367,7 @@ private void PdfViewer_PropertyChanged(object? sender, PropertyChangedEventArgs {{'[DocumentSaveInitiated](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_DocumentSaveInitiated)'| markdownify }} API Unavailable - In Xamarin, clicking the Save button in the built-in toolbar raises the {{'[DocumentSaveInitiated](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_DocumentSaveInitiated)'| markdownify }} event. However, in .NET MAUI, a Save button is not provided in the built-in toolbar, so the {{'[DocumentSaveInitiated](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_DocumentSaveInitiated)'| markdownify }} event is not available. To save documents from the PDF viewer in .NET MAUI, you can use the {{'[SaveDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocument_System_IO_Stream_)'| markdownify }} method. The PdfViewer control exposes this method as an API, which can be easily integrated into your application. For more details on using the SaveDocument method, refer to the relevant UG Documentation {{'[Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document)'| markdownify }}. + In Xamarin, clicking the Save button in the built-in toolbar raises the {{'[DocumentSaveInitiated](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_DocumentSaveInitiated)'| markdownify }} event. However, in .NET MAUI, a Save button is not provided in the built-in toolbar, so the {{'[DocumentSaveInitiated](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_DocumentSaveInitiated)'| markdownify }} event is not available. To save documents from the PDF viewer in .NET MAUI, you can use the {{'[SaveDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocument_System_IO_Stream_)'| markdownify }} method. The PdfViewer control exposes this method as an API, which can be easily integrated into your application. For more details on using the SaveDocument method, refer to the relevant UG Documentation {{'[Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document)'| markdownify }}.
    In .NET MAUI PDF Viewer, you can implement custom save logic at the application level. If you would like to include a Save button in the built-in toolbar, this can be achieved by customizing the toolbar items. Refer to the {{'[Customize toolbar items user guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar#customize-toolbar-items)'| markdownify }} for instructions on adding a custom Save button. @@ -383,10 +383,10 @@ In .NET MAUI PDF Viewer, you can implement custom save logic at the application In the .NET MAUI PDF Viewer, there are no public APIs available to determine whether undo or redo actions are available, unlike in Xamarin. However, undo and redo actions are typically triggered when changes are made to the PDF document such as adding, editing, or removing annotations, or modifying form field values. These types of modifications can be detected using the annotation and form field events provided by the PDF Viewer. These events include:

    -{{'[AnnotationAdded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded)'| markdownify }}- Occurs when an annotation is added to a page. -{{'[AnnotationEdited](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited)'| markdownify }} - Occurs when annotation is modified. -{{'[AnnotationRemoved](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved)'| markdownify }} - Occurs when an annotation is removed from the page. -{{'[FormFieldValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged)'| markdownify }} - Occurs when when the values of the form fields are changed in the PDF. +{{'[AnnotationAdded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded)'| markdownify }}- Occurs when an annotation is added to a page. +{{'[AnnotationEdited](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited)'| markdownify }} - Occurs when annotation is modified. +{{'[AnnotationRemoved](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved)'| markdownify }} - Occurs when an annotation is removed from the page. +{{'[FormFieldValueChanged](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_FormFieldValueChanged)'| markdownify }} - Occurs when when the values of the form fields are changed in the PDF.

    By handling these events, you can determine whether any modifications have been made to the PDF document. @@ -402,38 +402,38 @@ By handling these events, you can determine whether any modifications have been Description {{'[Unload](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_Unload)'| markdownify }} -{{'[UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument)'| markdownify }} +{{'[UnloadDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument)'| markdownify }} Unload the current PDF document. {{'[GoToBookmark](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_GoToBookmark_Syncfusion_Pdf_Interactive_PdfBookmark_)'| markdownify}} -{{'[GoToOutlineElement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToOutlineElement_Syncfusion_Maui_PdfViewer_OutlineElement_)'| markdownify}} +{{'[GoToOutlineElement](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToOutlineElement_Syncfusion_Maui_PdfViewer_OutlineElement_)'| markdownify}} Navigates to the location of the given outline element. {{'[SearchText](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SearchText_System_String_)'| markdownify}} -{{'[SearchTextAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_)'| markdownify}} +{{'[SearchTextAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_)'| markdownify}} Finds and highlights all occurrences of the given text in the PDF document asynchronously. {{'[CancelSearch](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_CancelSearch)'| markdownify}} -{{'[Clear](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_Clear)'| markdownify}} +{{'[Clear](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_Clear)'| markdownify}} Clears the highlighted searched text in the PDF document and the search information from the results. Also, it cancels the progress while the text search is running. {{'[SearchNext](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SearchNext)'| markdownify}} -{{'[GoToNextMatch](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToNextMatch)'| markdownify}} +{{'[GoToNextMatch](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToNextMatch)'| markdownify}} Navigates to the next match of the searched text. {{'[SearchPrevious](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SearchPrevious)'| markdownify}} -{{'[GoToPreviousMatch](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToPreviousMatch)'| markdownify}} +{{'[GoToPreviousMatch](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToPreviousMatch)'| markdownify}} Navigates to the previous match of the searched text. {{'[ClearAllAnnotations](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_ClearAllAnnotations)'| markdownify}} -{{'[RemoveAllAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllAnnotations)'| markdownify}} +{{'[RemoveAllAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllAnnotations)'| markdownify}} Removes all annotations from the PDF document. @@ -441,57 +441,57 @@ By handling these events, you can determine whether any modifications have been
    {{'[AddAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_AddAnnotation_Syncfusion_SfPdfViewer_XForms_IAnnotation_)'| markdownify}}
    {{'[AddStamp](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_AddStamp_Xamarin_Forms_View_System_Int32_)'| markdownify}}
    -{{'[AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_)'| markdownify}} +{{'[AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_)'| markdownify}} Adds the given annotation to the page represented by the annotation’s PageNumber property. {{'[DeselectAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_DeselectAnnotation_Syncfusion_SfPdfViewer_XForms_IAnnotation_)'| markdownify}} -{{'[DeselectAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DeselectAnnotation_Syncfusion_Maui_PdfViewer_Annotation_)'| markdownify}} +{{'[DeselectAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DeselectAnnotation_Syncfusion_Maui_PdfViewer_Annotation_)'| markdownify}} Deselects the given annotation. {{'[ExportAnnotations](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_ExportAnnotations_Syncfusion_Pdf_Parsing_AnnotationDataFormat_)'| markdownify}} -{{'[ExportAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__)'| markdownify}} +{{'[ExportAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__)'| markdownify}} Exports the annotations in the PDF document to the specified format and writes the exported data to the given output stream. {{'[ExportAnnotationsAsync](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_ExportAnnotationsAsync_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Threading_CancellationToken_)'| markdownify}} -{{'[ExportAnnotationsAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotationsAsync_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__System_Threading_CancellationToken_)'| markdownify}} +{{'[ExportAnnotationsAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ExportAnnotationsAsync_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_System_Collections_Generic_List_Syncfusion_Maui_PdfViewer_Annotation__System_Threading_CancellationToken_)'| markdownify}} Exports the annotations in the PDF document to the specified format and writes the exported data to the given output stream. {{'[ImportAnnotations](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_ImportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_)'| markdownify}} -{{'[ImportAnnotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_)'| markdownify}} +{{'[ImportAnnotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ImportAnnotations_System_IO_Stream_Syncfusion_Pdf_Parsing_AnnotationDataFormat_)'| markdownify}} Imports annotation data into the PDF document. {{'[RemoveAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_RemoveAnnotation_Syncfusion_SfPdfViewer_XForms_IAnnotation_)'| markdownify}} -{{'[RemoveAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAnnotation_Syncfusion_Maui_PdfViewer_Annotation_)'| markdownify}} +{{'[RemoveAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAnnotation_Syncfusion_Maui_PdfViewer_Annotation_)'| markdownify}} Removes the given annotation from the page. {{'[SaveDocument](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SaveDocument)'| markdownify}} -{{'[SaveDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocument_System_IO_Stream_)'| markdownify}} +{{'[SaveDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocument_System_IO_Stream_)'| markdownify}} Saves the PDF document and writes the final document into the given output stream. {{'[SaveDocumentAsync](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SaveDocumentAsync_System_Threading_CancellationToken_)'| markdownify}} -{{'[SaveDocumentAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocumentAsync_System_IO_Stream_System_Threading_CancellationToken_)'| markdownify}} +{{'[SaveDocumentAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocumentAsync_System_IO_Stream_System_Threading_CancellationToken_)'| markdownify}} Saves the PDF document and writes the final document into the given output stream. {{'[SelectAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SelectAnnotation_Syncfusion_SfPdfViewer_XForms_IAnnotation_)'| markdownify}} -{{'[SelectAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectAnnotation_Syncfusion_Maui_PdfViewer_Annotation_)'| markdownify}} +{{'[SelectAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectAnnotation_Syncfusion_Maui_PdfViewer_Annotation_)'| markdownify}} Selects the given annotation. {{'[Print](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_Print)'| markdownify }} -{{'[PrintDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PrintDocument)'| markdownify }} +{{'[PrintDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PrintDocument)'| markdownify }} Prints the PDF document. {{'[SaveDocument(bool flattenForm)](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.SfPdfViewer.html#Syncfusion_SfPdfViewer_XForms_SfPdfViewer_SaveDocument_System_Boolean_)'| markdownify }} -{{'[FormField.FlattenOnSave](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_FlattenOnSave)'| markdownify }} +{{'[FormField.FlattenOnSave](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FormField.html#Syncfusion_Maui_PdfViewer_FormField_FlattenOnSave)'| markdownify }} Specifies whether the form fields should be flattened or not on saving. @@ -502,7 +502,7 @@ By handling these events, you can determine whether any modifications have been API Unavailable In .NET MAUI PDF Viewer, there is no support for exporting PDF as images. However, you can use the Syncfusion PDF to Image Converter library to convert PDF documents into images. For detailed implementation guidance, please refer to the following API documentation: -{{'[PdfToImageConverter](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfToImageConverter.PdfToImageConverter.html)'| markdownify }} +{{'[PdfToImageConverter](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfToImageConverter.PdfToImageConverter.html)'| markdownify }} @@ -517,46 +517,46 @@ For detailed implementation guidance, please refer to the following API document Description {{'[CustomBookmark](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.CustomBookmark.html)'| markdownify }} -{{'[Bookmark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Bookmark.html)'| markdownify }} +{{'[Bookmark](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Bookmark.html)'| markdownify }} Represents a custom bookmark with a name and associated page number. {{'[TouchMode](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TouchMode.html)'| markdownify }} -{{'[TouchScreenInputMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TouchScreenInputMode.html)'| markdownify }} +{{'[TouchScreenInputMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TouchScreenInputMode.html)'| markdownify }} Enumerates the values that specify the input mode in which the ink strokes should be allowed to be drawn. {{'[TextSelectionCompletedEventArgs](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TextSelectionCompletedEventArgs.html)'| markdownify }} -{{'[TextSelectionChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSelectionChangedEventArgs.html)'| markdownify}} +{{'[TextSelectionChangedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSelectionChangedEventArgs.html)'| markdownify}} Provides data for the TextSelectionChanged event. {{'[UnhandledConditionEventArgs](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.UnhandledConditionEventArgs.html#Syncfusion_SfPdfViewer_XForms_UnhandledConditionEventArgs)'| markdownify }} -{{'[DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html)'| markdownify }} -Provides data for the {{'[DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed)'| markdownify }} event. +{{'[DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html)'| markdownify }} +Provides data for the {{'[DocumentLoadFailed](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed)'| markdownify }} event. {{'[TextMarkupAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TextMarkupAnnotation.html)'| markdownify }} -
    {{'[HighlightAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.HighlightAnnotation.html)'| markdownify }},
    -
    {{'[SquigglyAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SquigglyAnnotation.html)'| markdownify }},
    -
    {{'[StrikeOutAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.StrikeOutAnnotation.html)'| markdownify }},
    -
    {{'[UnderlineAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.UnderlineAnnotation.html)'| markdownify }}
    +
    {{'[HighlightAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.HighlightAnnotation.html)'| markdownify }},
    +
    {{'[SquigglyAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SquigglyAnnotation.html)'| markdownify }},
    +
    {{'[StrikeOutAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.StrikeOutAnnotation.html)'| markdownify }},
    +
    {{'[UnderlineAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.UnderlineAnnotation.html)'| markdownify }}
    Represents the text markup annotation on the text contents in the page. -{{'[ShapeAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ShapeAnnotation.html)'| markdownify }} +{{'[ShapeAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ShapeAnnotation.html)'| markdownify }} -
    {{'[CircleAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.CircleAnnotation.html)'| markdownify }},
    -
    {{'[LineAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html)'| markdownify }},
    -
    {{'[SquareAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SquareAnnotation.html)'| markdownify }}
    +
    {{'[CircleAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.CircleAnnotation.html)'| markdownify }},
    +
    {{'[LineAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotation.html)'| markdownify }},
    +
    {{'[SquareAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SquareAnnotation.html)'| markdownify }}
    Represents an annotation that displays a shape on the page. {{'[PopupAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.PopupAnnotation.html)'| markdownify }} -{{'[StickyNoteAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.StickyNoteAnnotation.html)'| markdownify }} +{{'[StickyNoteAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.StickyNoteAnnotation.html)'| markdownify }} Represents the sticky note annotation on the text contents in the page. @@ -583,8 +583,8 @@ For detailed implementation guidance, please refer to the following API document
    {{'[TextMarkupRemovedEventArgs](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TextMarkupRemovedEventArgs.html)'| markdownify }},
    {{'[TextMarkupSelectedEventArgs](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.TextMarkupSelectedEventArgs.html)'| markdownify }}
    -{{'[AnnotationEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationEventArgs.html)'| markdownify}} -Provides data for the {{'[AnnotationAdded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded)'| markdownify}}, {{'[AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected)'| markdownify}}, {{'[AnnotationDeselected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationDeselected)'| markdownify}}, {{'[AnnotationEdited](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited)'| markdownify}}, {{'[AnnotationRemoved](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved)'| markdownify}} events. +{{'[AnnotationEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationEventArgs.html)'| markdownify}} +Provides data for the {{'[AnnotationAdded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationAdded)'| markdownify}}, {{'[AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected)'| markdownify}}, {{'[AnnotationDeselected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationDeselected)'| markdownify}}, {{'[AnnotationEdited](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationEdited)'| markdownify}}, {{'[AnnotationRemoved](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationRemoved)'| markdownify}} events. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-Base64String.md b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-Base64String.md index 1cabbc7801..b6073522fc 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-Base64String.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-Base64String.md @@ -10,9 +10,9 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Open a Document from a Base64 String in .NET MAUI PDF Viewer -A PDF document can be opened in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) from a given Base64 string by converting it to a byte[] and assigning it to the [DocumentSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property. +A PDF document can be opened in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) from a given Base64 string by converting it to a byte[] and assigning it to the [DocumentSource](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property. -Just by making a few changes to the `PdfViewerViewModel.cs` shared in the getting started example, you can easily open a document from a given Base64 string by converting the Base64 string to byte array using the [FromBase64String](https://learn.microsoft.com/en-us/dotnet/api/system.convert.frombase64string?view=net-9.0) method of the [Convert](https://github.com/dotnet/runtime/blob/1d1bf92fcf43aa6981804dc53c5174445069c9e4/src/libraries/System.Private.CoreLib/src/System/Convert.cs) class in the `System` namespace and assigning the obtained byte array to the [DocumentSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property in the .NET MAUI PDF Viewer. Refer to the following code example for reference: +Just by making a few changes to the `PdfViewerViewModel.cs` shared in the getting started example, you can easily open a document from a given Base64 string by converting the Base64 string to byte array using the [FromBase64String](https://learn.microsoft.com/en-us/dotnet/api/system.convert.frombase64string?view=net-9.0) method of the [Convert](https://github.com/dotnet/runtime/blob/1d1bf92fcf43aa6981804dc53c5174445069c9e4/src/libraries/System.Private.CoreLib/src/System/Convert.cs) class in the `System` namespace and assigning the obtained byte array to the [DocumentSource](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property in the .NET MAUI PDF Viewer. Refer to the following code example for reference: {% tabs %} {% highlight c# tabtitle="PdfViewerViewModel.cs" %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-Local-Storage.md b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-Local-Storage.md index 8a16c590b3..6024e5cf37 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-Local-Storage.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-Local-Storage.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Open a PDF from Local Storage in .NET MAUI PDF Viewer (SfPdfViewer) -A PDF document can be opened in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) from the local storage by reading the file as a `Stream` and assigning the obtained `Stream` to the [DocumentSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property. +A PDF document can be opened in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) from the local storage by reading the file as a `Stream` and assigning the obtained `Stream` to the [DocumentSource](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property. Just by making a few changes to the `MainPage.xaml` and `PdfViewerViewModel.cs` shared in the getting started example, you can easily open a document from the local storage with the help of [File Picker](https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/storage/file-picker?view=net-maui-7.0&tabs=ios) as one of the options. @@ -50,7 +50,7 @@ In `MainPage.xaml`, add a new button to open a PDF document from the local stora {% endhighlight %} {% endtabs %} -In `PdfViewerViewModel.cs`, implement the functionalities of the `File picker` to choose a PDF document and read its stream, which can be assigned to the [DocumentSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to view the document. Refer to the following code: +In `PdfViewerViewModel.cs`, implement the functionalities of the `File picker` to choose a PDF document and read its stream, which can be assigned to the [DocumentSource](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to view the document. Refer to the following code: {% tabs %} {% highlight c# tabtitle="PdfViewerViewModel.cs" %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-URL.md b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-URL.md index fc62af63cc..2170ff80cb 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-URL.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document-From-URL.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Open a Document from URL in .NET MAUI PDF Viewer (SfPdfViewer) -A PDF document can be opened in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) from a given URL by converting it to a byte[] and assigning the obtained byte[] to the [DocumentSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property. +A PDF document can be opened in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) from a given URL by converting it to a byte[] and assigning the obtained byte[] to the [DocumentSource](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentSource) property. N>If you experience issues loading a document into the PDF viewer from a URL, it may not be an issue with the PDF viewer itself. If you face issues, please ensure the PDF file is accessible by checking the URL validity, network connectivity, and authentication, and try opening the URL in a web browser. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document.md b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document.md index 444a66a507..ab389c7b47 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Document.md @@ -10,9 +10,9 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Open a Document in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to open PDF documents from various sources, such as local storage or URLs. It also supports viewing password-protected documents. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to open PDF documents from various sources, such as local storage or URLs. It also supports viewing password-protected documents. -This section walks you through loading and unloading documents in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) and handling load-specific events. +This section walks you through loading and unloading documents in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) and handling load-specific events. ## In This Section @@ -27,7 +27,7 @@ This section walks you through loading and unloading documents in the [SfPdfView ## Document and page loading indications -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) displays a built-in [ActivityIndicator](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/activityindicator) (loading indicator) under the following scenarios to indicate if there are any lengthy loadings. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) displays a built-in [ActivityIndicator](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/activityindicator) (loading indicator) under the following scenarios to indicate if there are any lengthy loadings. 1. `At the document` – To indicate that the document is loading. 2. `At the pages` – To indicate that the page content is loading. @@ -36,7 +36,7 @@ To customize the appearance of the loading indicators, please refer to this [sec ## Loading a PDF in code-behind/programmatically -In code-behind a PDF can be loaded to [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) just by using the [LoadDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_LoadDocument_System_IO_Stream_System_String_System_Nullable_Syncfusion_Maui_PdfViewer_FlattenOptions__) method. Use the following code snippet in the code-behind of the XAML page. +In code-behind a PDF can be loaded to [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) just by using the [LoadDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_LoadDocument_System_IO_Stream_System_String_System_Nullable_Syncfusion_Maui_PdfViewer_FlattenOptions__) method. Use the following code snippet in the code-behind of the XAML page. {% tabs %} {% highlight c# %} @@ -48,7 +48,7 @@ PdfViewer.LoadDocument(pdfDocumentStream); ## Document source types -The document source types accepted by the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) are `Stream` and `byte[]`. You can load the PDF document from a specified stream or bytes. +The document source types accepted by the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) are `Stream` and `byte[]`. You can load the PDF document from a specified stream or bytes. **Load the document from the stream**  @@ -73,10 +73,10 @@ PdfViewer.DocumentSource = await response.Content.ReadAsByteArrayAsync(); ## Unload a document -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to unload and clear the resources occupied by the PDF document loaded using the [UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method, as shown below. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to unload and clear the resources occupied by the PDF document loaded using the [UnloadDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method, as shown below. -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> 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/document-processing/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/document-processing/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/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument) method. {% tabs %} {% highlight c# %} @@ -87,7 +87,7 @@ PdfViewer.UnloadDocument(); ## Opening a unsupported annotations -The .NET MAUI PDF Viewer it is possible to view the unsupported annotations like 3D, rich media and sound annotations in a non-interactive manner. To achieve this, provide the [flattenOptions](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FlattenOptions.html) (an optional parameter) as [Unsupported](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.FlattenOptions.html#Syncfusion_Maui_PdfViewer_FlattenOptions_Unsupported) in the [LoadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_LoadDocument_System_IO_Stream_System_String_System_Nullable_Syncfusion_Maui_PdfViewer_FlattenOptions__) methods. See the following code example: +The .NET MAUI PDF Viewer it is possible to view the unsupported annotations like 3D, rich media and sound annotations in a non-interactive manner. To achieve this, provide the [flattenOptions](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FlattenOptions.html) (an optional parameter) as [Unsupported](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.FlattenOptions.html#Syncfusion_Maui_PdfViewer_FlattenOptions_Unsupported) in the [LoadDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_LoadDocument_System_IO_Stream_System_String_System_Nullable_Syncfusion_Maui_PdfViewer_FlattenOptions__) methods. See the following code example: {% tabs %} {% highlight c# hl_lines="2" %} @@ -100,8 +100,8 @@ The .NET MAUI PDF Viewer it is possible to view the unsupported annotations like {% endhighlight %} {% endtabs %} -N> * All the [LoadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_LoadDocument_System_IO_Stream_System_String_System_Nullable_Syncfusion_Maui_PdfViewer_FlattenOptions__) methods accept the flatten options parameter. -N> * Refer to this [section](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/migration#upcoming-features) for the upcoming annotation features in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +N> * All the [LoadDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_LoadDocument_System_IO_Stream_System_String_System_Nullable_Syncfusion_Maui_PdfViewer_FlattenOptions__) methods accept the flatten options parameter. +N> * Refer to this [section](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/migration#upcoming-features) for the upcoming annotation features in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). ## Optimizing document loading on Android diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Password-Protected-Document.md b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Password-Protected-Document.md index 9cf1c8edc5..c71d69ee64 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Password-Protected-Document.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Open-a-Password-Protected-Document.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Open a Password-Protected PDF in .NET MAUI PDF Viewer (SfPdfViewer) -To open a password-protected or encrypted PDF document, you can use the [LoadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_LoadDocument_System_IO_Stream_System_String_) method by providing the password along with the document source. The following code example explains the same. +To open a password-protected or encrypted PDF document, you can use the [LoadDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_LoadDocument_System_IO_Stream_System_String_) method by providing the password along with the document source. The following code example explains the same. {% tabs %} {% highlight c# %} @@ -23,7 +23,7 @@ In the above code snippet, `pdfDocumentStream` is the `Stream` instance read fro ## Detecting a password-protected document -You can identify whether a PDF document to be opened is a password-protected or not by using the [PasswordRequested](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PasswordRequested) event. This event triggers when the document to be loaded in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) requires a password. In this event handler method, you can set the [password](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PasswordRequestedEventArgs.html#Syncfusion_Maui_PdfViewer_PasswordRequestedEventArgs_Password) property from the [PasswordRequestedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PasswordRequestedEventArgs.html) with the correct password to load the document. Refer to the following code example. +You can identify whether a PDF document to be opened is a password-protected or not by using the [PasswordRequested](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PasswordRequested) event. This event triggers when the document to be loaded in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) requires a password. In this event handler method, you can set the [password](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PasswordRequestedEventArgs.html#Syncfusion_Maui_PdfViewer_PasswordRequestedEventArgs_Password) property from the [PasswordRequestedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PasswordRequestedEventArgs.html) with the correct password to load the document. Refer to the following code example. {% tabs %} {% highlight xaml %} @@ -50,7 +50,7 @@ private void PdfViewer_PasswordRequested(object sender, PasswordRequestedEventAr ## Handling password request -When attempting to open a password-protected document, the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) will display a default password prompt to obtain the user password to load the document. However, if you want to suppress the default password prompt and to can implement your own UI to obtain the user password by using the [PasswordRequested](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PasswordRequested) event. Set the [Handled](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Handled) property of the [PasswordRequestedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PasswordRequestedEventArgs.html) to `true` to disable the control’s default password prompt and handle your own logic to supply the password to open the document. +When attempting to open a password-protected document, the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) will display a default password prompt to obtain the user password to load the document. However, if you want to suppress the default password prompt and to can implement your own UI to obtain the user password by using the [PasswordRequested](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PasswordRequested) event. Set the [Handled](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.DocumentLoadFailedEventArgs.html#Syncfusion_Maui_PdfViewer_DocumentLoadFailedEventArgs_Handled) property of the [PasswordRequestedEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PasswordRequestedEventArgs.html) to `true` to disable the control’s default password prompt and handle your own logic to supply the password to open the document. {% tabs %} {% highlight xaml %} @@ -80,7 +80,7 @@ When attempting to open a password-protected document, the [SfPdfViewer](https:/ ### Creating a password request view -This is an example of how to create a custom password request dialog to ask for the user password and use the same to view the password-protected PDF document in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code snippets illustrate the creation of a custom password request dialog and viewing the documents, with a few code additions to the **Getting Started** example. +This is an example of how to create a custom password request dialog to ask for the user password and use the same to view the password-protected PDF document in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code snippets illustrate the creation of a custom password request dialog and viewing the documents, with a few code additions to the **Getting Started** example. **Step 1:** Create a custom password dialog view named `PasswordDialogBox` and add the functionalities to accept and validate the password, as shown below. @@ -257,7 +257,7 @@ public partial class PasswordDialogBox : ContentView {% endhighlight %} {% endtabs %} -**Step 2:** Add the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) and `PasswordDialogBox` elements to the `MainPage` and handle the functionalities to open a custom password request dialog and display the PDF document after providing a correct password, as shown below. +**Step 2:** Add the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) and `PasswordDialogBox` elements to the `MainPage` and handle the functionalities to open a custom password request dialog and display the PDF document after providing a correct password, as shown below. {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" %} @@ -351,7 +351,7 @@ public partial class MainPage : ContentPage ### Handling an invalid password -The [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event triggers when any password-protected document is loaded with a wrong or invalid password. You can handle the functionality based on your needs within this event handler method. +The [DocumentLoadFailed](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) event triggers when any password-protected document is loaded with a wrong or invalid password. You can handle the functionality based on your needs within this event handler method. {% tabs %} {% highlight xaml %} @@ -384,7 +384,7 @@ private void PdfViewer_DocumentLoadFailed(object sender, Syncfusion.Maui.PdfView {% endtabs %} ### Handling the correct password -If the entered password is correct, the document will be loaded into the PDF Viewer. At this moment, the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event will be triggered. You can handle this event to show a message indicating that the password is correct or to close the custom dialog. Refer to this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/documentloadnotifications#document-loaded-event) for more details. +If the entered password is correct, the document will be loaded into the PDF Viewer. At this moment, the [DocumentLoaded](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event will be triggered. You can handle this event to show a message indicating that the password is correct or to close the custom dialog. Refer to this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/documentloadnotifications#document-loaded-event) for more details. ## GitHub example The example project to open a password-protected document with a customized password request view can be downloaded [here](https://github.com/SyncfusionExamples/maui-pdf-viewer-examples). diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Page-Navigation.md b/Document-Processing/PDF/PDF-Viewer/maui/Page-Navigation.md index 155f749734..b0970f46f8 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Page-Navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Page-Navigation.md @@ -10,18 +10,18 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Page Navigation in .NET MAUI PDF Viewer (SfPdfViewer) -After loading a document, you can navigate or scroll to different pages using the page navigation options, either programmatically or by dragging the scroll head in the UI. This section walks through the page navigation functionalities supported in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +After loading a document, you can navigate or scroll to different pages using the page navigation options, either programmatically or by dragging the scroll head in the UI. This section walks through the page navigation functionalities supported in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). ## Page layout modes -The page layout modes of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allow users to change the layout of the pages while viewing PDF documents. These modes provide flexibility in viewing and navigating PDF pages, responding to various reading styles and document structures. The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the following Page layout modes: +The page layout modes of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allow users to change the layout of the pages while viewing PDF documents. These modes provide flexibility in viewing and navigating PDF pages, responding to various reading styles and document structures. The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the following Page layout modes: 1. Continuous 2. Single page ### Continuous layout mode -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html)’s default page layout mode is `Continuous`. In this mode, the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) displays pages in a continuous vertical scroll, is useful for documents containing a continuous flow of content. It enables users to scroll through the document with ease, providing a more fluid reading experience. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html)’s default page layout mode is `Continuous`. In this mode, the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) displays pages in a continuous vertical scroll, is useful for documents containing a continuous flow of content. It enables users to scroll through the document with ease, providing a more fluid reading experience. To enable the continuous page layout mode, you can call the following code in a button click. {% tabs %} @@ -39,7 +39,7 @@ void EnableContinuousPageLayoutMode() ### Single page layout mode -In single page layout mode, the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) shows one page at a time and allows users to swipe or scroll horizontally through the document. It provides a focused view, allowing readers to concentrate on a single page at a time without being distracted. +In single page layout mode, the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) shows one page at a time and allows users to swipe or scroll horizontally through the document. It provides a focused view, allowing readers to concentrate on a single page at a time without being distracted. To enable the single page layout mode, you can call the following code in a button click. {% tabs %} @@ -55,11 +55,11 @@ void EnableSinglePageLayoutMode() {% endhighlight %} {% endtabs %} -N> You can download the **Custom Toolbar** sample project for the .NET MAUI PDF Viewer [here](https://github.com/SyncfusionExamples/maui-pdf-viewer-examples) , which demonstrates functionality related to the [PageLayoutMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PageLayoutMode.html) feature. +N> You can download the **Custom Toolbar** sample project for the .NET MAUI PDF Viewer [here](https://github.com/SyncfusionExamples/maui-pdf-viewer-examples) , which demonstrates functionality related to the [PageLayoutMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PageLayoutMode.html) feature. ## Obtain the total page count and the current page number -The [PageCount](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PageCount) property returns the total number of pages in a PDF document. And the [PageNumber](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PageNumber) property returns the current page number displayed in the PDF Viewer. +The [PageCount](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PageCount) property returns the total number of pages in a PDF document. And the [PageNumber](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PageNumber) property returns the current page number displayed in the PDF Viewer. {% tabs %} {% highlight c# %} @@ -72,7 +72,7 @@ int currentPageNumber = PdfViewer.PageNumber; ## Navigate to the desired page programmatically -The [GoToPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToPage_System_Int32_) method helps you navigate to the specified page number in a PDF document. If the destination page doesn’t exist, then the navigation will not happen, and the older page will be retained. Refer to the following code example: +The [GoToPage](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToPage_System_Int32_) method helps you navigate to the specified page number in a PDF document. If the destination page doesn’t exist, then the navigation will not happen, and the older page will be retained. Refer to the following code example: {% tabs %} {% highlight c# %} @@ -83,7 +83,7 @@ PdfViewer.GoToPage(4); ## Navigate to the next and previous pages programmatically -The [GoToNextPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToNextPage) and [GoToPreviousPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToPreviousPage) methods help you navigate to the next and previous pages of a PDF document. Refer to the following code example: +The [GoToNextPage](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToNextPage) and [GoToPreviousPage](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToPreviousPage) methods help you navigate to the next and previous pages of a PDF document. Refer to the following code example: {% tabs %} {% highlight c# %} @@ -103,7 +103,7 @@ private void PreviousPageButton_Clicked(object sender, EventArgs e) ## Navigate to the first and last page programmatically -The [GoToFirstPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToFirstPage) and [GoToLastPage](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToLastPage) methods help you navigate to the first and last pages of a PDF document. Refer to the following code example: +The [GoToFirstPage](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToFirstPage) and [GoToLastPage](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToLastPage) methods help you navigate to the first and last pages of a PDF document. Refer to the following code example: {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Print-a-Document.md b/Document-Processing/PDF/PDF-Viewer/maui/Print-a-Document.md index 855d9ba010..f236d4edc0 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Print-a-Document.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Print-a-Document.md @@ -14,7 +14,7 @@ Print PDFs directly from your app using the viewer's built-in print integration. N> Note: On some platforms the system print dialog controls options such as paper size and print quality — collect any user-specific print options in your UI and pass them to the print API where supported. -To print a PDF programmatically, use the [PrintDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PrintDocument) method. For example, call it from a toolbar or a Print button's click handler. +To print a PDF programmatically, use the [PrintDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PrintDocument) method. For example, call it from a toolbar or a Print button's click handler. {% tabs %} {% highlight c# tabtitle="MainPage.xaml.cs" %} @@ -26,7 +26,7 @@ private void PrintButton_Clicked(object sender, EventArgs e) {% endhighlight %} {% endtabs %} -Also, [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) provides another way to print through command binding using the [PrintDocumentCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PrintDocumentCommand). This makes printing easier, especially when used with buttons. +Also, [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) provides another way to print through command binding using the [PrintDocumentCommand](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_PrintDocumentCommand). This makes printing easier, especially when used with buttons. {% tabs %} {% highlight xaml %} @@ -41,12 +41,12 @@ Below is an example of the print preview dialog on the Android platform. The app ## How to adjust the print quality on the Windows platform? -[SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows users to adjust the printing quality on the Windows platform using the [PrintSettings.PrintQuality](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PrintSettings.html#Syncfusion_Maui_PdfViewer_PrintSettings_PrintQuality) API. The [PrintQuality](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PrintQuality.html) enumeration supports the below quality levels: -* [Low](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_Low) - Optimizes print speed and uses minimal memory during printing. -* [Default](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_Default) - Suitable for standard text and basic graphics, while maintaining the quality of previous versions. This is the default value. -* [Medium](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_Medium) - Balances clarity and performance during printing. -* [High](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_High) - Ensures sharper lines and crisp small annotations in the output. -* [Ultra](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_Ultra) - Optimizes the detail on large-format print documents like CAD drawings and architectural plans. +[SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows users to adjust the printing quality on the Windows platform using the [PrintSettings.PrintQuality](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PrintSettings.html#Syncfusion_Maui_PdfViewer_PrintSettings_PrintQuality) API. The [PrintQuality](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PrintQuality.html) enumeration supports the below quality levels: +* [Low](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_Low) - Optimizes print speed and uses minimal memory during printing. +* [Default](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_Default) - Suitable for standard text and basic graphics, while maintaining the quality of previous versions. This is the default value. +* [Medium](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_Medium) - Balances clarity and performance during printing. +* [High](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_High) - Ensures sharper lines and crisp small annotations in the output. +* [Ultra](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PrintQuality.html#Syncfusion_Maui_PdfViewer_PrintQuality_Ultra) - Optimizes the detail on large-format print documents like CAD drawings and architectural plans. {% tabs %} {% highlight c# %} @@ -55,7 +55,7 @@ PdfViewer.PrintSettings.PrintQuality = PrintQuality.High; {% endhighlight %} {% endtabs %} -N> The [PrintQuality](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.PrintSettings.html#Syncfusion_Maui_PdfViewer_PrintSettings_PrintQuality) API is only applicable to the Windows platform and does not affect printing on Android, iOS, or macOS. +N> The [PrintQuality](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.PrintSettings.html#Syncfusion_Maui_PdfViewer_PrintSettings_PrintQuality) API is only applicable to the Windows platform and does not affect printing on Android, iOS, or macOS. ## Detecting Print Completion with PrintDocumentCompleted @@ -87,7 +87,7 @@ private void OnPrintDocumentCompleted(object? sender, PrintDocumentCompletedEven ## Limitations -Currently, when printing a document that contains sticky note annotations, the sticky note icon always appears as the default [comment](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.StickyNoteIcon.html#Syncfusion_Maui_PdfViewer_StickyNoteIcon_Comment) icon appearance in the printed document. +Currently, when printing a document that contains sticky note annotations, the sticky note icon always appears as the default [comment](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.StickyNoteIcon.html#Syncfusion_Maui_PdfViewer_StickyNoteIcon_Comment) icon appearance in the printed document. ## See Also - [Save a Document](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/save-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md b/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md index c3fb16a8c0..8dc5dd3eae 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Redaction.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Redaction in .NET MAUI PDF Viewer (SfPdfViewer) -Before sharing a PDF externally, use redaction to permanently remove sensitive data — such as personal details, financial figures, or confidential text — from the document. Unlike simply covering content with a shape or annotation, redaction in [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) eliminates the underlying content entirely once the document is saved, making recovery impossible. +Before sharing a PDF externally, use redaction to permanently remove sensitive data — such as personal details, financial figures, or confidential text — from the document. Unlike simply covering content with a shape or annotation, redaction in [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) eliminates the underlying content entirely once the document is saved, making recovery impossible. ## Types of Redactions @@ -39,14 +39,14 @@ The following image represents how to perform redactions using the toolbar on mo ## Mark regions for redaction without using the toolbar -You can mark the region for redaction in a PDF document with UI interaction using touch or mouse using the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to mark the region on a PDF. +You can mark the region for redaction in a PDF document with UI interaction using touch or mouse using the [RedactionMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to mark the region on a PDF. -1. Set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to Text or Rect. It activates the text-based or selected-area Redaction mode on the control. +1. Set the [RedactionMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to Text or Rect. It activates the text-based or selected-area Redaction mode on the control. 2. Place your finger (or mouse) on the text in the PDF document, where you want to start redaction. 3. Drag the finger (or cursor) across the text to select. 4. Complete adding the region to the selected text or area by releasing the finger (or cursor). -5. Once you have done that, set the [RedactionMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) to None. It will disable the redaction mode and save the marked region for redaction. -6. You can later redact the marked regions using [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method. +5. Once you have done that, set the [RedactionMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionMode) to None. It will disable the redaction mode and save the marked region for redaction. +6. You can later redact the marked regions using [RedactAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method. The following code explains how to enable the text-based redaction mode. @@ -55,14 +55,14 @@ The following code explains how to enable the text-based redaction mode. // Enable or activate the text-based redaction mode. void EnableTextBasedRedactionMode() { - // Set the redaction mode to text using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the redaction mode to text using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.RedactionMode = RedactionMode.Text; } // Enable or activate the area redaction mode. void EnableSelectedAreaRedactionMode() { - // Set the redaction mode to rect using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the redaction mode to rect using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.RedactionMode = RedactionMode.Rect; } {% endhighlight %} @@ -75,7 +75,7 @@ Similarly, refer to the following code to disable the redaction mode. //Disable redaction mode after marking the region. void DisableRedactionMode() { - // Set the redaction mode to none using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the redaction mode to none using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.RedactionMode = RedactionMode.None; } {% endhighlight %} @@ -85,7 +85,7 @@ void DisableRedactionMode() ### Add redaction mark on the PDF -You can mark regions for text or specific areas programmatically using the [AddRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), and redact entire pages using the [AddPageRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddPageRedactionMarks_System_Collections_Generic_List_System_Int32__) method. The following example demonstrates how to mark regions for redaction, such as a specific area and page in the PDF document. +You can mark regions for text or specific areas programmatically using the [AddRedactionMark](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), and redact entire pages using the [AddPageRedactionMarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddPageRedactionMarks_System_Collections_Generic_List_System_Int32__) method. The following example demonstrates how to mark regions for redaction, such as a specific area and page in the PDF document. {% tabs %} {% highlight C# %} @@ -109,7 +109,7 @@ void AddRedactionMarkOnSpecificRegionAndPages() ### Remove the selected redaction mark on the PDF -You can remove a redaction mark for text, a specific area, or a page programmatically using the [SelectedRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectedRedactionMark) property and the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of SfPdfViewer. To remove a redaction mark, select the specific mark you want to delete and pass it to the [RemoveRedactionMark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method. The following example demonstrates how to remove a selected redaction mark from the PDF document. +You can remove a redaction mark for text, a specific area, or a page programmatically using the [SelectedRedactionMark](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectedRedactionMark) property and the [RemoveRedactionMark](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method of SfPdfViewer. To remove a redaction mark, select the specific mark you want to delete and pass it to the [RemoveRedactionMark](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveRedactionMark_Syncfusion_Maui_PdfViewer_RedactionMark_) method. The following example demonstrates how to remove a selected redaction mark from the PDF document. {% tabs %} {% highlight C# %} @@ -127,13 +127,13 @@ void RemoveSelectedRedactionMark() ### Remove all the redaction marks in the PDF -You can remove all redaction marks from a document programmatically by calling the [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method. The following example demonstrates how to remove all redaction marks from a PDF document. +You can remove all redaction marks from a document programmatically by calling the [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method. The following example demonstrates how to remove all redaction marks from a PDF document. {% tabs %} {% highlight C# %} void RemoveAllRedactionMarksDrawn() { - // Removes all the redaction marks from a PDF document using [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). + // Removes all the redaction marks from a PDF document using [RemoveAllRedactionMarks](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAllRedactionMarks) method of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). PdfViewer.RemoveAllRedactionMarks(); } {% endhighlight %} @@ -141,7 +141,7 @@ void RemoveAllRedactionMarksDrawn() ### Redact the marked region -You can redact the marked regions by using the [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This method redacts all marked regions and saves the document, making the changes irreversible. The following example demonstrates how to redact a marked region or page in a PDF document. +You can redact the marked regions by using the [RedactAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_) method of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This method redacts all marked regions and saves the document, making the changes irreversible. The following example demonstrates how to redact a marked region or page in a PDF document. {% tabs %} {% highlight C# %} @@ -155,7 +155,7 @@ private async void RedactMarkedRegion() ## Customize the default redaction appearance -In redaction mode, the redaction is applied with a default appearance and behavior. You can modify these settings before marking regions on the pages. To define the appearance and behavior, customize the default settings using the [RedactionSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +In redaction mode, the redaction is applied with a default appearance and behavior. You can modify these settings before marking regions on the pages. To define the appearance and behavior, customize the default settings using the [RedactionSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactionSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example demonstrates how to obtain the default redaction settings and modify their appearance properties. Similarly, you can modify other available properties. {% tabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Right-To-Left.md b/Document-Processing/PDF/PDF-Viewer/maui/Right-To-Left.md index d00d3b239d..ca4bbaca58 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Right-To-Left.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Right-To-Left.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Right-to-Left Layout in .NET MAUI PDF Viewer (SfPdfViewer) -By default, the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control is laid out in the left-to-right flow direction. For the convenience of right-to-left language users, it enables changing the flow direction to right-to-left (RTL). This can be achieved by setting the [FlowDirection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.iview.flowdirection?view=net-maui-7.0) property to `RightToLeft`. +By default, the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control is laid out in the left-to-right flow direction. For the convenience of right-to-left language users, it enables changing the flow direction to right-to-left (RTL). This can be achieved by setting the [FlowDirection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.iview.flowdirection?view=net-maui-7.0) property to `RightToLeft`. Setting the [FlowDirection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.iview.flowdirection?view=net-maui-7.0) property to `RightToLeft` on the SfPdfViewer sets the alignment to the right, and layouts the built-in controls used in the SfPdfViewer to flow from right-to-left. Refer to the following code example to apply the same. {% tabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Save-a-Document.md b/Document-Processing/PDF/PDF-Viewer/maui/Save-a-Document.md index 807a3e23b2..c4634d0f11 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Save-a-Document.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Save-a-Document.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Save a Document in .NET MAUI PDF Viewer (SfPdfViewer) -After annotating, filling forms, or applying redactions, use the PDF Viewer's save methods to persist all changes back to a file stream. You can save synchronously with [SaveDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocument_System_IO_Stream_) or asynchronously with [SaveDocumentAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocumentAsync_System_IO_Stream_System_Threading_CancellationToken_) — and optionally flatten annotations or form fields into static content at the same time. +After annotating, filling forms, or applying redactions, use the PDF Viewer's save methods to persist all changes back to a file stream. You can save synchronously with [SaveDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocument_System_IO_Stream_) or asynchronously with [SaveDocumentAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocumentAsync_System_IO_Stream_System_Threading_CancellationToken_) — and optionally flatten annotations or form fields into static content at the same time. The following example explains how to save the modified document if the document needs to be saved in the application’s data directory. @@ -36,7 +36,7 @@ private void SaveDocument() ## Save a document asynchronously -To save a document without blocking the UI thread, use the [SaveDocumentAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocumentAsync_System_IO_Stream_System_Threading_CancellationToken_) method. This is the recommended approach for saving from event handlers or UI interactions. An optional [CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken) can be passed to cancel the operation if needed. +To save a document without blocking the UI thread, use the [SaveDocumentAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocumentAsync_System_IO_Stream_System_Threading_CancellationToken_) method. This is the recommended approach for saving from event handlers or UI interactions. An optional [CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken) can be passed to cancel the operation if needed. {% tabs %} {% highlight c# %} @@ -59,15 +59,15 @@ private async Task SaveDocumentAsync() ## Flatten annotations and form fields on save -Flattening refers to the process of converting interactive elements, such as annotations and form fields, into a static, non-editable format within a PDF document. The SfPdfViewer allows you to save the annotations and form fields by flattening using the [FlattenOnSave](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_FlattenOnSave) API. +Flattening refers to the process of converting interactive elements, such as annotations and form fields, into a static, non-editable format within a PDF document. The SfPdfViewer allows you to save the annotations and form fields by flattening using the [FlattenOnSave](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_FlattenOnSave) API. ### Flatten the annotation on save -The [FlattenOnSave](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_FlattenOnSave) API helps you to flatten the specified annotation in a PDF document. The following code sample explains how to flatten the first annotation from the annotation collection. +The [FlattenOnSave](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_FlattenOnSave) API helps you to flatten the specified annotation in a PDF document. The following code sample explains how to flatten the first annotation from the annotation collection. {% tabs %} {% highlight c# %} -// Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. +// Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection annotations = PdfViewer.Annotations; // Obtain the first annotation in the annotation collection. Annotation annotation = annotations[0]; @@ -78,11 +78,11 @@ annotation.FlattenOnSave = true; ### Flatten form field on save -The [FlattenOnSave](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_FlattenOnSave) API helps you to flatten the specified form field in a PDF document. The following code sample explains how to flatten the first form field from the form field collection. +The [FlattenOnSave](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.Annotation.html#Syncfusion_Maui_PdfViewer_Annotation_FlattenOnSave) API helps you to flatten the specified form field in a PDF document. The following code sample explains how to flatten the first form field from the form field collection. {% tabs %} {% highlight c# %} -// Obtain the form field collection using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. +// Obtain the form field collection using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection formFields = PdfViewer.FormFields; // Obtain the first form field in the form fields collection. FormField formField = formFields[0]; @@ -93,7 +93,7 @@ formField.FlattenOnSave = true; ### Limitation -Currently, when saving a document by flattening that contains sticky note annotations, the sticky note icon always appears as the default [comment](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.StickyNoteIcon.html#Syncfusion_Maui_PdfViewer_StickyNoteIcon_Comment) icon appearance in the saved document. +Currently, when saving a document by flattening that contains sticky note annotations, the sticky note icon always appears as the default [comment](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.StickyNoteIcon.html#Syncfusion_Maui_PdfViewer_StickyNoteIcon_Comment) icon appearance in the saved document. ## See Also - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Select-Deselect-Annotations.md b/Document-Processing/PDF/PDF-Viewer/maui/Select-Deselect-Annotations.md index 7e74ef06cd..9009cdc53a 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Select-Deselect-Annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Select-Deselect-Annotations.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Select and Deselect Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -This section will go through the various functions available in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for selecting and deselecting annotations in a PDF document. +This section will go through the various functions available in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for selecting and deselecting annotations in a PDF document. ## Select an annotation @@ -20,13 +20,13 @@ You can select an annotation by simply tapping on the annotation using touch or ### Select an annotation programmatically -You can select an annotation programmatically by providing the annotation instance as the parameter to the [SelectAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The annotation instance can be found in the Annotations property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to select the first annotation in the annotation collection. +You can select an annotation programmatically by providing the annotation instance as the parameter to the [SelectAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SelectAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The annotation instance can be found in the Annotations property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to select the first annotation in the annotation collection. {% tabs %} {% highlight c# %} void SelectAnnotation() { - // Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the annotation collection using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ReadOnlyObservableCollection annotations = PdfViewer.Annotations; // Select the first annotation in the collection using the `SelectAnnotation` method of the `SfPdfViewer` instance. @@ -37,13 +37,13 @@ void SelectAnnotation() ### Customizing selector appearance -The [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property of SfPdfViewer allows you to customize the default selector color. The following example explains how to customize the selector color for locked and unlocked annotations. +The [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property of SfPdfViewer allows you to customize the default selector color. The following example explains how to customize the selector color for locked and unlocked annotations. {% tabs %} {% highlight c# %} void CustomizeSelectorAppearance() { - // Customize the selector color for unlocked annotations using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Customize the selector color for unlocked annotations using the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationSettings.Selector.Color = Colors.Blue; // Customize the selector color for locked annotations using the `AnnotationSettings` property of `SfPdfViewer` instancehttps://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui @@ -60,13 +60,13 @@ The following images represent the customized selector color of an unlocked and ### AnnotationSelected event -The [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event occurs when an annotation is selected interactively or programmatically. The selected annotation instance will be provided through the [Annotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationEventArgs.html#Syncfusion_Maui_PdfViewer_AnnotationEventArgs_Annotation) property of the event arguments. The following example explains how to wire the event to obtain and modify the selected annotation properties. +The [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event occurs when an annotation is selected interactively or programmatically. The selected annotation instance will be provided through the [Annotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationEventArgs.html#Syncfusion_Maui_PdfViewer_AnnotationEventArgs_Annotation) property of the event arguments. The following example explains how to wire the event to obtain and modify the selected annotation properties. {% tabs %} {% highlight c# %} void WireAnnotationSelectedEvent() { - // Wire the annotation selected event of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). + // Wire the annotation selected event of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). PdfViewer.AnnotationSelected += OnAnnotationSelected; } @@ -83,7 +83,7 @@ private void OnAnnotationSelected(object sender, AnnotationEventArgs e) ### Remove the selected annotation -You can remove the selected annotation programmatically by providing the selected annotation instance as the parameter to the [RemoveAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to remove the selected annotation. +You can remove the selected annotation programmatically by providing the selected annotation instance as the parameter to the [RemoveAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RemoveAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to remove the selected annotation. {% tabs %} {% highlight c# %} @@ -104,7 +104,7 @@ void RemoveSelectedAnnotation(Annotation selectedAnnotation) ### Edit the selected annotation -You can edit the properties of the selected annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit the selected annotation, assuming that the annotation is a circle type. +You can edit the properties of the selected annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit the selected annotation, assuming that the annotation is a circle type. {% tabs %} {% highlight c# %} @@ -138,7 +138,7 @@ You can deselect an annotation by simply tapping outside of its bounds using tou ### Deselect an annotation programmatically -You can deselect the annotation programmatically by providing the selected annotation instance as the parameter to the [DeselectAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DeselectAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to deselect the selected annotation. +You can deselect the annotation programmatically by providing the selected annotation instance as the parameter to the [DeselectAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DeselectAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to deselect the selected annotation. {% tabs %} {% highlight c# %} @@ -148,7 +148,7 @@ You can deselect the annotation programmatically by providing the selected annot /// The selected annotation instance that may be obtained from the annotation selected event void DeselectAnnotation(Annotation selectedAnnotation) { - // Deselect the annotation using the DeSelectAnnotation method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. + // Deselect the annotation using the DeSelectAnnotation method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. PdfViewer.DeselectAnnotation(selectedAnnotation); } {% endhighlight %} @@ -156,13 +156,13 @@ void DeselectAnnotation(Annotation selectedAnnotation) ### AnnotationDeselected event -The [AnnotationDeselected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationDeselected) event occurs when an annotation is selected interactively or programmatically. The following example explains how to wire the event to obtain the deselected annotation. +The [AnnotationDeselected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationDeselected) event occurs when an annotation is selected interactively or programmatically. The following example explains how to wire the event to obtain the deselected annotation. {% tabs %} {% highlight c# %} void WireAnnotationDeselectedEvent() { - // Wire the annotation deselected event of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. + // Wire the annotation deselected event of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. PdfViewer.AnnotationDeselected += OnAnnotationDeselected; } diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md b/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md index 39557b0c21..6d97b89d07 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Shapes.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, mau # Shape Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The shape annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify shapes in the PDF document. This is useful for making corrections or emphasizing important points in the document. This section explains the various types and functions available in the PDF Viewer for working with shape annotations. +The shape annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify shapes in the PDF document. This is useful for making corrections or emphasizing important points in the document. This section explains the various types and functions available in the PDF Viewer for working with shape annotations. ## Types of shapes @@ -43,37 +43,37 @@ The following image represents how to add the circle annotations using the toolb You can interactively draw and add shape annotations to a PDF document by touch pointer or by dragging the mouse down. The following steps explain how to draw a circle-shaped annotation on a PDF. Similarly, you can draw other shapes like arrows, lines, and rectangles. -1. Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the SfPdfViewer to any shape (say [Circle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Circle)). It activates the circle drawing mode on the control. +1. Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the SfPdfViewer to any shape (say [Circle](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Circle)). It activates the circle drawing mode on the control. 2. Place your finger (or mouse) on the screen where you want to start drawing the circle. 3. Draw the circle by dragging the finger (or cursor) across the screen. 4. Finish the circle by releasing the finger (or cursor). 5. Repeat steps 2-4, if you want to create multiple circles on other areas during the drawing mode. -6. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). This will disable the circle drawing mode and save the drawn circles to the PDF pages as circle annotations. +6. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). This will disable the circle drawing mode and save the drawn circles to the PDF pages as circle annotations. 7. You can later move, resize, or edit the annotation. ### Add polygon and polyline shapes Adding polygon and polyline shapes with a touch or mouse differs slightly from adding other shape types. To add one interactively, refer to the following steps. -1. Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [Polygon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Polygon) or [Polyline](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Polyline). It sets the control’s drawing mode to polygon or polyline, respectively. +1. Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [Polygon](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Polygon) or [Polyline](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Polyline). It sets the control’s drawing mode to polygon or polyline, respectively. 2. To begin drawing the shape, tap the desired location on the screen (using touch or mouse). 3. Drag the mouse pointer to a different location or just tap there. This will complete the first line segment. 4. To create multiple connected line segments, repeat step 3 at the necessary locations. 5. Double tap to finish drawing the shape. The shape will be added to the PDF page. 6. To create multiple shapes in other areas during the drawing mode, repeat steps 2-5. -7. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to disable the drawing mode. +7. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to disable the drawing mode. 8. You can later move, resize, or edit the annotation. #### Enable or disable shape annotation (drawing) mode -The following code explains how to enable the [circle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Circle) annotation mode. Similarly, you can do the same for other annotations. +The following code explains how to enable the [circle](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Circle) annotation mode. Similarly, you can do the same for other annotations. {% tabs %} {% highlight C# %} // Enable or activate the circle drawing mode. void EnableCircleDrawingMode() { - // Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to [Circle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Circle). + // Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to [Circle](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Circle). PdfViewer.AnnotationMode = AnnotationMode.Circle; } {% endhighlight %} @@ -86,7 +86,7 @@ Similarly, refer to the following code to disable the circle annotation mode. // Disable or deactivate the circle drawing mode. void DisableCircleDrawingMode() { - // Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to [None] (https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). + // Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to [None] (https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). PdfViewer.AnnotationMode = AnnotationMode.None; } {% endhighlight %} @@ -94,7 +94,7 @@ void DisableCircleDrawingMode() ### Add shapes programmatically -You can create and add a circle annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a circle annotation and add it to the first page of a PDF document. Similarly, you can add other shapes also. +You can create and add a circle annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a circle annotation and add it to the first page of a PDF document. Similarly, you can add other shapes also. {% tabs %} {% highlight C# %} @@ -128,7 +128,7 @@ void AddCircleAnnotation() ## Shape annotation settings -In the shape annotation mode, the shape annotations will be drawn with a default appearance. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance before drawing on the document, you can change its default settings using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). For that, you need to obtain the default shape annotation settings. +In the shape annotation mode, the shape annotations will be drawn with a default appearance. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance before drawing on the document, you can change its default settings using the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). For that, you need to obtain the default shape annotation settings. The following example explains how to obtain the default circle annotation settings and modify some of its properties. Similarly, you can also modify the properties of other shape annotations. @@ -136,7 +136,7 @@ The following example explains how to obtain the default circle annotation setti {% highlight c# %} void CustomizeDefaultCircleSettings() { - //Obtain the default circle annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + //Obtain the default circle annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. ShapeAnnotationSettings circleAnnotationSettings = PdfViewer.AnnotationSettings.Circle; //Modify the default properties. @@ -151,7 +151,7 @@ void CustomizeDefaultCircleSettings() ## Edit the selected shape annotation -You can edit the properties of the selected shape annotation programmatically by accessing the selected annotation instance. You can obtain the selected annotation instance from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected circle annotation. Similarly, you can modify the other shape annotation properties. +You can edit the properties of the selected shape annotation programmatically by accessing the selected annotation instance. You can obtain the selected annotation instance from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected circle annotation. Similarly, you can modify the other shape annotation properties. {% tabs %} {% highlight C# %} @@ -174,7 +174,7 @@ void EditSelectedCircleAnnotation(Annotation selectedAnnotation) ## Border styles for shape annotation -[SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to change the shape annotations' border style. Currently, it provides support for the following border styles. +[SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to change the shape annotations' border style. Currently, it provides support for the following border styles. 1. Cloudy 2. Solid @@ -182,7 +182,7 @@ N> By default, the border style of the shape annotations is solid. The value of ### Draw a cloud-shaped annotation -To draw a cloud annotation, set the annotation mode to either [AnnotationMode.Square](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html) or [AnnotationMode.Polygon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html). Then you should set the `BorderStyle` property of the shape annotation settings to `BorderStyle.Cloudy`. The following sample code illustrates how to draw a square and polygon annotation with the cloud border style. +To draw a cloud annotation, set the annotation mode to either [AnnotationMode.Square](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html) or [AnnotationMode.Polygon](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html). Then you should set the `BorderStyle` property of the shape annotation settings to `BorderStyle.Cloudy`. The following sample code illustrates how to draw a square and polygon annotation with the cloud border style. {% tabs %} {% highlight c# %} @@ -206,7 +206,7 @@ To draw a cloud annotation, set the annotation mode to either [AnnotationMode.Sq ### Change the border style for the selected polygon annotation -You can change the border style of the selected polygon annotation programmatically by accessing the selected annotation instance. You can obtain the selected annotation instance from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to change the border style of the selected polygon annotation. Similarly, you can modify the square annotation's border style. +You can change the border style of the selected polygon annotation programmatically by accessing the selected annotation instance. You can obtain the selected annotation instance from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to change the border style of the selected polygon annotation. Similarly, you can modify the square annotation's border style. {% tabs %} {% highlight c# %} @@ -235,7 +235,7 @@ You can add cloud annotation to a PDF document using the built-in toolbar. ### Add a cloud shape annotation programmatically -You can create and add a cloud polygon annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a cloud polygon annotation and add it to the first page of a PDF document. Similarly, you can add a square. +You can create and add a cloud polygon annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a cloud polygon annotation and add it to the first page of a PDF document. Similarly, you can add a square. {% tabs %} {% highlight c# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Show-Hide.md b/Document-Processing/PDF/PDF-Viewer/maui/Show-Hide.md index 01f76bed97..e59af70e89 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Show-Hide.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Show-Hide.md @@ -80,7 +80,7 @@ private void HideAnnotationButton_Clicked(object sender, EventArgs e) * Similarly, to show the annotation, set the `Hidden` property value to `false`. N> * On iOS and Mac, while printing a document containing hidden annotations, the hidden annotations will be visible in the print preview or the printed document. -N> * When a document containing hidden annotations is loaded, it will not only disappear in the UI but also will not be added to the [SfPdfViewer.Annotations](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) collection as well. +N> * When a document containing hidden annotations is loaded, it will not only disappear in the UI but also will not be added to the [SfPdfViewer.Annotations](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_Annotations) collection as well. ## See Also - [Annotations Overview](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/annotations-overview) diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Signature.md b/Document-Processing/PDF/PDF-Viewer/maui/Signature.md index 723e31ea54..9584d7e633 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Signature.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Signature.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Electronic Signature in .NET MAUI PDF Viewer (SfPdfViewer) -The electronic signature feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove signatures in the PDF document. This section will go through the various types and functions available in PDF Viewer for working with signature. +The electronic signature feature of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove signatures in the PDF document. This section will go through the various types and functions available in PDF Viewer for working with signature. You can also watch our video tutorial below to learn about working with electronic signatures. @@ -30,21 +30,21 @@ This section will go through how to add a signature by UI interaction to a PDF d You can add a signature to a PDF document with UI interaction using the signature dialog. The following steps explain how to add signature on a PDF. -1. Set the AnnotationMode property of the SfPdfViewer to [Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Signature). It activates the signature mode on the control and signature dialog box will be open. +1. Set the AnnotationMode property of the SfPdfViewer to [Signature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Signature). It activates the signature mode on the control and signature dialog box will be open. 2. Create a signature in any one of the types. 3. You can customize the color of the signature for handwritten and text signature types. 4. Tap on the page to add the created signatures. 5. After creating the signature or closing the dialog, the signature mode will be disabled, and the AnnotationMode will be changed to None. 6. You can later move, resize, or delete the signature. -The following code explains how to enable the [Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Signature) annotation mode. +The following code explains how to enable the [Signature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Signature) annotation mode. {% tabs %} {% highlight c# %} // Enable or activate the signature mode. void EnableSignatureMode() { - // Set the annotation mode to signature using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the annotation mode to signature using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationMode = AnnotationMode.Signature; } {% endhighlight %} @@ -57,7 +57,7 @@ Similarly, refer to the following code to disable the signature mode. // Disable or deactivate the signature mode. void DisableSignatureMode() { - // Set the annotation mode to none using the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Set the annotation mode to none using the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. PdfViewer.AnnotationMode = AnnotationMode.None; } {% endhighlight %} @@ -69,7 +69,7 @@ This section will go through how to add a signature programmatically to a PDF do ### Add a handwritten signature -To add a handwritten signature, you can create and add an ink annotation to a PDF document programmatically using the AddAnnotation method of the SfPdfViewer. Additionally, in the case of a signature, you should set the [IsSignature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_IsSignature) API of the ink annotation to true. The following example explains how to create an ink annotation and add it as a signature to the first page of a PDF document. +To add a handwritten signature, you can create and add an ink annotation to a PDF document programmatically using the AddAnnotation method of the SfPdfViewer. Additionally, in the case of a signature, you should set the [IsSignature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_IsSignature) API of the ink annotation to true. The following example explains how to create an ink annotation and add it as a signature to the first page of a PDF document. {% tabs %} {% highlight c# %} @@ -84,7 +84,7 @@ List> pointsCollection = new List>() // Create an ink annotation. InkAnnotation annotation = new InkAnnotation(pointsCollection, pageNumber); -// Set [IsSignature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_IsSignature) as true +// Set [IsSignature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_IsSignature) as true annotation.IsSignature = true; // Add the ink annotation to the PDF page as a signature @@ -94,7 +94,7 @@ PdfViewer.AddAnnotation(annotation); ### Add image signature -To add an image signature, you can create and add a custom stamp annotation to a PDF document programmatically using the AddAnnotation method of the SfPdfViewer. Additionally, in the case of a signature, you should set the [IsSignature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_IsSignature) API of the stamp annotation to true. The following example explains how to create a custom stamp annotation and add it as a signature to the first page of a PDF document +To add an image signature, you can create and add a custom stamp annotation to a PDF document programmatically using the AddAnnotation method of the SfPdfViewer. Additionally, in the case of a signature, you should set the [IsSignature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_IsSignature) API of the stamp annotation to true. The following example explains how to create a custom stamp annotation and add it as a signature to the first page of a PDF document {% tabs %} {% highlight c# %} @@ -109,7 +109,7 @@ Stream imageStream = this.GetType().Assembly.GetManifestResourceStream("Annotati // Create a custom stamp annotation using the image stream. StampAnnotation customStamp = new StampAnnotation(imageStream,pageNumber,bounds); -// Set [IsSignature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_IsSignature) as true +// Set [IsSignature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotation.html#Syncfusion_Maui_PdfViewer_InkAnnotation_IsSignature) as true customStamp.IsSignature = true; // Add the stamp annotation to the PDF page as a signature @@ -121,7 +121,7 @@ N> To add a text signature, you can use an image containing the signature text . ## Signature modal view -The signature modal view appears when a signature needs to be created. The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) notifies when the modal view is appearing and disappearing through events. The events help you in hiding and showing elements that are part of the app UI that are not necessary as long as the modal view is visible. +The signature modal view appears when a signature needs to be created. The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) notifies when the modal view is appearing and disappearing through events. The events help you in hiding and showing elements that are part of the app UI that are not necessary as long as the modal view is visible. **Mobile:** ![Signature pad modal view mobile](Images/Annotations/signature-pad-modal-view-mobile.png) @@ -161,7 +161,7 @@ Private void PdfViewer_SignatureModalViewDisappearing(object? Sender, EventArgs ### Suppressing the signature modal view and implement your own UI -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the signature modal view and use your own UI in its place. This can be achieved by setting the `FormFieldModalViewAppearingEventArgs.Cancel` property to `true` in the `SignatureModalViewAppearing` event handler. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the signature modal view and use your own UI in its place. This can be achieved by setting the `FormFieldModalViewAppearingEventArgs.Cancel` property to `true` in the `SignatureModalViewAppearing` event handler. The below code snippet illustrates suppressing the signature modal view and using a UI implemented in the app in its place. In this illustration, it is assumed that the signature is produced in the form of an image stream when the user completes drawing the signature in the custom dialog. When the PDF viewer is tapped, the created signature is added as a stamp annotation. @@ -198,9 +198,9 @@ private void PdfViewer_Tapped(object sender, GestureEventArgs e) ## Signature Created Event -The [SignatureCreated](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SignatureCreated) event in the .NET MAUI PDF Viewer provides a way to access and customize the properties of a handwritten signature immediately after it is created using built-in signature dialog. This is especially helpful when you want to apply consistent styling such as stroke color, border width, or opacity to all handwritten signatures. +The [SignatureCreated](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SignatureCreated) event in the .NET MAUI PDF Viewer provides a way to access and customize the properties of a handwritten signature immediately after it is created using built-in signature dialog. This is especially helpful when you want to apply consistent styling such as stroke color, border width, or opacity to all handwritten signatures. -To customize the signature, check whether the [e.Signature](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SignatureCreatedEventArgs.html#Syncfusion_Maui_PdfViewer_SignatureCreatedEventArgs_Signature) object is of type [InkAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.InkAnnotation.html), which represents a handwritten ink-based signature. If it is, you can modify its properties as needed. +To customize the signature, check whether the [e.Signature](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SignatureCreatedEventArgs.html#Syncfusion_Maui_PdfViewer_SignatureCreatedEventArgs_Signature) object is of type [InkAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.InkAnnotation.html), which represents a handwritten ink-based signature. If it is, you can modify its properties as needed. The following example demonstrates how to handle the SignatureCreated event and apply custom styling to a handwritten signature: diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Stamps.md b/Document-Processing/PDF/PDF-Viewer/maui/Stamps.md index f3d3901f63..b2796547b2 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Stamps.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Stamps.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Stamp Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The stamp annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove and modify stamps or custom images in the PDF document. This section will go through the various types and functions available in PDF Viewer for working with stamp annotations. +The stamp annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove and modify stamps or custom images in the PDF document. This section will go through the various types and functions available in PDF Viewer for working with stamp annotations. ## Types of stamps @@ -45,9 +45,9 @@ The following example explains how to create a custom stamp using the built-in d ### Add standard stamps without using the toolbar -There are 18 standard stamp types available in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) that are most commonly used in documents. The appropriate standard stamp type can be selected from the [StampType](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.StampType.html) enumeration. +There are 18 standard stamp types available in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) that are most commonly used in documents. The appropriate standard stamp type can be selected from the [StampType](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.StampType.html) enumeration. -The following example explains how to create an [Approved](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.StampType.html#Syncfusion_Maui_PdfViewer_StampType_Approved) standard stamp and add it to the first page of a PDF document using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +The following example explains how to create an [Approved](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.StampType.html#Syncfusion_Maui_PdfViewer_StampType_Approved) standard stamp and add it to the first page of a PDF document using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). {% tabs %} {% highlight C# %} @@ -81,7 +81,7 @@ The following image represents the approved standard stamp appearance in the PDF ### Add custom stamps without using toolbar -You can create a custom stamp from any image and add it to a PDF document. The following example explains how to create a custom stamp from an image in the application and add it to a PDF document using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +You can create a custom stamp from any image and add it to a PDF document. The following example explains how to create a custom stamp from an image in the application and add it to a PDF document using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). {% tabs %} {% highlight C# %} @@ -114,7 +114,7 @@ void AddCustomStampAnnotation() ### Add a view as custom stamps programmatically -You can create a custom stamp from any view, such as Button, Entry, Label, Image, or any other view, and add it to a PDF document. The following example explains how to create a custom stamp from a button view in the application and add it to a PDF document using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +You can create a custom stamp from any view, such as Button, Entry, Label, Image, or any other view, and add it to a PDF document. The following example explains how to create a custom stamp from a button view in the application and add it to a PDF document using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). {% tabs %} {% highlight C# %} @@ -154,7 +154,7 @@ N> * Interactions within the view such as button clicks or text entry will not f ## Edit the selected stamp -You can edit the properties of the selected stamp annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. +You can edit the properties of the selected stamp annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected stamp annotation. Similarly, you can modify the other properties if required. @@ -229,7 +229,7 @@ private void PdfViewer_AnnotationSelected_Customize(object? sender, AnnotationEv ## Custom stamp modal view -The custom stamp modal view appears when the user wants to create a custom stamp from a typed text. The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) notifies when the modal view is appearing and disappearing through events. The events help you in hiding and showing elements that are part of the app UI that are not necessary as long as the modal view is visible. +The custom stamp modal view appears when the user wants to create a custom stamp from a typed text. The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) notifies when the modal view is appearing and disappearing through events. The events help you in hiding and showing elements that are part of the app UI that are not necessary as long as the modal view is visible. **Mobile:** @@ -271,7 +271,7 @@ private void PdfViewer_CustomStampModalViewDisappearing(object? sender, EventArg ### Suppressing the custom stamp modal view and implementing your own UI -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the custom stamp modal view and use your own UI in its place. This can be achieved by setting the `AnnotationModalViewAppearingEventArgs.Cancel` property to `true` in the `CustomStampModalViewAppearing` event handler. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the custom stamp modal view and use your own UI in its place. This can be achieved by setting the `AnnotationModalViewAppearingEventArgs.Cancel` property to `true` in the `CustomStampModalViewAppearing` event handler. The below code snippet illustrates suppressing the custom stamp modal view and using a UI implemented in the app in its place. In this illustration, when the user types a text in your own dialog and clicks the ok button, the text is converted into an image stream and a StampAnnotation instance is created. When the PDF viewer is tapped, the stamp annotation is added in the tapped position. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Sticky-Notes.md b/Document-Processing/PDF/PDF-Viewer/maui/Sticky-Notes.md index 5d587763f4..7c82101912 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Sticky-Notes.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Sticky-Notes.md @@ -10,11 +10,11 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Sticky Note Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The sticky note annotation feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify sticky notes in a PDF document. This feature will help add comments or notes to specific parts of a document to clarify complex concepts, terms, or ideas. This section will cover the various functions available in [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for working with sticky note annotations. +The sticky note annotation feature of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify sticky notes in a PDF document. This feature will help add comments or notes to specific parts of a document to clarify complex concepts, terms, or ideas. This section will cover the various functions available in [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for working with sticky note annotations. ## Types of sticky notes -The following sticky note icon types are currently available in [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The icon types can be selected from the [StickyNoteIcon](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.StickyNoteIcon.html) enumeration. +The following sticky note icon types are currently available in [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The icon types can be selected from the [StickyNoteIcon](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.StickyNoteIcon.html) enumeration. ![Sticky note icon types](Images/Annotations/sticky-note-icon-types.png) @@ -37,11 +37,11 @@ The following image represents how to add the sticky note annotation using the t ### Add the sticky note annotation without using the toolbar You can add sticky note annotations to a PDF document by tapping with a touch (or mouse down) on a PDF page. The following steps explain how to add sticky note annotations to a PDF: -1. Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the SfPdfViewer to [StickyNote](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_StickyNote). This activates the sticky note mode on the control. +1. Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the SfPdfViewer to [StickyNote](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_StickyNote). This activates the sticky note mode on the control. 2. Tap (or mouse down) on a PDF page, where you want to add the sticky note annotation. This will add a sticky note with a default style and a popup will be displayed to write and submit the text. -3. Once the sticky note is added, [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) is automatically changed to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). +3. Once the sticky note is added, [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) is automatically changed to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). 4. You can later select and edit the annotations if required. -5. If you need to disable the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) of [StickyNote](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_StickyNote), you need to change the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). +5. If you need to disable the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) of [StickyNote](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_StickyNote), you need to change the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). The following code explains how to enable the sticky note mode @@ -50,7 +50,7 @@ The following code explains how to enable the sticky note mode // Enable or activate the sticky note mode. void EnableStickyNoteMode() { - // Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to [StickyNote](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_StickyNote). + // Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to [StickyNote](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_StickyNote). PdfViewer.AnnotationMode = AnnotationMode.StickyNote; } {% endhighlight %} @@ -63,7 +63,7 @@ Similarly, refer to the following code explains how to disable the sticky note m // Disable or deactivate the sticky note mode. void DisableStickyNoteMode() { - // Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). + // Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). PdfViewer.AnnotationMode = AnnotationMode.None; } {% endhighlight %} @@ -71,7 +71,7 @@ void DisableStickyNoteMode() ### Add sticky note annotation programmatically -You can create and add a sticky note annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a sticky note with a comment icon and add it to the first page of a PDF document. +You can create and add a sticky note annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a sticky note with a comment icon and add it to the first page of a PDF document. {% tabs %} {% highlight C# %} @@ -102,7 +102,7 @@ void AddStickyNote() ## Sticky note annotation settings -In the sticky note annotation mode, the annotation will be added with a default appearance. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance before adding sticky note annotations to the document, you can change its default settings using the [SfPdfViewer.AnnotationSettings.StickyNote](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) For that, you need to obtain the default sticky note annotation settings. +In the sticky note annotation mode, the annotation will be added with a default appearance. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance before adding sticky note annotations to the document, you can change its default settings using the [SfPdfViewer.AnnotationSettings.StickyNote](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSettings) For that, you need to obtain the default sticky note annotation settings. The following example explains how to obtain the default sticky note annotation settings and modify some of their properties. Similarly, you can modify all the other properties. @@ -110,7 +110,7 @@ The following example explains how to obtain the default sticky note annotation {% highlight C# %} void CustomizeDefaultStickyNoteSettings() { - // Obtain the default sticky note annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the default sticky note annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. StickyNoteAnnotationSettings stickyNoteSettings = PdfViewer.AnnotationSettings.StickyNote; // Modify the default properties. @@ -131,7 +131,7 @@ When you double-tap the selected sticky note, the text editor opens. Edit the te ### Edit sticky note properties programmatically -Edit the properties of the selected sticky note annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit the text and icon of the selected sticky note annotation. Similarly, you can modify the other properties. +Edit the properties of the selected sticky note annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit the text and icon of the selected sticky note annotation. Similarly, you can modify the other properties. {% tabs %} {% highlight C# %} @@ -153,7 +153,7 @@ void EditSelectedStickyNoteAnnotation(Annotation selectedAnnotation) ## Sticky note modal view -The sticky note modal view appears when text needs to be input by the user for creating and editing sticky note annotations on Android and iOS platforms. The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) notifies when the modal view is appearing and disappearing through events. The events help you hide and show elements that are part of the app UI that are not necessary as long as the modal view is visible. +The sticky note modal view appears when text needs to be input by the user for creating and editing sticky note annotations on Android and iOS platforms. The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) notifies when the modal view is appearing and disappearing through events. The events help you hide and show elements that are part of the app UI that are not necessary as long as the modal view is visible. ![Sticky note modal view](Images/Annotations/sticky-note-modal-view.png) @@ -189,7 +189,7 @@ Private void PdfViewer_StickyNoteModalViewDisappearing(object? Sender, EventArgs ### Suppressing the sticky note modal view and implementing your own UI -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the sticky note modal view and use your own UI in its place. This can be achieved by setting the `AnnotationModalViewAppearingEventArgs.Cancel` property to `true` in the `StickyNoteModalViewAppearing` event handler. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to suppress the sticky note modal view and use your own UI in its place. This can be achieved by setting the `AnnotationModalViewAppearingEventArgs.Cancel` property to `true` in the `StickyNoteModalViewAppearing` event handler. The below code snippet illustrates suppressing the sticky note modal view and using a UI implemented in the app in its place. The sticky note annotation instance that is created or edited can be obtained from the event args. Once the user enters the text in the custom dialog and confirms, the text can be assigned to this sticky note annotation instance. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Text-Markups.md b/Document-Processing/PDF/PDF-Viewer/maui/Text-Markups.md index 2f02feb699..211c76237f 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Text-Markups.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Text-Markups.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Text Markup Annotations in .NET MAUI PDF Viewer (SfPdfViewer) -The text markup annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify text markups in the PDF document. This is useful for making corrections or emphasizing important texts in the document. This section will go through the various types and functions available in PDF Viewer for working with text markup annotations. +The text markup annotations feature of [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove, and modify text markups in the PDF document. This is useful for making corrections or emphasizing important texts in the document. This section will go through the various types and functions available in PDF Viewer for working with text markup annotations. ## Types of text markups @@ -44,14 +44,14 @@ The following image represents how to add the highlight annotations using the to ### Add text markups from annotation mode -You can add text markup annotations to a PDF document by touch (or mouse down) and drag using the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to add text markup annotation on a text in a PDF. +You can add text markup annotations to a PDF document by touch (or mouse down) and drag using the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following steps explain how to add text markup annotation on a text in a PDF. -1. Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the SfPdfViewer to any text markups (say [Highlight](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Highlight)). It activates the highlight annotation mode on the control. +1. Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) property of the SfPdfViewer to any text markups (say [Highlight](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Highlight)). It activates the highlight annotation mode on the control. 2. Place your finger (or mouse) on the text in the PDF document, where you want to start adding the text markup. 3. Drag the finger (or cursor) across the text to select. 4. Complete adding the text markup to the selected text by releasing the finger (or cursor). 5. Repeat steps 2-4, if you want to add multiple text markups on other areas during the annotation mode. -6. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). It will disable the annotation mode. +6. Once you have done this, set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None). It will disable the annotation mode. 7. You can later select and edit the annotations if required. @@ -62,7 +62,7 @@ The following code explains how to enable the highlight annotation mode. Similar // Enable or activate the highlight annotation mode. void EnableHighlightAnnotationMode() { - // Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [Highlight](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Highlight) + // Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [Highlight](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_Highlight) PdfViewer.AnnotationMode = AnnotationMode.Highlight; } {% endhighlight %} @@ -75,7 +75,7 @@ Similarly, refer to the following code to disable the highlight annotation mode. // Disable or deactivate the highlight annotation mode. void DisableHighlightMode() { - // Set the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [None](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None) + // Set the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode) of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) to [None](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationMode.html#Syncfusion_Maui_PdfViewer_AnnotationMode_None) PdfViewer.AnnotationMode = AnnotationMode.None; } {% endhighlight %} @@ -83,7 +83,7 @@ void DisableHighlightMode() ### Add text markups from the text selection -Text markups can be added to a PDF document using the text selection without enabling the [AnnotationMode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode). Select the text you want in a PDF document, and a context menu with the text markup options will appear after you complete your selection. You can select any of the text markup options to add annotation to a text in the PDF document. +Text markups can be added to a PDF document using the text selection without enabling the [AnnotationMode](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationMode). Select the text you want in a PDF document, and a context menu with the text markup options will appear after you complete your selection. You can select any of the text markup options to add annotation to a text in the PDF document. The following image represents the text selection context menu with text markup options. @@ -91,7 +91,7 @@ The following image represents the text selection context menu with text markup ### Adding Annotations Programmatically -You can create and add a text markup annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a highlight annotation and add it to the first page of a PDF document. Similarly, you can create other text markup annotation types. +You can create and add a text markup annotation to a PDF document programmatically using the [AddAnnotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AddAnnotation_Syncfusion_Maui_PdfViewer_Annotation_) method of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following example explains how to create a highlight annotation and add it to the first page of a PDF document. Similarly, you can create other text markup annotation types. {% tabs %} {% highlight C# %} @@ -125,7 +125,7 @@ void AddHighlightAnnotation() ## Text markup annotation settings -In the text markup annotation mode, the text markups will be added with a default appearance. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance before adding text markups on the document, you can change its default settings using the [AnnotationSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). For that, you need to obtain the default text markup annotation settings. +In the text markup annotation mode, the text markups will be added with a default appearance. You can modify the annotation after it has been added to the pages. However, if you need to define the appearance before adding text markups on the document, you can change its default settings using the [AnnotationSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.AnnotationSettings.html) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). For that, you need to obtain the default text markup annotation settings. The following example explains how to obtain the default highlight annotation settings and modify some of its properties. Similarly, you can also modify the properties of other text markup annotations. @@ -133,7 +133,7 @@ The following example explains how to obtain the default highlight annotation se {% highlight C# %} void CustomizeDefaultHighlightSettings() { - // Obtain the default highlight annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. + // Obtain the default highlight annotation settings from the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) instance. TextMarkupAnnotationSettings highlightAnnotationSettings = PdfViewer.AnnotationSettings.Highlight; // Modify the default properties. @@ -148,7 +148,7 @@ void CustomizeDefaultHighlightSettings() ## Edit the selected text markup annotation -You can edit the properties of the selected text markup annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected highlight annotation. Similarly, you can modify the other text markup annotations properties. +You can edit the properties of the selected text markup annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the [AnnotationSelected](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_AnnotationSelected) event. The following example shows how to edit some of the properties of the selected highlight annotation. Similarly, you can modify the other text markup annotations properties. {% tabs %} {% highlight C# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Text-Search.md b/Document-Processing/PDF/PDF-Viewer/maui/Text-Search.md index 1658f1dbaa..dae811b894 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Text-Search.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Text-Search.md @@ -18,7 +18,7 @@ You can also watch the video tutorial below to learn about text search. ## Initiate a text search -The [SearchTextAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_) method asynchronously searches the specified text throughout the PDF document and highlights each occurrence (match). To start the search, call the method from a button click handler and pass the text to search as a parameter. +The [SearchTextAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_) method asynchronously searches the specified text throughout the PDF document and highlights each occurrence (match). To start the search, call the method from a button click handler and pass the text to search as a parameter. {% tabs %} {% highlight C# hl_lines="8" %} @@ -38,11 +38,11 @@ async void SearchText(string text) ### Search result -The [TextSearchResult](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html) will be obtained at the end of the search text operation, and it will hold the search result. It allows you to navigate to the next or previous matches of the text, as well as provides the following details: +The [TextSearchResult](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html) will be obtained at the end of the search text operation, and it will hold the search result. It allows you to navigate to the next or previous matches of the text, as well as provides the following details: -1. [Total matches count](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_TotalMatchesCount) – It provides the total number of matches that have been found in the PDF document. +1. [Total matches count](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_TotalMatchesCount) – It provides the total number of matches that have been found in the PDF document. -2. [Current match index](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_CurrentMatchIndex) – It gives the index of the currently focused match. The value is index based. +2. [Current match index](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_CurrentMatchIndex) – It gives the index of the currently focused match. The value is index based. {% tabs %} {% highlight C# hl_lines="5 6" %} @@ -63,7 +63,7 @@ N> * If the total matches count is 0, then there were no matches found for the g ### Navigate to the next and previous match -The [GoToNextMatch](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToNextMatch) and [GoToPreviousMatch](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToPreviousMatch) functionalities of the [TextSearchResult](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html) help you navigate to the next and previous matches of the text, respectively. You can follow the given steps to achieve the same: +The [GoToNextMatch](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToNextMatch) and [GoToPreviousMatch](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToPreviousMatch) functionalities of the [TextSearchResult](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html) help you navigate to the next and previous matches of the text, respectively. You can follow the given steps to achieve the same: 1. Search a text and store the search result in a global variable. @@ -83,7 +83,7 @@ async void SearchText(string text) {% endhighlight %} {% endtabs %} -2. Call the [GoToNextMatch](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToNextMatch) or [GoToPreviousMatch](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToPreviousMatch) functionalities in a button click to move to the next or previous match of the text respectively, whenever necessary. +2. Call the [GoToNextMatch](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToNextMatch) or [GoToPreviousMatch](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_GoToPreviousMatch) functionalities in a button click to move to the next or previous match of the text respectively, whenever necessary. {% tabs %} {% highlight C# hl_lines="4 10" %} @@ -105,7 +105,7 @@ private void PreviousMatchButtonClicked(object sender, EventArgs e) ### Close the text search -The [Clear](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_Clear) functionality of the [TextSearchResult](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html) removes all the traces of the searched text in the PDF document. +The [Clear](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_Clear) functionality of the [TextSearchResult](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html) removes all the traces of the searched text in the PDF document. {% tabs %} {% highlight C# hl_lines="4" %} @@ -121,7 +121,7 @@ private void CloseSearchButtonClicked(object sender, EventArgs e) ## Text Search progress -By using the [SearchTextAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_), the search result will be obtained only after all the pages have been searched. If the search completion takes a long time for a PDF document with more pages, you may get the current search result while the search is still in progress by using the [TextSearchProgress](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_TextSearchProgress) event. The event is triggered on each page after the search is completed on the page, and the [SearchResult](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchProgressEventArgs.html#Syncfusion_Maui_PdfViewer_TextSearchProgressEventArgs_SearchResult) property of the [TextSearchProgressEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchProgressEventArgs.html) contains the current search result as shown in the following code example: +By using the [SearchTextAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_), the search result will be obtained only after all the pages have been searched. If the search completion takes a long time for a PDF document with more pages, you may get the current search result while the search is still in progress by using the [TextSearchProgress](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_TextSearchProgress) event. The event is triggered on each page after the search is completed on the page, and the [SearchResult](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchProgressEventArgs.html#Syncfusion_Maui_PdfViewer_TextSearchProgressEventArgs_SearchResult) property of the [TextSearchProgressEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchProgressEventArgs.html) contains the current search result as shown in the following code example: {% tabs %} {% highlight XAML hl_lines="3" %} @@ -150,7 +150,7 @@ private void PdfTextSearchProgress(object sender, TextSearchProgressEventArgs e) ### Search completion percentage -The [TotalPagesSearched](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchProgressEventArgs.html#Syncfusion_Maui_PdfViewer_TextSearchProgressEventArgs_TotalPagesSearched) property of the [TextSearchProgressEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchProgressEventArgs.html) provides the total number of pages that have been searched to find the specified text across the PDF document. You may use this information to find the search completion percentage as shown in the following code example: +The [TotalPagesSearched](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchProgressEventArgs.html#Syncfusion_Maui_PdfViewer_TextSearchProgressEventArgs_TotalPagesSearched) property of the [TextSearchProgressEventArgs](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchProgressEventArgs.html) provides the total number of pages that have been searched to find the specified text across the PDF document. You may use this information to find the search completion percentage as shown in the following code example: {% tabs %} {% highlight C# %} @@ -165,7 +165,7 @@ private void PdfTextSearchProgress(object sender, TextSearchProgressEventArgs e) ### Cancelling search progress -The [Clear](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_Clear) method of the [TextSearchResult](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchResult.html) can be used to cancel the text search progress that does not need to be continued. For example, under the following scenarios, cancellation may be necessary. +The [Clear](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html#Syncfusion_Maui_PdfViewer_TextSearchResult_Clear) method of the [TextSearchResult](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchResult.html) can be used to cancel the text search progress that does not need to be continued. For example, under the following scenarios, cancellation may be necessary. 1. If the search is running for a long time. 2. When a wrong keyword is entered and the search is initiated. @@ -192,13 +192,13 @@ private void PdfTextSearchProgress(object sender, TextSearchProgressEventArgs e) ## Text search options -By default, the case and other characteristics of the text will not be considered while using the [SearchTextAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_) functionality. You may define how the text needs to be searched in the document by using the `TextSearchOption` with the following options. +By default, the case and other characteristics of the text will not be considered while using the [SearchTextAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_) functionality. You may define how the text needs to be searched in the document by using the `TextSearchOption` with the following options. 1. `None` – To search text without any restrictions. 2. `CaseSensitive` - To search text in case case-sensitive manner. 3. `WholeWords` – To search only the whole words. -You need to pass the `TextSearchOptions` as a parameter to the [SearchTextAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_) method as shown in the following code example: +You need to pass the `TextSearchOptions` as a parameter to the [SearchTextAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SearchTextAsync_System_String_TextSearchOptions_System_Threading_CancellationTokenSource_) method as shown in the following code example: {% tabs %} {% highlight C# hl_lines="5" %} @@ -215,7 +215,7 @@ async void SearchText(string text) ## Customize the text match highlight colors -The highlight colors of the current match and other matches of a text can be customized with the help of the [TextSearchSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSearchSettings.html#Syncfusion_Maui_PdfViewer_TextSearchSettings__ctor) property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +The highlight colors of the current match and other matches of a text can be customized with the help of the [TextSearchSettings](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSearchSettings.html#Syncfusion_Maui_PdfViewer_TextSearchSettings__ctor) property of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). {% tabs %} {% highlight XAML hl_lines="4 5" %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Text-Selection.md b/Document-Processing/PDF/PDF-Viewer/maui/Text-Selection.md index 6cf5832391..db007873f6 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Text-Selection.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Text-Selection.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Text Selection in .NET MAUI PDF Viewer (SfPdfViewer) -Using [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), you can select text from a PDF document and copy it to the clipboard. This process allows you to easily extract text from the PDF and paste it into other applications. +Using [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), you can select text from a PDF document and copy it to the clipboard. This process allows you to easily extract text from the PDF and paste it into other applications. ## Selection using the mouse @@ -37,7 +37,7 @@ N> In desktop platforms, you can also use the keyboard shortcut Ctrl The color of the selection handles will also be modified to match the text hi ## Handling selected text from the application -The [TextSelectionChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_TextSelectionChanged) event occurs when the text selection is completed or when the selected text is modified in any way. This event provides the selected text and the way to prevent the display of the default context menu by handling the selected text from the application level. +The [TextSelectionChanged](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_TextSelectionChanged) event occurs when the text selection is completed or when the selected text is modified in any way. This event provides the selected text and the way to prevent the display of the default context menu by handling the selected text from the application level. The event arguments properties that are listed below are available in the text selection changed event. -1. [SelectedText](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSelectionChangedEventArgs.html#Syncfusion_Maui_PdfViewer_TextSelectionChangedEventArgs_SelectedText) - Provides the selected text. +1. [SelectedText](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSelectionChangedEventArgs.html#Syncfusion_Maui_PdfViewer_TextSelectionChangedEventArgs_SelectedText) - Provides the selected text. -2. [PageNumber](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSelectionChangedEventArgs.html#Syncfusion_Maui_PdfViewer_TextSelectionChangedEventArgs_PageNumber) - Provides the page number at which the text is selected. +2. [PageNumber](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSelectionChangedEventArgs.html#Syncfusion_Maui_PdfViewer_TextSelectionChangedEventArgs_PageNumber) - Provides the page number at which the text is selected. -3. [Handled](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.TextSelectionChangedEventArgs.html#Syncfusion_Maui_PdfViewer_TextSelectionChangedEventArgs_Handled) - A boolean value indicating whether the event has been handled or processed by an event handler. By setting the `Handled` property to true, you indicate that the event is handled at the application-level event handler and no further action is necessary. So that the default copy context menu will not appear. +3. [Handled](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.TextSelectionChangedEventArgs.html#Syncfusion_Maui_PdfViewer_TextSelectionChangedEventArgs_Handled) - A boolean value indicating whether the event has been handled or processed by an event handler. By setting the `Handled` property to true, you indicate that the event is handled at the application-level event handler and no further action is necessary. So that the default copy context menu will not appear. Refer to the following code sample that explains how to wire the event to handle the selected text at the application level and prevent the default copy context menu from appearing. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Toolbar-Customization.md b/Document-Processing/PDF/PDF-Viewer/maui/Toolbar-Customization.md index 3734eb4e4c..4bf841e1ba 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Toolbar-Customization.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Toolbar-Customization.md @@ -10,13 +10,13 @@ keywords: .net maui pdf viewer, customize toolbar, show hide toolbar, add toolba # Toolbar Customization in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to fully customize its built-in toolbars — including showing or hiding entire toolbars, and adding, removing, or reordering individual toolbar items. This flexibility lets you tailor the viewer's interface to match your application's workflow. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to fully customize its built-in toolbars — including showing or hiding entire toolbars, and adding, removing, or reordering individual toolbar items. This flexibility lets you tailor the viewer's interface to match your application's workflow. For the list of toolbar names and toolbar item names, see [Toolbar](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/maui/toolbar). ## Show and hide all toolbars -The built-in toolbars are visible by default. In certain scenarios, you might want to hide all the toolbars in the PDF Viewer to display the document in full view or to use customized toolbars based on your application needs. You can do this by setting the [ShowToolbars](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ShowToolbars) property to `false`. Set it back to `true` to restore the built-in toolbars. +The built-in toolbars are visible by default. In certain scenarios, you might want to hide all the toolbars in the PDF Viewer to display the document in full view or to use customized toolbars based on your application needs. You can do this by setting the [ShowToolbars](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ShowToolbars) property to `false`. Set it back to `true` to restore the built-in toolbars. {% tabs %} {% highlight C# %} @@ -70,7 +70,7 @@ if (pdfViewer?.Toolbars?.Count > 1) ### Hide specific toolbars by name -By using the [GetByName](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_GetByName_System_String) method with a specified toolbar name, you can access and modify that toolbar's properties. The following example retrieves the `BottomToolbar` by name and hides it. +By using the [GetByName](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_GetByName_System_String) method with a specified toolbar name, you can access and modify that toolbar's properties. The following example retrieves the `BottomToolbar` by name and hides it. {% tabs %} {% highlight C# %} @@ -122,7 +122,7 @@ pdfViewer.Toolbars?.GetByName("PrimaryToolbar")?.Items?.Add( ### Add a toolbar item at a specific index -To add an item at a specific index, use the [Insert](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_Insert_System_Int32_Syncfusion_Maui_PdfViewer_ToolbarItem) method. Use the [Index](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ToolbarItem.html#Syncfusion_Maui_PdfViewer_ToolbarItem_Index) property to get the current index of an existing item, then insert the new item relative to it. The following example inserts a save button right after the `Print` button in the `PrimaryToolbar`. +To add an item at a specific index, use the [Insert](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_Insert_System_Int32_Syncfusion_Maui_PdfViewer_ToolbarItem) method. Use the [Index](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ToolbarItem.html#Syncfusion_Maui_PdfViewer_ToolbarItem_Index) property to get the current index of an existing item, then insert the new item relative to it. The following example inserts a save button right after the `Print` button in the `PrimaryToolbar`. {% tabs %} {% highlight C# %} @@ -175,7 +175,7 @@ if (topToolbar != null) ### Remove a toolbar item by name -Use the [GetByName](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_GetByName_System_String) method to access a specific item and then call [Remove](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_Remove_Syncfusion_Maui_PdfViewer_ToolbarItem) to remove it. The following example removes the `Outline` item from the `PrimaryToolbar`. +Use the [GetByName](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_GetByName_System_String) method to access a specific item and then call [Remove](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_Remove_Syncfusion_Maui_PdfViewer_ToolbarItem) to remove it. The following example removes the `Outline` item from the `PrimaryToolbar`. {% tabs %} {% highlight C# %} @@ -190,7 +190,7 @@ if (item != null) ### Remove an item from all toolbars -Each toolbar in [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) operates independently — removing an item from one toolbar does not affect others. To remove an item from all toolbars, iterate through the `Toolbars` collection and remove the item from each. The following example removes the `StickyNote` item from all toolbars. +Each toolbar in [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) operates independently — removing an item from one toolbar does not affect others. To remove an item from all toolbars, iterate through the `Toolbars` collection and remove the item from each. The following example removes the `StickyNote` item from all toolbars. {% tabs %} {% highlight C# %} @@ -210,7 +210,7 @@ You can find the sample project for removing an item from the desktop toolbar us ### Hide a toolbar item by index -To hide a toolbar item by its index, access the item in the `Items` collection and set its [IsVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ToolbarItem.html#Syncfusion_Maui_PdfViewer_ToolbarItem_IsVisible) property to `false`. +To hide a toolbar item by its index, access the item in the `Items` collection and set its [IsVisible](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ToolbarItem.html#Syncfusion_Maui_PdfViewer_ToolbarItem_IsVisible) property to `false`. {% tabs %} {% highlight C# %} @@ -227,7 +227,7 @@ if (toolbar != null && indexToHide >= 0 && indexToHide < toolbar.Items?.Count) ### Hide a toolbar item by name -Use the [GetByName](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_GetByName_System_String) method to access a specific item, then set its [IsVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.ToolbarItem.html#Syncfusion_Maui_PdfViewer_ToolbarItem_IsVisible) property to `false`. The following example hides the `Search` item in the `PrimaryToolbar`. +Use the [GetByName](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ToolbarItemCollection.html#Syncfusion_Maui_PdfViewer_ToolbarItemCollection_GetByName_System_String) method to access a specific item, then set its [IsVisible](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.ToolbarItem.html#Syncfusion_Maui_PdfViewer_ToolbarItem_IsVisible) property to `false`. The following example hides the `Search` item in the `PrimaryToolbar`. {% tabs %} {% highlight C# %} diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Toolbar.md b/Document-Processing/PDF/PDF-Viewer/maui/Toolbar.md index 463ab9e174..062f8e5478 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Toolbar.md @@ -10,15 +10,15 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Working with the Toolbar in .NET MAUI PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) includes a built-in toolbar that enhances PDF viewing and editing capabilities, allowing you to perform operations such as adding and modifying annotations, searching for text, and more. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) includes a built-in toolbar that enhances PDF viewing and editing capabilities, allowing you to perform operations such as adding and modifying annotations, searching for text, and more. ## Toolbars structure -The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) features a built-in toolbar that utilizes multiple or multilevel toolbars. This design ensures that the user interface remains clean and accessible. We have incorporated multiple toolbars, such as top, bottom, and sub-toolbars for editing and choosing types, to ensure comprehensive functionality across various platforms. These toolbars are strategically organized based on the available screen space, adapting to different screen sizes on both mobile and desktop platforms. This approach ensures that tools are easily accessible, preventing the interface from cluttering. +The [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) features a built-in toolbar that utilizes multiple or multilevel toolbars. This design ensures that the user interface remains clean and accessible. We have incorporated multiple toolbars, such as top, bottom, and sub-toolbars for editing and choosing types, to ensure comprehensive functionality across various platforms. These toolbars are strategically organized based on the available screen space, adapting to different screen sizes on both mobile and desktop platforms. This approach ensures that tools are easily accessible, preventing the interface from cluttering. ### Need for using multiple toolbars -Depending on the available screen space, the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) organizes its tools into multiple or multilevel toolbars on mobile and desktop platforms. The use of multiple toolbars in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) is essential to maintain a user-friendly interface. By separating tools into different toolbars, users can quickly find and use the tools they need without the interface becoming cluttered. +Depending on the available screen space, the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) organizes its tools into multiple or multilevel toolbars on mobile and desktop platforms. The use of multiple toolbars in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) is essential to maintain a user-friendly interface. By separating tools into different toolbars, users can quickly find and use the tools they need without the interface becoming cluttered. The names of these toolbars and their description are listed in the following sections. @@ -200,7 +200,7 @@ For details on showing, hiding, adding, removing, and reordering toolbars and to ## Toolbar items -In [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), the user can also manage the items within each toolbar of the PDF Viewer. This allows you to control which tools are available and how they are arranged, providing a tailored user experience that aligns with your application’s requirements. +In [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html), the user can also manage the items within each toolbar of the PDF Viewer. This allows you to control which tools are available and how they are arranged, providing a tailored user experience that aligns with your application’s requirements. The names of these toolbar items, along with their descriptions and availability in the toolbars, are listed in the following sections. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/UI-Customization.md b/Document-Processing/PDF/PDF-Viewer/maui/UI-Customization.md index e501c694b9..fbadbc0780 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/UI-Customization.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/UI-Customization.md @@ -10,7 +10,7 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # UI Customization in .NET MAUI PDF Viewer (SfPdfViewer) -This section walks you through the UI customization options supported in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). +This section walks you through the UI customization options supported in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). N>The PDF Viewer currently does not support system text auto scaling. Changing the device or accessibility font size settings will not automatically scale the built-in toolbar, other built-in text elements, or the PDF document content. Use the built-in zoom features to adjust document readability. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md b/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md index 544b23f645..ce4b21f979 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Undo-Redo.md @@ -34,7 +34,7 @@ For desktop platforms such as Windows and macOS, you can also use the following ## Undo -You can undo the most recent action performed on the annotations using the [UndoCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UndoCommand) of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code examples show how to bind the command to a button in XAML to perform the action on button click, and how to execute the command programmatically. +You can undo the most recent action performed on the annotations using the [UndoCommand](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UndoCommand) of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code examples show how to bind the command to a button in XAML to perform the action on button click, and how to execute the command programmatically. {% tabs %} {% highlight XAML %} @@ -52,7 +52,7 @@ void PerformUndo() ## Redo -You can redo the last undone action using the [RedoCommand](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedoCommand) of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code examples show how to bind the command to a button in XAML to perform the action on button click, and how to execute the command programmatically. +You can redo the last undone action using the [RedoCommand](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedoCommand) of the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). The following code examples show how to bind the command to a button in XAML to perform the action on button click, and how to execute the command programmatically. {% tabs %} {% highlight XAML %} @@ -72,9 +72,9 @@ void PerformRedo() The undo and redo history covers annotation changes only. The following operations **cannot** be undone: -* Saving a document using [SaveDocumentAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocumentAsync). -* Applying redaction using [RedactAsync](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_). -* Unloading a document using [UnloadDocument](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument). Unloading clears the undo/redo history entirely. +* Saving a document using [SaveDocumentAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_SaveDocumentAsync). +* Applying redaction using [RedactAsync](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_RedactAsync_System_Threading_CancellationToken_). +* Unloading a document using [UnloadDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_UnloadDocument). Unloading clears the undo/redo history entirely. N> The undo/redo stack is also cleared when a new document is loaded. diff --git a/Document-Processing/PDF/PDF-Viewer/maui/liquid-glass-effect.md b/Document-Processing/PDF/PDF-Viewer/maui/liquid-glass-effect.md index 927a0c26ad..2468555e31 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/liquid-glass-effect.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/liquid-glass-effect.md @@ -10,27 +10,27 @@ keywords: .net maui pdf viewer, .net maui view pdf, pdf viewer in .net maui, .ne # Liquid Glass Effect in .NET MAUI PDF Viewer (SfPdfViewer) -The Liquid Glass Effect introduces a modern, translucent design with adaptive color tinting and light refraction, creating a sleek, glass like user experience that remains clear and accessible. This section explains how to enable and customize the effect in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. +The Liquid Glass Effect introduces a modern, translucent design with adaptive color tinting and light refraction, creating a sleek, glass like user experience that remains clear and accessible. This section explains how to enable and customize the effect in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control. ## Apply liquid glass effect -Follow these steps to enable and configure the Liquid Glass Effect in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control: +Follow these steps to enable and configure the Liquid Glass Effect in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control: ### Step 1: Wrap the control inside glass effect view -To apply the Liquid Glass Effect to Syncfusion® .NET MAUI [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control, wrap the control inside the [SfGlassEffectView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Core.SfGlassEffectView.html) class. +To apply the Liquid Glass Effect to Syncfusion® .NET MAUI [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control, wrap the control inside the [SfGlassEffectView](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.Core.SfGlassEffectView.html) class. For more details, refer to the [Liquid Glass Getting Started documentation](https://help.syncfusion.com/maui/liquid-glass-ui/glassy-controls). ### Step 2: Enable the liquid glass effect on SfPdfViewer -Set the [EnableLiquidGlassEffect](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableLiquidGlassEffect) property to `true` in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control to apply the Liquid Glass Effect. When enabled, the effect is also applied to its dependent controls and provides responsive interaction for a smooth and engaging user experience. +Set the [EnableLiquidGlassEffect](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_EnableLiquidGlassEffect) property to `true` in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control to apply the Liquid Glass Effect. When enabled, the effect is also applied to its dependent controls and provides responsive interaction for a smooth and engaging user experience. ### Step 3: Customize the background -To achieve a glass like background in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control, set the `Background` property to `Transparent`. The background will then be treated as a tinted color, ensuring a consistent glass effect across the controls. +To achieve a glass like background in the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control, set the `Background` property to `Transparent`. The background will then be treated as a tinted color, ensuring a consistent glass effect across the controls. -The following code snippet demonstrates how to apply the Liquid Glass Effect to the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control: +The following code snippet demonstrates how to apply the Liquid Glass Effect to the [SfPdfViewer](https://help.syncfusion.com/cr/document-processing/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) control: {% tabs %} {% highlight xaml tabtitle="MainPage.xaml" hl_lines="14 16 18" %} From a4b2000f28f0e299df7f58149bf0e48f63a5b5de Mon Sep 17 00:00:00 2001 From: sameerkhan001 Date: Fri, 17 Jul 2026 16:40:17 +0530 Subject: [PATCH 120/127] 1042258-ug: Revamped overall Getting Started Page in OCR. --- .../NET/ocr-processor/AWS-Textract.md | 107 +++++++--- .../Amazon-Linux-EC2-Setup-Guide.md | 88 ++++++--- .../ocr-processor/Azure-Kubernetes-Service.md | 138 ++++++++----- .../NET/ocr-processor/Azure-Vision.md | 110 +++++++---- .../NET/ocr-processor/Console.md | 175 ++++++++++------- .../NET/ocr-processor/Docker.md | 92 ++++++--- .../NET/ocr-processor/Linux.md | 100 ++++++---- .../Data-Extraction/NET/ocr-processor/MAC.md | 124 +++++++----- .../Data-Extraction/NET/ocr-processor/WPF.md | 63 ++++-- .../NET/ocr-processor/Web-API.md | 90 ++++++--- .../NET/ocr-processor/Windows-Forms.md | 30 +-- .../NET/ocr-processor/aspnet-mvc.md | 96 ++++++--- .../NET/ocr-processor/azure.md | 185 +++++++++++------- .../NET/ocr-processor/blazor.md | 165 +++++++++------- .../NET/ocr-processor/net-core.md | 123 +++++++----- 15 files changed, 1070 insertions(+), 616 deletions(-) diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/AWS-Textract.md b/Document-Processing/Data-Extraction/NET/ocr-processor/AWS-Textract.md index 9bece82ebc..7318c1edad 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/AWS-Textract.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/AWS-Textract.md @@ -7,66 +7,105 @@ documentation: UG keywords: Assemblies --- -# Perform OCR with AWS Textract +# Perform OCR with AWS Textract -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) supports an external engine (AWS Textract) to process the OCR on image and PDF documents. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) supports external OCR engines such as AWS Textract to process OCR on images and PDF documents. -## Steps to perform OCR with AWS Textract +## Prerequisites -Step 1: Create a new .NET Console application project. +**Version Compatibility** + +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8 SDK or later +- AWS subscription with Textract API access + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + +## Steps to perform OCR with AWS Textract + +Step 1: Create a new .NET Console application project targeting **.NET Framework 4.6.2** or **.NET 8 or later**: ![Create .NET console application](OCR-Images/NET-sample-creation-step1.png) -In project configuration window, name your project and select Next. +Step 2: In the project configuration window, name your project and select **Next**: ![Project configuration window](OCR-Images/NET-sample-creation-step2.png) -Step 2: Install [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) and [AWSSDK.Textract](https://www.nuget.org/packages/AWSSDK.Textract) NuGet packages as reference to your .NET application from [nuget.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) and [AWSSDK.Textract](https://www.nuget.org/packages/AWSSDK.Textract) NuGet packages into your .NET application from [nuget.org](https://www.nuget.org/): ![NuGet package installation1](OCR-Images/OCR-Core-NuGet-package.png) ![NuGet package installation2](OCR-Images/NET-sample-creation-step4.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - -Step 3: Include the following namespaces in the Program.cs file. +Step 4: Include the following namespaces in **Program.cs**: {% tabs %} {% highlight c# tabtitle="C#" %} + using Syncfusion.OCRProcessor; using Syncfusion.Pdf.Parsing; + {% endhighlight %} {% endtabs %} -Step 4: Use the following code sample to perform OCR on a PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class with AWS Textract. +Step 5: Use the following code sample to perform OCR on a PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class with AWS Textract: {% tabs %} {% highlight c# tabtitle="C#" %} -//Initialize the OCR processor. + +// Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor()) { - //Load an existing PDF document. + // Load an existing PDF document FileStream stream = new FileStream("Region.pdf", FileMode.Open); PdfLoadedDocument lDoc = new PdfLoadedDocument(stream); - //Set the OCR language. + // Set the OCR language processor.Settings.Language = Languages.English; - //Initialize the AWS Textract external OCR engine. - IOcrEngine azureOcrEngine = new AWSExternalOcrEngine(); - processor.ExternalEngine = azureOcrEngine; - //Perform OCR with input document. + // Initialize the AWS Textract external OCR engine + IOcrEngine awsOcrEngine = new AWSExternalOcrEngine(); + processor.ExternalEngine = awsOcrEngine; + // Perform OCR on the document string text = processor.PerformOCR(lDoc); - //Create file stream. + // Create file stream for output FileStream fileStream = new FileStream("Output.pdf", FileMode.CreateNew); - //Save the document into stream. + // Save the processed document lDoc.Save(fileStream); - //Close the document. + // Close the document and dispose streams lDoc.Close(); stream.Dispose(); fileStream.Dispose(); } + {% endhighlight %} {% endtabs %} -Step 5: Create a new class named AWSExternalOcrEngine and implement the IOcrEngine interface. Get the image stream from the PerformOCR method and process it with an external OCR engine. This will return the OCRLayoutResult for the image. +Step 6: Create a new class named **AWSExternalOcrEngine** that implements the **IOcrEngine** interface. Get the image stream from the PerformOCR method and process it with AWS Textract. This will return the **OCRLayoutResult** for the image: -N> Provide a valid Secret Access Key to work with AWS Textract. +N> Provide valid AWS Access Key ID and Secret Access Key to work with AWS Textract. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -77,16 +116,21 @@ class AWSExternalOcrEngine : IOcrEngine private string awsSecretAccessKey = "SecretAccessKey"; private float imageHeight; private float imageWidth; + public OCRLayoutResult PerformOCR(Stream stream) { + // Authenticate with AWS Textract API AmazonTextractClient clientText = Authenticate(); + // Get OCR results from AWS Textract DetectDocumentTextResponse textResponse = GetAWSTextractResult(clientText, stream).Result; + // Convert AWS Textract result to OCRLayoutResult format OCRLayoutResult oCRLayoutResult = ConvertAWSTextractResultToOcrLayoutResult(textResponse); return oCRLayoutResult; } public AmazonTextractClient Authenticate() { + // Create AWS Textract client with credentials AmazonTextractClient client = new AmazonTextractClient(awsAccessKeyId, awsSecretAccessKey, RegionEndpoint.USEast1); return client; } @@ -95,11 +139,14 @@ class AWSExternalOcrEngine : IOcrEngine { stream.Position = 0; MemoryStream memoryStream = new MemoryStream(); + // Copy stream to memory stream stream.CopyTo(memoryStream); + // Get image dimensions PdfTiffImage bitmap = new PdfTiffImage(memoryStream); imageHeight = bitmap.Height; imageWidth = bitmap.Width; + // Call AWS Textract API to detect text DetectDocumentTextResponse response = await client.DetectDocumentTextAsync(new DetectDocumentTextRequest { Document = new Document @@ -118,19 +165,23 @@ class AWSExternalOcrEngine : IOcrEngine Syncfusion.OCRProcessor.Word ocrWord; layoutResult.ImageHeight = imageHeight; layoutResult.ImageWidth = imageWidth; + // Process each block from AWS Textract response foreach (var page in textResponse.Blocks) { ocrLine = new Line(); + // Process only WORD blocks if (page.BlockType == "WORD") { ocrWord = new Word(); ocrWord.Text = page.Text; + // Get bounding box coordinates from AWS Textract float left = page.Geometry.BoundingBox.Left; float top = page.Geometry.BoundingBox.Top; float width = page.Geometry.BoundingBox.Width; float height = page.Geometry.BoundingBox.Height; - Rectangle rect = GetBoundingBox(left,top,width,height); + // Convert to rectangle bounds + Rectangle rect = GetBoundingBox(left, top, width, height); ocrWord.Rectangle = rect; ocrLine.Add(ocrWord); ocrPage.Add(ocrLine); @@ -139,13 +190,15 @@ class AWSExternalOcrEngine : IOcrEngine layoutResult.Add(ocrPage); return layoutResult; } + public Rectangle GetBoundingBox(float left, float top, float width, float height) { + // Convert relative coordinates to absolute pixel coordinates int x = Convert.ToInt32(left * imageWidth); int y = Convert.ToInt32(top * imageHeight); int bboxWidth = Convert.ToInt32((width * imageWidth) + x); int bboxHeight = Convert.ToInt32((height * imageHeight) + y); - Rectangle rect = new Rectangle(x,y, bboxWidth, bboxHeight); + Rectangle rect = new Rectangle(x, y, bboxWidth, bboxHeight); return rect; } } @@ -153,7 +206,7 @@ class AWSExternalOcrEngine : IOcrEngine {% endhighlight %} {% endtabs %} -By executing the program, you will get a PDF document as follows. +By executing the program, you will obtain a PDF document with extracted text as follows: ![Output PDF](OCR-Images/Output.png) -A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/AWS%20Textract). \ No newline at end of file +A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/AWS%20Textract). \ No newline at end of file diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Amazon-Linux-EC2-Setup-Guide.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Amazon-Linux-EC2-Setup-Guide.md index 1b6385dd84..fc60dadff3 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Amazon-Linux-EC2-Setup-Guide.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Amazon-Linux-EC2-Setup-Guide.md @@ -9,23 +9,58 @@ keywords: Assemblies # Perform OCR with Tesseract on Amazon Linux EC2 using .NET application -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in the Linux application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Linux applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. This guide provides a detailed, step-by-step process for installing Tesseract OCR and its essential dependencies directly on an Amazon Linux 2023 (AL2023) EC2 instance. This approach allows you to deploy .NET applications that utilize OCR functionalities, such as those relying on Syncfusion PDF Processing with Tesseract, without the need for Docker containers. -## Pre-requisites +## Prerequisites -Before you begin, ensure you have: +**Version Compatibility** -* An active Amazon Linux 2023 (AL2023) EC2 instance. -* SSH access to your EC2 instance. -* Basic familiarity with Linux command-line operations. +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. -## Installation steps for .NET 8 and Tesseract OCR on Amazon Linux 2023 EC2 +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR + +**Required Software** + +- - .NET 8 SDK or later +- **Amazon Linux Version**: An active Amazon Linux 2023 (AL2023) EC2 instance +- **Access**: SSH access to your EC2 instance + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Licensing; + +protected void Application_Start() +{ + // Register the Syncfusion license + SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); +} + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + +## Installation steps for .NET 8 and Tesseract OCR on Amazon Linux 2023 EC2 Execute the following commands sequentially in your EC2 instance's terminal. It is recommended to run these commands from the `/home/ec2-user` directory unless specified otherwise. -Step 1: **Update System Packages**: It's crucial to start by ensuring all existing packages on your EC2 instance are up to date +Step 1: **Update System Packages** — It's crucial to start by ensuring all existing packages on your EC2 instance are up to date: {% tabs %} {% highlight bash %} @@ -35,7 +70,7 @@ sudo yum update -y {% endhighlight %} {% endtabs %} -Step 2: **Add Microsoft Package Repository** : To install the .NET SDK, you need to add the Microsoft package repository for Fedora 39, which AL2023 is based on. +Step 2: **Add Microsoft Package Repository** — To install the .NET SDK, you need to add the Microsoft package repository for Fedora 39, which AL2023 is based on: {% tabs %} {% highlight bash %} @@ -45,7 +80,7 @@ sudo curl -o /etc/yum.repos.d/packages-microsoft-com-prod.repo https://packages. {% endhighlight %} {% endtabs %} -Step 3: **Install .NET SDK**: Install the .NET 8.0 SDK using yum. This is essential for building and running your .NET application. +Step 3: **Install .NET SDK** — Install the .NET 8.0 SDK using yum. This is essential for building and running your .NET application: {% tabs %} {% highlight bash %} @@ -55,7 +90,7 @@ sudo yum install -y dotnet-sdk-8.0 {% endhighlight %} {% endtabs %} -Step 4: **Verify .NET SDK Installation** : Confirm that the .NET SDK has been installed correctly by checking its version. +Step 4: **Verify .NET SDK Installation** — Confirm that the .NET SDK has been installed correctly by checking its version: {% tabs %} {% highlight bash %} @@ -67,7 +102,7 @@ sudo dotnet --version You should see output similar to 8.0.x (where x is the patch version). -Step 5: **Install `libgdiplus` Package** : `libgdiplus` is a Mono implementation of the GDI+ API, often required by .NET applications for image processing functionalities. Run these commands completely in a single block from the `/home/ec2-user` directory. +Step 5: **Install `libgdiplus` Package** — `libgdiplus` is a Mono implementation of the GDI+ API, often required by .NET applications for image processing functionalities. Run these commands completely in a single block from the `/home/ec2-user` directory: {% tabs %} {% highlight bash %} @@ -84,7 +119,7 @@ sudo make install {% endhighlight %} {% endtabs %} -Step 6: **Install `leptonica` Package** : Leptonica is a software library that forms a core dependency for Tesseract OCR, providing image processing and analysis tools. Run these commands completely in a single block from the `/home/ec2-user` directory. +Step 6: **Install `leptonica` Package** — Leptonica is a software library that forms a core dependency for Tesseract OCR, providing image processing and analysis tools. Run these commands completely in a single block from the `/home/ec2-user` directory: {% tabs %} {% highlight bash %} @@ -102,7 +137,7 @@ sudo ldconfig {% endhighlight %} {% endtabs %} -Step 7: **Install `libpng` Package** : `libpng` is the official PNG reference library, critical for handling PNG image formats often used in OCR processes. Although `libpng-devel` was installed, building from source ensures the correct version/setup sometimes. +Step 7: **Install `libpng` Package** — `libpng` is the official PNG reference library, critical for handling PNG image formats often used in OCR processes. Although `libpng-devel` was installed, building from source ensures the correct version/setup: {% tabs %} {% highlight bash %} @@ -121,7 +156,7 @@ sudo make install {% endhighlight %} {% endtabs %} -Step 8: **Create Symbolic Link for libdl** : The .NET runtime often expects `libdl.so` to be directly accessible from its shared library path. You need to create a symbolic link from its actual location to the .NET runtime directory. +Step 8: **Create Symbolic Link for libdl** — The .NET runtime often expects `libdl.so` to be directly accessible from its shared library path. You need to create a symbolic link from its actual location to the .NET runtime directory: First, find the path of your installed .NET runtime version: @@ -144,7 +179,7 @@ Microsoft.NETCore.App 8.0.x [/usr/lib64/dotnet/shared/Microsoft.NETCore.App] {% endhighlight %} {% endtabs %} -Now, create the symbolic link. `Replace 8.0.17` with the exact version number from your `dotnet --list-` output for `Microsoft.NETCore.App`. +Now, create the symbolic link. Replace `8.0.17` with the exact version number from your `dotnet --list-` output for `Microsoft.NETCore.App`: {% tabs %} {% highlight bash %} @@ -154,9 +189,7 @@ sudo ln -s /usr/lib64/libdl.so.2 /usr/lib64/dotnet/shared/Microsoft.NETCore.App/ {% endhighlight %} {% endtabs %} -Step 9: Create Symbolic Link for `libpng16` - -Create a symbolic link for the `libpng16` package to ensure it's accessible in common library paths. +Step 9: **Create Symbolic Link for `libpng16`** — Create a symbolic link for the `libpng16` package to ensure it's accessible in common library paths: {% tabs %} {% highlight bash %} @@ -166,9 +199,7 @@ sudo ln -s /usr/local/lib/libpng16.so.16 /lib64/libpng16.so.16 {% endhighlight %} {% endtabs %} -Step 10: Create Symbolic Link for `liblept` - -Similarly, create a symbolic link for the `liblept` package (Leptonica library). +Step 10: **Create Symbolic Link for `liblept`** — Similarly, create a symbolic link for the `liblept` package (Leptonica library): {% tabs %} {% highlight bash %} @@ -178,9 +209,9 @@ sudo ln -s /usr/local/lib/liblept.so.5 /lib64/liblept.so.5 {% endhighlight %} {% endtabs %} -Step 11: **Implement the Project Code** : To set up your project's OCR functionality, consult the comprehensive guide on [Perform OCR in Linux](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/linux). +Step 11: **Implement the Project Code** — To set up your project's OCR functionality, consult the comprehensive guide on [Perform OCR in Linux](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/linux). -Step 12: **Set Permissions for Tesseract Binaries** : Navigate to your application's Tesseract binaries directory and set read, write, and execute permissions. This is crucial for the OCR process to function correctly. Important: You need to change `bin/Debug/net8.0/runtimes/linux/native` to the actual path where your Syncfusion Tesseract binaries (e.g., `libSyncfusionTesseract.so, liblept1753.so`) are located within your published application. +Step 12: **Set Permissions for Tesseract Binaries** — Navigate to your application's Tesseract binaries directory and set read, write, and execute permissions. This is crucial for the OCR process to function correctly. Note: You need to change `bin/Debug/net8.0/runtimes/linux/native` to the actual path where your Syncfusion Tesseract binaries (e.g., `libSyncfusionTesseract.so`, `liblept1753.so`) are located within your published application: {% tabs %} {% highlight bash %} @@ -191,17 +222,14 @@ sudo chmod 777 liblept1753.so {% endhighlight %} {% endtabs %} -Step 13: **Build and Run Your .NET Application** : Finally, build and publish your .NET application, and then run it. +Step 13: **Build and Run Your .NET Application** — Finally, build and publish your .NET application, and then run it: {% tabs %} {% highlight bash %} sudo dotnet build - sudo dotnet publish -c Release -o ./publish - cd publish - sudo dotnet PdfProcessingApi.dll --urls "http://0.0.0.0:5000" {% endhighlight %} @@ -209,7 +237,7 @@ sudo dotnet PdfProcessingApi.dll --urls "http://0.0.0.0:5000" Remember to replace `PdfProcessingApi.dll` with the actual name of your application's entry-point DLL. -By executing the program, you will get the PDF document as follows. The output will be saved in parallel to the program.cs file. +By executing the program, you will obtain a PDF document with extracted text as follows. The output will be saved in parallel to the **Program.cs** file: ![OCR Linux Output](OCR-Images/OCR-output-image.png) -A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Linux). \ No newline at end of file +A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Linux). \ No newline at end of file diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Kubernetes-Service.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Kubernetes-Service.md index 6e02345b22..c097b7f32c 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Kubernetes-Service.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Kubernetes-Service.md @@ -11,24 +11,61 @@ keywords: Assemblies The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) can be integrated with external OCR engines like Azure Computer Vision and deployed on Azure Kubernetes Service (AKS) to efficiently process OCR tasks on images and PDF documents at scale. +## Prerequisites + +**Version Compatibility** + +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8 SDK or later +- Docker installed on your system +- Azure Kubernetes Service (AKS) cluster access +- kubectl (Kubernetes CLI) installed + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + ## Steps to perform OCR with Azure Kubernetes Service -Step 1: Create a new ASP.NET Core application project. +Step 1: Create a new ASP.NET Core application project targeting **.NET 8 or later**: ![ASP.NET Core project creation](OCR-Images/OCRDocker1.png) -Step 2: In the project configuration window, name your project and select Next. +Step 2: In the project configuration window, name your project and select **Next**: ![Docker project configuration window](OCR-Images/OCR-docker-configuration-window.png) -Step 3: Enable the Docker support with Linux as a target OS. +Step 3: Enable Docker support with **Linux** as the target OS: ![Set the docker target](OCR-Images/OCR_docker_target.png) -Step 4: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). +Step 4: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your ASP.NET Core application from [nuget.org](https://www.nuget.org/): ![NuGet package installation](OCR-Images/OCR-Core-NuGet-package.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - -Step 5: Include the following commands in the Docker file to install the dependent packages in the docker container. +Step 5: Include the following commands in the **Dockerfile** to install the required system packages in the Docker container: {% tabs %} {% highlight bash %} @@ -41,11 +78,11 @@ ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so {% endhighlight %} {% endtabs %} -![OCR commends in docker file](OCR-Images/OCR-Command-aks.png) +![OCR commands in docker file](OCR-Images/OCR-Command-aks.png) -Step 6: A default action method named Index will be present in the *HomeController.cs*. Right-click on the Index method and select Go to View, where you will be directed to its associated view page *Index.cshtml*. +Step 6: A default action method named **Index** will be present in **HomeController.cs**. Right-click on the **Index** method and select **Go to View**, which will take you to the associated **Index.cshtml** view page: -Step 7: Add a new button in the *index.cshtml* as follows. +Step 7: Add a new button in **Index.cshtml** to trigger the OCR process: {% tabs %} {% highlight CSHTML %} @@ -62,9 +99,9 @@ Step 7: Add a new button in the *index.cshtml* as follows. {% endhighlight %} {% endtabs %} -![Action method file image](OCR-Images/OCRDocker6.png) +![Action method file image](OCR-Images/OCRDocker6.png) -Step 8: A default controller with the name *HomeController.cs* gets added to the creation of the ASP.NET Core project. Include the following namespaces in that HomeController.cs file. +Step 8: A default controller named **HomeController.cs** is added when you create the ASP.NET Core project. Include the following namespaces in **HomeController.cs**: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -75,32 +112,34 @@ using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -Step 9: Add a new action method PerformOCR in the *HomeController.cs*, and include the code sample to perform OCR on the entire PDF document using `PerformOCR` method of the `OCRProcessor` class. +Step 9: Add a new action method named **PerformOCR** in **HomeController.cs** to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class: {% tabs %} {% highlight c# tabtitle="C#" %} public ActionResult PerformOCR() { - string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf"; - //Initialize the OCR processor. + string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf"; + // Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor()) { FileStream fileStream = new FileStream(docPath, FileMode.Open, FileAccess.Read); - //Load a PDF document + // Load a PDF document PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream); - //Set OCR language to process + // Set OCR language processor.Settings.Language = Languages.English; - //Process OCR by providing the PDF document. + // Set Tesseract version (5.0 is bundled with v21.1.x+) + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Perform OCR on the document processor.PerformOCR(lDoc); - //Create memory stream + // Create memory stream MemoryStream stream = new MemoryStream(); - //Save the document to memory stream + // Save the processed document to memory stream lDoc.Save(stream); lDoc.Close(); - //Set the position as '0' + // Reset stream position to ensure the file is not empty stream.Position = 0; - //Download the PDF document in the browser + // Download the PDF document in the browser FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf"); fileStreamResult.FileDownloadName = "Sample.pdf"; return fileStreamResult; @@ -115,19 +154,15 @@ public ActionResult PerformOCR() ### Overview This guide provides step-by-step instructions to deploy an application using Docker and Kubernetes. We'll tag a Docker image, push it to a repository, and apply Kubernetes configurations. -### Prerequisites -* Docker installed on your system -* Access to a Kubernetes cluster -* Kubernetes CLI (kubectl) installed - ### Detailed Explanation of Docker Image Tagging -Step 1: Tag the Docker image + +**Step 1: Tag the Docker image** Tagging a Docker image is an essential step in Docker container management. It allows you to create an alias for a Docker image, making it easier to identify and manage. Tags are often used to denote different versions or environments (e.g., development, staging, production). -1.Open your terminal. Ensure Docker is running on your system. +1. Open your terminal and ensure Docker is running on your system. -2.Run the tag command. Use the following syntax to tag your Docker image: +2. Run the tag command using the following syntax: {% tabs %} {% highlight bash %} @@ -137,25 +172,25 @@ docker tag : {% endhighlight %} {% endtabs %} -![Tag commends in docker file](OCR-Images/Tag-docker-image.png) +![Tag commands in docker file](OCR-Images/Tag-docker-image.png) -Step 2: Push the Docker Image +**Step 2: Push the Docker Image** -Pushing uploads your tagged image to a Docker repository, making it accessible for deployment. +Pushing uploads your tagged image into a Docker repository, making it accessible for deployment: {% tabs %} {% highlight bash %} -docker push : +docker push : {% endhighlight %} {% endtabs %} -![Push commends in docker file](OCR-Images/Push-docker-aks.png) +![Push commands in docker file](OCR-Images/Push-docker-aks.png) -Step 3: Apply the deployment configuration +**Step 3: Apply the deployment configuration** -This step creates or updates your application's deployment configuration in your Kubernetes cluster. +This step creates or updates your application's deployment configuration in your Kubernetes cluster: {% tabs %} {% highlight bash %} @@ -165,12 +200,11 @@ kubectl apply -f deployment.yaml {% endhighlight %} {% endtabs %} +![Deploy commands in docker file](OCR-Images/Deploy-docker-aks.png) -![Deploy commends in docker file](OCR-Images/Deploy-docker-aks.png) - -Step 4: Apply the service configuration +**Step 4: Apply the service configuration** -Creating a service configuration exposes your application to the network, allowing external access. +Creating a service configuration exposes your application to the network, allowing external access: {% tabs %} {% highlight bash %} @@ -180,11 +214,11 @@ kubectl apply -f service.yaml {% endhighlight %} {% endtabs %} -![Apply commends in docker file](OCR-Images/Apply-docker-aks.png) +![Apply commands in docker file](OCR-Images/Apply-docker-aks.png) -Step 5: Viewing service details +**Step 5: View service details** -Using **kubectl get service** allows you to check the services running in your Kubernetes cluster, ensuring they are correctly configured and accessible. You can copy the external IP and paste it into a browser like Chrome to view your application's output. +Using **kubectl get service** allows you to check the services running in your Kubernetes cluster, ensuring they are correctly configured and accessible. You can copy the external IP and paste it into a browser like Chrome to view your application: {% tabs %} {% highlight bash %} @@ -194,16 +228,16 @@ kubectl get service {% endhighlight %} {% endtabs %} -![Service commends in docker file](OCR-Images/Service-docker-aks.png) +![Service commands in docker file](OCR-Images/Service-docker-aks.png) - Now be able to use this to browse the the web app running on AKS. +Now you can use this to browse the web application running on AKS: - ![Button click in docker file](OCR-Images/Button-docker-aks.png) +![Button click in docker file](OCR-Images/Button-docker-aks.png) - Click create PDF document to create a PDF document.You will get the output PDF document as follows. +Click **Perform OCR on entire PDF** to create a PDF document with OCR text extraction. You will obtain the output PDF document as follows: - ![Output in docker file](OCR-Images/ocr-output-image.png) +![Output in docker file](OCR-Images/ocr-output-image.png) - You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Docker). +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Docker). - Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. \ No newline at end of file +Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. \ No newline at end of file diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Vision.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Vision.md index aad5fc93f3..8a2473ae35 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Vision.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Azure-Vision.md @@ -7,58 +7,97 @@ documentation: UG keywords: Assemblies --- -# Perform OCR with Azure Vision +# Perform OCR with Azure Vision -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) supports external engines (Azure Computer Vision) to process the OCR on images and PDF documents. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) supports external OCR engines such as Azure Computer Vision to process OCR on images and PDF documents. -## Steps to perform OCR with Azure Computer Vision -Step 1: Create a new .NET Console application project. -![Create .NET console application](OCR-Images/NET-sample-Azure-step1.png) +## Prerequisites -In project configuration window, name your project and select Next. +**Version Compatibility** + +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8 SDK or later +- Azure subscription with Computer Vision API access +- Azure subscription key and endpoint + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + +## Steps to perform OCR with Azure Computer Vision + +Step 1: Create a new .NET Console application project targeting **.NET Framework 4.6.2** or **.NET 8 or later**: +![Create .NET console application](OCR-Images/NET-sample-Azure-step1.png) + +Step 2: In the project configuration window, name your project and select **Next**: ![NET sample configuration window](OCR-Images/NET-sample-Azure-step2.png) -Step 2: Install [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) and [Microsoft.Azure.CognitiveServices.Vision.ComputerVision](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision) NuGet packages as reference to your .NET application from [nuget.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) and [Microsoft.Azure.CognitiveServices.Vision.ComputerVision](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision) NuGet packages into your application from [nuget.org](https://www.nuget.org/): ![NuGet package installation1](OCR-Images/OCR-Core-NuGet-package.png) ![NuGet package installation2](OCR-Images/NET-sample-Azure-step4.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - -Step 3: Include the following namespaces in the Program.cs file. +Step 4: Include the following namespaces in the **Program.cs** file: {% tabs %} {% highlight c# tabtitle="C#" %} + using Syncfusion.OCRProcessor; using Syncfusion.Pdf.Parsing; + {% endhighlight %} {% endtabs %} -Step 4: Use the following code sample to perform OCR on a PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class with Azure Vision. +Step 5: Use the following code sample to perform OCR on a PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class with Azure Vision: {% tabs %} {% highlight c# tabtitle="C#" %} -//Initialize the OCR processor. +// Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor()) { - //Load an existing PDF document. + // Load an existing PDF document FileStream stream = new FileStream("Input.pdf", FileMode.Open); PdfLoadedDocument lDoc = new PdfLoadedDocument(stream); - //Set OCR language. + // Set OCR language processor.Settings.Language = Languages.English; - //Initialize the Azure vision OCR external engine. + // Initialize the Azure Vision OCR external engine IOcrEngine azureOcrEngine = new AzureExternalOcrEngine(); processor.ExternalEngine = azureOcrEngine; - //Perform OCR. + // Perform OCR using Azure Vision processor.PerformOCR(lDoc); - //Create file stream. + // Create file stream for the output FileStream outputStream = new FileStream("OCR.pdf", FileMode.CreateNew); - //Save the document into stream. + // Save the document to the output stream lDoc.Save(outputStream); - //If the position is not set to '0' then the PDF will be empty. + // Reset stream position to ensure the file is not empty outputStream.Position = 0; - //Close the document. + // Close the document lDoc.Close(true); outputStream.Close(); } @@ -66,9 +105,9 @@ using (OCRProcessor processor = new OCRProcessor()) {% endhighlight %} {% endtabs %} -Step 5: Create a new class named AzureExternalOcrEngine to get the image stream from the PerformOCR method and process the image stream with an external engine. It returns the OCRLayoutResult for the image. +Step 6: Create a new class named **AzureExternalOcrEngine** to handle the image stream from the PerformOCR method and process it with Azure Computer Vision. It returns the **OCRLayoutResult** for the image: -N> Provide a valid subscription key and endpoint to work with Azure computer vision. +N> Provide a valid Azure subscription key and endpoint to work with Azure Computer Vision API. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -77,10 +116,14 @@ class AzureExternalOcrEngine : IOcrEngine { private string subscriptionKey = "SubscriptionKey"; private string endpoint = "Endpoint link"; + public OCRLayoutResult PerformOCR(Stream imgStream) { + // Authenticate with Azure Computer Vision API ComputerVisionClient client = Authenticate(); + // Read the image stream and get OCR results ReadResult azureOcrResult = ReadFileUrl(client, imgStream).Result; + // Convert Azure OCR result to the OCRLayoutResult format OCRLayoutResult result = ConvertAzureVisionOcrToOcrLayoutResult(azureOcrResult); return result; } @@ -101,7 +144,7 @@ class AzureExternalOcrEngine : IOcrEngine string operationLocation = textHeaders.OperationLocation; const int numberOfCharsInOperationId = 36; string operationId = operationLocation.Substring(operationLocation.Length - numberOfCharsInOperationId); - //Extract the text + // Extract the text from Azure Vision results ReadOperationResult results; do { @@ -111,6 +154,7 @@ class AzureExternalOcrEngine : IOcrEngine ReadResult azureOcrResult = results.AnalyzeResult.ReadResults[0]; return azureOcrResult; } + private OCRLayoutResult ConvertAzureVisionOcrToOcrLayoutResult(ReadResult azureVisionOcr) { Syncfusion.OCRProcessor.Line ocrLine; @@ -118,22 +162,19 @@ class AzureExternalOcrEngine : IOcrEngine OCRLayoutResult ocrlayoutResult = new OCRLayoutResult(); ocrlayoutResult.ImageWidth = (float)azureVisionOcr.Width; ocrlayoutResult.ImageHeight = (float)azureVisionOcr.Height; - //Page + // Create page from Azure OCR result Syncfusion.OCRProcessor.Page normalPage = new Syncfusion.OCRProcessor.Page(); - //Lines + // Process lines from Azure OCR result foreach (var line in azureVisionOcr.Lines) { ocrLine = new Syncfusion.OCRProcessor.Line(); - //Word + // Process words in each line foreach (var word in line.Words) { ocrWord = new Syncfusion.OCRProcessor.Word(); - Rectangle rect = GetAzureVisionBounds(word.BoundingBox); - ocrWord.Text = word.Text; ocrWord.Rectangle = rect; - ocrLine.Add(ocrWord); } normalPage.Add(ocrLine); @@ -147,6 +188,7 @@ class AzureExternalOcrEngine : IOcrEngine Rectangle rect = Rectangle.Empty; PointF[] pointCollection = new PointF[bbox.Count / 2]; int count = 0; + // Convert Azure bounding box points to PointF array for (int i = 0; i < bbox.Count; i = i + 2) { pointCollection[count] = new PointF((float)bbox[i], (float)bbox[i + 1]); @@ -189,9 +231,9 @@ class AzureExternalOcrEngine : IOcrEngine {% endhighlight %} {% endtabs %} -By executing the program, you will get a PDF document as follows. -![Output PDF document](OCR-Images/Output.png) +By executing the program, you will obtain a PDF document with extracted text as follows: +![Output PDF document](OCR-Images/Output.png) -A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure%20Vision). +A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure%20Vision). -Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. \ No newline at end of file +Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. \ No newline at end of file diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Console.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Console.md index e15674bf13..135bc87bbd 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Console.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Console.md @@ -8,33 +8,66 @@ documentation: UG # Perform OCR in Console Application -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in console application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in console applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. -## Steps to perform OCR on the entire PDF document in Console application +## Prerequisites -{% tabcontents %} +**Version Compatibility** -{% tabcontent Visual Studio %} +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8 SDK or later +- Visual Studio, Visual Studio Code, or JetBrains Rider + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); -**Prerequisites**: +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + +## Steps to perform OCR on an entire PDF document in Console application -* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download). -* Install Visual Studio: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735). +{% tabcontents %} + +{% tabcontent Visual Studio %} -Step 1: Create a new .NET Core console application project. +Step 1: Create a new .NET console application project targeting **.NET 8.0**. ![Create Console application](OCR-Images/Console-1.png) -Step 2: In configuration windows, name your project and select Next. +Step 2: In the project configuration window, name your project and select **Next**, then select the target framework (.NET 6 or later) and click **Create**. ![Configuration window1](OCR-Images/Console-2.png) ![Configuration window2](OCR-Images/Console-3.png) -Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your console application from [NuGet.org](https://www.nuget.org/). ![NuGet package installation](OCR-Images/OCR-Core-NuGet-package.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. -Step 4: Include the following namespaces in the *Program.cs*. +Step 4: Include the following namespaces in **Program.cs**: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -45,23 +78,25 @@ using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -Step 5: Include the following code sample in *Program.cs* using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 5: Include the following code sample in **Program.cs** using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class: {% tabs %} {% highlight c# tabtitle="C#" %} -//Initialize the OCR processor. +// Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor()) { - //Load an existing PDF document. + // Load an existing PDF document PdfLoadedDocument document = new PdfLoadedDocument(Path.GetFullPath(@"Data/Input.pdf")); - //Set OCR language. + // Set the Tesseract version + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Set OCR language processor.Settings.Language = Languages.English; - //Perform OCR with input document and tessdata (Language packs). + // Perform OCR on the document processor.PerformOCR(document); - //Save the PDF document. + // Save the processed PDF to disk document.Save(Path.GetFullPath(@"Output/Output.pdf")); - //Close the document. + // Close the document document.Close(true); } @@ -74,39 +109,33 @@ Click the **Build** button in the toolbar or press Ctrl+ShiftF5 to run the app. +Click the **Run** button (green arrow) in the toolbar or press F5 to run the application. {% endtabcontent %} {% tabcontent Visual Studio Code %} -**Prerequisites**: - -* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://code.visualstudio.com/download?_exp_download=d53503e735). -* Install Visual Studio Code: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735). -* Install C# Extension for VS Code: Open Visual Studio Code, go to the Extensions view (Ctrl+Shift+X), and search for 'C#'. Install the official [C# extension provided by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp). - -Step 1: Open the terminal (Ctrl+` ) and run the following command to create a new Console Application project. +Step 1: Open the terminal (Ctrl+`) and run the following command to create a new console application project targeting **.NET 8 or later**: ``` -dotnet new console -n ConsoleApplication +dotnet new console -n ConsoleApplication --framework net8.0 ``` -Step 2: Replace ****ConsoleApplication** with your desired project name. -Step 3: Navigate to the project directory using the following command +Step 2: Replace **ConsoleApplication** with your desired project name. + +Step 3: Navigate to the project directory: ``` cd ConsoleApplication ``` -Step 4: Use the following command in the terminal to add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package to your project. + +Step 4: Use the following command in the terminal to add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package: ``` dotnet add package Syncfusion.PDF.OCR.Net.Core ``` -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. -Step 5: Include the following namespaces in the *Program.cs*. +Step 5: Include the following namespaces in **Program.cs**: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -117,23 +146,25 @@ using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -Step 6: Include the following code sample in *Program.cs* using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 6: Include the following code sample in **Program.cs** using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class: {% tabs %} {% highlight c# tabtitle="C#" %} -//Initialize the OCR processor. +// Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor()) { - //Load an existing PDF document. + // Load an existing PDF document PdfLoadedDocument document = new PdfLoadedDocument(Path.GetFullPath(@"Data/Input.pdf")); - //Set OCR language. + // Set the Tesseract version + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Set OCR language processor.Settings.Language = Languages.English; - //Perform OCR with input document and tessdata (Language packs). + // Perform OCR on the document processor.PerformOCR(document); - //Save the PDF document. + // Save the processed PDF to disk document.Save(Path.GetFullPath(@"Output/Output.pdf")); - //Close the document. + // Close the document document.Close(true); } @@ -142,7 +173,7 @@ using (OCRProcessor processor = new OCRProcessor()) Step 7: Build the project. -Run the following command in terminal to build the project. +Run the following command in terminal to build the project: ``` dotnet build @@ -150,7 +181,7 @@ dotnet build Step 8: Run the project. -Run the following command in terminal to build the project. +Run the following command in terminal to run the application: ``` dotnet run @@ -158,38 +189,30 @@ dotnet run {% endtabcontent %} -{% tabcontent JetBrains Raider %} +{% tabcontent JetBrains Rider %} -**Prerequisites:** - -* JetBrains Rider. -* Install .NET 8 SDK or later. - -Step 1. Open JetBrains Rider and create a new .NET Core console application project. -* Launch JetBrains Rider. -* Click new solution on the welcome screen. +Step 1: Open JetBrains Rider and create a new .NET console application project: +- Launch JetBrains Rider +- Click **New Solution** on the welcome screen ![Launch JetBrains Rider](OCR-Images/Launch-JetBrains-Rider.png) -* In the new Solution dialog, select Project Type as Console. -* Enter a project name and specify the location. -* Select the target framework (e.g., .NET 8.0, .NET 9.0 or .NET 10.0). -* Click create. +- In the new Solution dialog, select **Console** as the Project Type +- Enter a project name and specify the location +- Select the target framework(e.g., .NET 8.0, .NET 9.0 and .NET 10). +- Click **Create** ![Creating a new Console project in JetBrains Rider](OCR-Images/Create-Console-NET-core-sample.png) -Step 2: Install the NuGet package from [NuGet.org](https://www.nuget.org/). -* Click the NuGet icon in the Rider toolbar and type [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) in the search bar. -* Ensure that "NuGet.org" is selected as the package source. -* Select the latest Syncfusion.PDF.OCR.Net.Core NuGet package from the list. -* Click the + (Add) button to add the package. +Step 2: Install the NuGet package from [NuGet.org](https://www.nuget.org/): +- Click the **NuGet** icon in the Rider toolbar and search for [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) +- Ensure **NuGet.org** is selected as the package source +- Select the latest Syncfusion.PDF.OCR.Net.Core package from the list +- Click the **+** (Add) button to add the package ![Select the Syncfusion.PDF.OCR.NET package](OCR-Images/JetBrains-Package.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - -Step 3: Include the following namespaces in the *Program.cs*. +Step 3: Include the following namespaces in **Program.cs**: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -200,23 +223,25 @@ using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -Step 4: Include the following code sample in *Program.cs* using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 4: Include the following code sample in **Program.cs** using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class: {% tabs %} {% highlight c# tabtitle="C#" %} -//Initialize the OCR processor. +// Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor()) { - //Load an existing PDF document. + // Load an existing PDF document PdfLoadedDocument document = new PdfLoadedDocument(Path.GetFullPath(@"Data/Input.pdf")); - //Set OCR language. + // Set the Tesseract version + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Set OCR language processor.Settings.Language = Languages.English; - //Perform OCR with input document and tessdata (Language packs). + // Perform OCR on the document processor.PerformOCR(document); - //Save the PDF document. + // Save the processed PDF to disk document.Save(Path.GetFullPath(@"Output/Output.pdf")); - //Close the document. + // Close the document document.Close(true); } @@ -229,13 +254,13 @@ Click the **Build** button in the toolbar or press Ctrl+ShiftF5 to run the app. +Click the **Run** button (green arrow) in the toolbar or press F5 to run the application. {% endtabcontent %} {% endtabcontents %} -By executing the program, you will get the PDF document as follows +By executing the program, you will get a PDF document with extracted text as shown below: ![Console output PDF document](OCR-Images/OCR-output-image.png) A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Console). diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Docker.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Docker.md index b144503141..5559110c21 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Docker.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Docker.md @@ -8,25 +8,61 @@ keywords: Assemblies --- # Perform OCR in Docker -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from the scanned PDFs and images in the Docker application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Docker applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. + +## Prerequisites + +**Version Compatibility** + +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8 SDK or later +- Docker installed and running +- Linux container image (typically Ubuntu) + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. ## Steps to perform OCR on entire PDF document in Docker -Step 1: Create a new ASP.NET Core application project. +Step 1: Create a new ASP.NET Core application project targeting **.NET 8.0 or later**. ![ASP.NET Core project creation](OCR-Images/OCRDocker1.png) -Step 2: In the project configuration window, name your project and select Next. +Step 2: In the project configuration window, name your project and select **Next**. ![Docker project configuration window](OCR-Images/OCR-docker-configuration-window.png) -Step 3: Enable the Docker support with Linux as a target OS. +Step 3: Enable Docker support with **Linux** as the target OS. ![Set the docker target](OCR-Images/OCR_docker_target.png) -Step 4: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). +Step 4: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your .NET applications from [NuGet.org](https://www.nuget.org/). ![NuGet package installation](OCR-Images/OCR-Core-NuGet-package.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - -Step 5: Include the following commands in the Docker file to install the dependent packages in the docker container. +Step 5: Include the following commands in the **Dockerfile** to install the required system packages: {% tabs %} {% highlight bash %} @@ -40,11 +76,11 @@ RUN ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so {% endhighlight %} {% endtabs %} -![OCR commends in docker file](OCR-Images/Docker_file_commends.png) +![OCR commands in Docker file](OCR-Images/Docker_file_commends.png) -Step 6: A default action method named Index will be present in the *HomeController.cs*. Right-click on the Index method and select Go to View, where you will be directed to its associated view page *Index.cshtml*. +Step 6: A default action method named **Index** is present in **HomeController.cs**. Right-click on the **Index** method and select **Go to View** to navigate to its associated view page **Index.cshtml**. -Step 7: Add a new button in the *index.cshtml* as follows. +Step 7: Add a new button in **Index.cshtml** as follows: {% tabs %} {% highlight CSHTML %} @@ -63,7 +99,7 @@ Step 7: Add a new button in the *index.cshtml* as follows. ![Action method file image](OCR-Images/OCRDocker6.png) -Step 8: A default controller with the name *HomeController.cs* gets added to the creation of the ASP.NET Core project. Include the following namespaces in that HomeController.cs file. +Step 8: A default controller named **HomeController.cs** is added when you create an ASP.NET Core project. Include the following namespaces in **HomeController.cs**: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -74,34 +110,34 @@ using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -Step 9: Add a new action method PerformOCR in the *HomeController.cs*, and include the code sample to perform OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 9: Add a new action method **PerformOCR** in **HomeController.cs** to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class: {% tabs %} {% highlight c# tabtitle="C#" %} public ActionResult PerformOCR() { - string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf"; - //Initialize the OCR processor. + string docPath = _hostingEnvironment.WebRootPath + "/Data/Input.pdf"; + // Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor()) { FileStream fileStream = new FileStream(docPath, FileMode.Open, FileAccess.Read); - //Load a PDF document + // Load a PDF document PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream); - //Set OCR language to process + // Set the OCR language processor.Settings.Language = Languages.English; - //Process OCR by providing the PDF document. + // Set Tesseract version + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Process OCR on the PDF document processor.PerformOCR(lDoc); - //Create memory stream + // Create memory stream and save the processed document MemoryStream stream = new MemoryStream(); - //Save the document to memory stream lDoc.Save(stream); lDoc.Close(); - //Set the position as '0' + // Set the position to 0 and return as file download stream.Position = 0; - //Download the PDF document in the browser FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf"); - fileStreamResult.FileDownloadName = "Sample.pdf"; + fileStreamResult.FileDownloadName = "Output.pdf"; return fileStreamResult; } } @@ -109,12 +145,12 @@ public ActionResult PerformOCR() {% endhighlight %} {% endtabs %} -Step 10: Build and run the sample in Docker. It will pull the Linux Docker image from the Docker hub and run the project. Now, the webpage will open in the browser. Click the button to convert the webpage to a PDF. +Step 10: Build and run the application in Docker. It will pull the Linux Docker image and run the project. The webpage will open in your browser. Click the button to perform OCR on the PDF document. -By executing the program, you will get a PDF document as follows. +By executing the program, you will get a PDF document with extracted text as shown below: -![Linux docker output](OCR-Images/OCR-output-image.png) +![Linux Docker output](OCR-Images/OCR-output-image.png) -A complete working sample for converting an HTML to PDF in the Linux docker container can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Docker). +A complete working sample for performing OCR in a Docker container can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Docker). Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. \ No newline at end of file diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Linux.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Linux.md index b030eca489..3f4bece96c 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Linux.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Linux.md @@ -9,10 +9,49 @@ keywords: Assemblies # Perform OCR in Linux -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in the Linux application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. -## Pre-requisites +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in .NET console applications on Linux with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. -The following Linux dependencies should be installed where the conversion takes place. +## Prerequisites + +**Version Compatibility** + +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8.0 or later version +- Linux x86_64 architecture + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + +**Linux Dependencies** + +The following Linux system dependencies should be installed where the OCR processing takes place: {% tabs %} {% highlight bash %} @@ -27,10 +66,9 @@ ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so {% endhighlight %} {% endtabs %} +## Steps to perform OCR on an entire PDF document on Linux -## Steps to convert HTML to PDF in .NET Core application on Linux - -Step 1: Execute the following command in the Linux terminal to create a new .NET Core Console application. +Step 1: Execute the following command in the Linux terminal to create a new .NET Core Console application: {% tabs %} {% highlight bash %} @@ -42,19 +80,19 @@ dotnet new console ![OCR Linux Step1](OCR-Images/LinuxStep1.png) -Step 2: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Core application [NuGet.org](https://www.nuget.org/). +Step 2: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your .NET Core application from [NuGet.org](https://www.nuget.org/): {% tabs %} {% highlight bash %} -dotnet add package Syncfusion.PDF.OCR.Net.Core -v xx.x.x.xx -s https://www.nuget.org/ +dotnet add package Syncfusion.PDF.OCR.Net.Core {% endhighlight %} {% endtabs %} ![OCR Linux Step2](OCR-Images/LinuxStep2.png) -Step 3: Include the following namespaces in Program.cs file. +Step 3: Include the following namespaces in **Program.cs** file. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -66,14 +104,12 @@ using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -N> Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. - -Step 4: Add code sample to perform OCR on entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 4: Add the following code sample to perform OCR on an entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. {% tabs %} {% highlight c# tabtitle="C#" %} -string docPath = ("input.pdf"); +string docPath = "Input.pdf"; //Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor()) @@ -81,35 +117,23 @@ using (OCRProcessor processor = new OCRProcessor()) //Load the PDF document FileStream stream = new FileStream(docPath, FileMode.Open, FileAccess.Read); PdfLoadedDocument lDoc = new PdfLoadedDocument(stream); - - //Language to process the OCR + //Set the Tesseract version. + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + //Set OCR language to process. processor.Settings.Language = Languages.English; - //Process OCR by providing loaded PDF document, Data dictionary and language + //Process OCR by providing the PDF document. processor.PerformOCR(lDoc); - - //Save the OCR processed PDF document in the disk - MemoryStream streamData = new MemoryStream(); - lDoc.Save(streamData); - File.WriteAllBytes("Output.pdf", streamData.ToArray()); + //Save the OCR processed PDF document to disk. + lDoc.Save("Output.pdf"); lDoc.Close(true); + stream.Dispose(); + Console.WriteLine("OCR processing completed successfully!"); } {% endhighlight %} {% endtabs %} -Step 5: Execute the following command to restore the NuGet packages. - -{% tabs %} -{% highlight bash %} - -dotnet restore - -{% endhighlight %} -{% endtabs %} - -![OCR Linux Step3](OCR-Images/LinuxStep3.png) - -Step 6: Execute the following command in the terminal to build the application. +Step 5: Execute the following command to build the application: {% tabs %} {% highlight bash %} @@ -119,9 +143,9 @@ dotnet build {% endhighlight %} {% endtabs %} -![OCR Linux Step4](OCR-Images/LinuxStep4.png) +![OCR Linux Step3](OCR-Images/LinuxStep3.png) -Step 7: Execute the following command in the terminal to run the application. +Step 6: Execute the following command in the terminal to run the application: {% tabs %} {% highlight bash %} @@ -131,9 +155,9 @@ dotnet run {% endhighlight %} {% endtabs %} -![OCR Linux Step5](OCR-Images/LinuxStep5.png) +![OCR Linux Step4](OCR-Images/LinuxStep4.png) -By executing the program, you will get the PDF document as follows. The output will be saved in parallel to the program.cs file. +By executing the program, you will get a PDF document with extracted text. The output will be saved in the same directory as the executable: ![OCR Linux Output](OCR-Images/OCR-output-image.png) A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Linux). \ No newline at end of file diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/MAC.md b/Document-Processing/Data-Extraction/NET/ocr-processor/MAC.md index 8c56c29d1d..596fe3b556 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/MAC.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/MAC.md @@ -1,6 +1,6 @@ --- -title: Perform OCR on PDF and Image Files in Mac | Syncfusion -description: Learn how to perform OCR on scanned PDF documents and images in WPF with different Tesseract versions using Syncfusion .NET OCR library. +title: Perform OCR on PDF and Image Files in macOS | Syncfusion +description: Learn how to perform OCR on scanned PDF documents and images in macOS with different Tesseract versions using Syncfusion .NET OCR library. platform: document-processing control: PDF documentation: UG @@ -9,30 +9,61 @@ keywords: Assemblies # Perform OCR on macOS -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) used to extract text from scanned PDFs and images in the Mac application. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in .NET console applications on macOS with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. -## Steps to perform OCR on entire PDF document in Mac +## Prerequisites -{% tabcontents %} +**Version Compatibility** -{% tabcontent Visual Studio %} +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8 SDK or later +- Visual Studio or Visual Studio Code + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; -**Prerequisites**: +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); -* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download). -* Install Visual Studio: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735). +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + +## Steps to perform OCR on an entire PDF document on macOS + +{% tabcontents %} + +{% tabcontent Visual Studio %} Step 1: Create a new .NET Core console application project. ![Mac OS console application](OCR-Images/Mac_OS_Console.png) -Step 2: Select the project version. +Step 2: Select your target framework (.NET 8.0 or later). -Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your project from [NuGet.org](https://www.nuget.org/). ![Mac OS NuGet path](OCR-Images/Mac_OS_NuGet_path.png) -N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to learn about registering the Syncfusion® license key in your application to use our components. - -Step 4: Include the following Namespaces in the Program.cs file. +Step 4: Include the following namespaces in the **Program.cs** file. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -43,7 +74,7 @@ using Syncfusion.Pdf.Parsing; {% endtabs %} -Step 5: Add the following code sample to the *Program.cs* file to **Perform OCR in .NET Core application on Mac OS**. +Step 5: Add the following code sample to the **Program.cs** file to perform OCR on a PDF document. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -54,21 +85,17 @@ using (OCRProcessor processor = new OCRProcessor()) FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read); //Load a PDF document. PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream); + //Set the Tesseract version + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; //Set the OCR language to be processed. processor.Settings.Language = Languages.English; //Process OCR by providing the PDF document. processor.PerformOCR(lDoc); - //Create memory stream. - MemoryStream stream = new MemoryStream(); - //Save the document to the memory stream. - lDoc.Save(stream); + //Save the document to disk. + lDoc.Save("OCR.pdf"); lDoc.Close(); - //Set the position as '0'. - stream.Position = 0; - //Download the PDF document in the browser. - FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf"); - fileStreamResult.FileDownloadName = "OCR.pdf"; - return fileStreamResult; + fileStream.Dispose(); + Console.WriteLine("OCR processing completed successfully!"); } {% endhighlight %} @@ -77,42 +104,37 @@ using (OCRProcessor processor = new OCRProcessor()) Step 6: Build the project. -Click on Build > Build Solution or press Ctrl + Shift + B to build the project. +Click **Build > Build Solution** or press Ctrl+Shift+B to build the project. Step 7: Run the project. -Click the Start button (green arrow) or press F5 to run the app. +Click the **Start** button (green arrow) or press F5 to run the app. {% endtabcontent %} {% tabcontent Visual Studio Code %} -**Prerequisites**: - -* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download). -* Install Visual Studio Code: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735). -* Install C# Extension for VS Code: Open Visual Studio Code, go to the Extensions view (Ctrl+Shift+X), and search for 'C#'. Install the official [C# extension provided by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp). - -Step 1: Open the terminal (Ctrl+` ) and run the following command to create a new .NET Core console application project. +Step 1: Open the terminal (Ctrl+`) and run the following command to create a new .NET Core console application project: ``` dotnet new console -n CreatePdfMacOSApp ``` -Step 2: Replace **CreatePdfMacOSApp** with your desired project name. -Step 3: Navigate to the project directory using the following command +Step 2: Replace `CreatePdfMacOSApp` with your desired project name. + +Step 3: Navigate to the project directory using the following command: ``` cd CreatePdfMacOSApp ``` -Step 4: Use the following command in the terminal to add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package to your project. + +Step 4: Use the following command in the terminal to add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package to your project: ``` dotnet add package Syncfusion.PDF.OCR.Net.Core ``` -N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to learn about registering the Syncfusion® license key in your application to use our components. -Step 5: Include the following Namespaces in the Program.cs file. +Step 5: Include the following namespaces in the **Program.cs** file. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -123,7 +145,7 @@ using Syncfusion.Pdf.Parsing; {% endtabs %} -Step 6: Add the following code sample to the *Program.cs* file to **Perform OCR in .NET Core application on Mac OS**. +Step 6: Add the following code sample to the **Program.cs** file to perform OCR on a PDF document. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -134,21 +156,17 @@ using (OCRProcessor processor = new OCRProcessor()) FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read); //Load a PDF document. PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream); + //Set the Tesseract version. + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; //Set the OCR language to be processed. processor.Settings.Language = Languages.English; //Process OCR by providing the PDF document. processor.PerformOCR(lDoc); - //Create memory stream. - MemoryStream stream = new MemoryStream(); - //Save the document to the memory stream. - lDoc.Save(stream); + //Save the document to disk. + lDoc.Save("OCR.pdf"); lDoc.Close(); - //Set the position as '0'. - stream.Position = 0; - //Download the PDF document in the browser. - FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf"); - fileStreamResult.FileDownloadName = "OCR.pdf"; - return fileStreamResult; + fileStream.Dispose(); + Console.WriteLine("OCR processing completed successfully!"); } {% endhighlight %} @@ -157,7 +175,7 @@ using (OCRProcessor processor = new OCRProcessor()) Step 7: Build the project. -Run the following command in terminal to build the project. +Run the following command in the terminal to build the project: ``` dotnet build @@ -165,7 +183,7 @@ dotnet build Step 8: Run the project. -Run the following command in terminal to build the project. +Run the following command in the terminal to run the project: ``` dotnet run @@ -174,7 +192,7 @@ dotnet run {% endtabcontents %} -By executing the program, you will get a PDF document as follows. +By executing the program, you will get a PDF document with extracted text as follows. ![OCR output document](OCR-Images/Output.png) A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Mac). diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/WPF.md b/Document-Processing/Data-Extraction/NET/ocr-processor/WPF.md index 87bf25a9c7..4d76456e0b 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/WPF.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/WPF.md @@ -9,22 +9,55 @@ keywords: Assemblies # Perform OCR in WPF (Windows Presentation Foundation) -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) used to extract text from scanned PDFs and images in the WPF application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in WPF applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. -## Steps to perform OCR on entire PDF document in WPF +## Prerequisites + +**Version Compatibility** + +- Syncfusion.Pdf.OCR.WPF supports WPF applications targeting .NET Framework 4.6.2 and later, as well as .NET 8.0 for Windows and later versions + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the "Syncfusion.Licensing" assembly reference and register a license key in your application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) for details on registering a Syncfusion® license key. + +To register the license key, add the following code to your **App.xaml.cs** file at the beginning of the `App` constructor: + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Licensing; + +public partial class App : Application +{ + public App() + { + SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY"); + } +} + +{% endhighlight %} +{% endtabs %} + +## Steps to perform OCR on an entire PDF document in WPF Step 1: Create a new WPF application project. ![WPF application creation](OCR-Images/OCR-WPF-app-creation.png) -In project configuration window, name your project and select Create. +In the project configuration window, select your target framework (.NET Framework 4.6.2 or later), name your project, and select **Create**. ![WPF project configuration window](OCR-Images/OCR-WPF-project-configuration.png) -Step 2: Install the [Syncfusion.Pdf.OCR.Wpf](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.Wpf) NuGet package as a reference to your WPF application from [nuget.org](https://www.nuget.org/). +Step 2: Install the [Syncfusion.Pdf.OCR.Wpf](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.Wpf) NuGet package into your WPF application from [nuget.org](https://www.nuget.org/). ![OCR NuGet package installation](OCR-Images/OCR-WPF-NuGet-package.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - Step 3: Add a new button in **MainWindow.xaml** to perform OCR as follows. {% tabs %} @@ -37,18 +70,21 @@ Step 3: Add a new button in **MainWindow.xaml** to perform OCR as follows. {% endhighlight %} {% endtabs %} -Step 6: Include the following namespaces in the **MainWindow.xaml.cs** file. +Step 4: Build the project to ensure the XAML compiles and generates the code-behind properly. Press **Ctrl+Shift+B** or go to **Build > Build Solution**. + +Step 5: Include the following namespaces in the **MainWindow.xaml.cs** file. {% tabs %} {% highlight c# tabtitle="C#" %} +using System.Windows; using Syncfusion.OCRProcessor; using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -Step 4: Add the following code to a Button_Click to perform OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 6: Add the following code to the `Button_Click` event handler to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -59,18 +95,17 @@ private void Button_Click(object sender, RoutedEventArgs e) { //Load an existing PDF document. PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf"); - //Set the tesseract version. - processor.Settings.TesseractVersion = TesseractVersion.Version4_0; + //Set the Tesseract version + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; //Set OCR language to process. processor.Settings.Language = Languages.English; //Process OCR by providing the PDF document. - processor.PerformOCR(loadedDocument); - //Save the OCR processed PDF document in the disk. + processor.PerformOCR(loadedDocument); + //Save the OCR processed PDF document to disk. loadedDocument.Save("OCR.pdf"); loadedDocument.Close(true); } } - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Web-API.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Web-API.md index bd113b8678..9ed2178860 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Web-API.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Web-API.md @@ -9,28 +9,60 @@ keywords: pdf, core, web api, csharp # Perform OCR in ASP.NET Core Web API -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in console application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in ASP.NET Core Web API applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. -To include the .NET OCR library in your ASP.NET Core Web API, please refer to the [NuGet Package](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/nuget-packages-required) Required' or [Assemblies Required](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/assemblies-required) documentation. +To include the .NET OCR library in your ASP.NET Core Web API, please refer to the [NuGet Packages Required](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/nuget-packages-required) or [Assemblies Required](https://help.syncfusion.com/document-processing/data-extraction/net/ocr-processor/assemblies-required) documentation. -## Steps to perform OCR on the entire PDF document in ASP.NET Core Web API +## Prerequisites + +**Version Compatibility** + +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + +## Steps to perform OCR on an entire PDF document in ASP.NET Core Web API Step 1: Create a new C# ASP.NET Core Web API project. ![Convert OCR Web API Step1](OCR-Images/Web-API-1.png) -Step 2: In the project configuration windows, name your project and click Create. +Step 2: In the project configuration window, select your target framework (.NET 8.0 or later), name your project, and click **Create**. ![Convert OCR Web API Step2](OCR-Images/Web-API-2.png) -Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your ASP.NET Core Web API project from [NuGet.org](https://www.nuget.org/). ![NuGet package installation](OCR-Images/Web-API-6.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. +Step 4: Build the project to ensure all NuGet packages are properly restored. Press **Ctrl+Shift+B** or go to **Build > Build Solution**. -Step 4: Add a new API controller empty file in the project. +Step 5: Add a new API controller empty file in the project. ![Add new class](OCR-Images/Web-API-4.png) -Step 5: Include the following namespaces in the *PdfController.cs*. +Step 6: Include the following namespaces in the *PdfController.cs*. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -41,7 +73,7 @@ using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -Step 6: Include the following code sample in *PdfController.cs* using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 7: Include the following code sample in *PdfController.cs* using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. {% tabs %} {% highlight c# tabtitle="C#" %} @@ -49,28 +81,36 @@ Step 6: Include the following code sample in *PdfController.cs* using [PerformOC [HttpGet("/api/Pdf")] public IActionResult ConvertOCR() { - FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read); - //Load an existing PDF document. - PdfLoadedDocument document = new PdfLoadedDocument(fileStream); - //Set OCR language. - processor.Settings.Language = Languages.English; - //Perform OCR with input document and tessdata (Language packs). - processor.PerformOCR(document); - //Create memory stream. - MemoryStream stream = new MemoryStream(); - //Save the document to memory stream. - document.Save(stream); - stream.Position = 0; - return File(stream, "application/pdf", "Output.pdf"); + //Initialize the OCR processor. + using (OCRProcessor processor = new OCRProcessor()) + { + FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read); + //Load an existing PDF document. + PdfLoadedDocument document = new PdfLoadedDocument(fileStream); + //Set the Tesseract version. + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + //Set OCR language. + processor.Settings.Language = Languages.English; + //Perform OCR with input document and tessdata (Language packs). + processor.PerformOCR(document); + //Create memory stream. + MemoryStream stream = new MemoryStream(); + //Save the document to memory stream. + document.Save(stream); + stream.Position = 0; + fileStream.Dispose(); + document.Dispose(); + return File(stream, "application/pdf", "Output.pdf"); + } } {% endhighlight %} {% endtabs %} -Step 7: Navigate to the `Swagger UI`, expand the `GET /api/Pdf` API, click `Execute`, and then download the response output. +Step 8: Navigate to the `Swagger UI`, expand the `GET /api/Pdf` API, click **Execute**, and then download the response output. ![Swagger UI](OCR-Images/Web-API-5.png) -By executing the program, you will get the PDF document as follows. +By executing the program, you will get a PDF document with extracted text as follows. ![OCR output document](OCR-Images/OCR-output-image.png) A complete working sample can be downloaded from [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Web%20API). diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/Windows-Forms.md b/Document-Processing/Data-Extraction/NET/ocr-processor/Windows-Forms.md index 487b0f5077..3d6286c86b 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/Windows-Forms.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/Windows-Forms.md @@ -9,7 +9,21 @@ keywords: Assemblies # Perform OCR in Windows Forms The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Windows Forms applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. -## Register the license key +## Prerequisites + +**Version Compatibility** + +- Syncfusion.Pdf.OCR.WinForms supports .NET Framework 4.6.2 and later, as well as .NET 8.0 for Windows and later + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Register the License Key** N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the "Syncfusion.Licensing" assembly reference and register a license key in your application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) for details on registering a Syncfusion® license key. @@ -29,6 +43,9 @@ public Form1() {% endhighlight %} {% endtabs %} +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + ## Steps to perform OCR on an entire PDF document in Windows Forms Step 1: Create a new Windows Forms application project. @@ -40,17 +57,6 @@ In the project configuration window, select your target framework (.NET Framewor Step 2: Install the [Syncfusion.Pdf.OCR.WinForms](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.WinForms) NuGet package into your WinForms application from [nuget.org](https://www.nuget.org/). ![OCR NuGet package installation](OCR-Images/OCR-WF-NuGet-package.png) -**Version Compatibility:** -- Syncfusion.Pdf.OCR.WinForms supports .NET Framework 4.6.2 and later, as well as .NET 8.0 for Windows and later - -**Supported Inputs:** -- Single-page and multi-page PDF documents -- Scanned images in common formats (JPEG, PNG, TIFF) -- Recommended DPI: 200 DPI or higher for optimal OCR accuracy - -N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. -N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. - Step 3: Add a new button in Form1.Designer.cs file. {% tabs %} diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/aspnet-mvc.md b/Document-Processing/Data-Extraction/NET/ocr-processor/aspnet-mvc.md index 52e9e1df01..8a708073f2 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/aspnet-mvc.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/aspnet-mvc.md @@ -9,24 +9,56 @@ keywords: Assemblies # Perform OCR in ASP.NET MVC -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in ASP.NET MVC application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in ASP.NET MVC applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. + +## Prerequisites + +**Version Compatibility** + +- Syncfusion.Pdf.OCR.AspNet.Mvc5 supports Web applications targeting .NET Framework 4.6.2 and later, as well as .NET 8.0 for Windows and later versions + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Register the License Key** + +Include a license key in the **Global.asax.cs** file before creating an **OCRProcessor** instance. Refer to the [Syncfusion License](https://help.syncfusion.com/common/essential-studio/licensing/overview) documentation to learn about registering the Syncfusion license key in your application. + +{% tabs %} +{% highlight c# tabtitle="C#" %} + +using Syncfusion.Licensing; + +protected void Application_Start() +{ + // Register the Syncfusion license + SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); +} + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. ## Steps to perform OCR on entire PDF document in ASP.NET MVC -Step 1: Create a new C# ASP.NET Web Application (.NET Framework) project. +Step 1: Create a new C# ASP.NET Web Application (.NET Framework) project targeting **.NET Framework 4.6.2** or **later**: ![ASP.NET MVC application creation](OCR-Images/OCR-MVC-app-creation.png) -Step 2: In the project configuration windows, name your project and click Create. +Step 2: In the project configuration window, name your project and click **Create**: ![ASP.NET MVC project configuration1](OCR-Images/OCR-MVC-project-configuration1.png) ![ASP.NET MVC project configuration2](OCR-Images/OCR-MVC-project-configuration2.png) -Step 3: Install the [Syncfusion.Pdf.OCR.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.AspNet.Mvc5) NuGet package as a reference to your .NET applications from [NuGet.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.Pdf.OCR.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.Pdf.OCR.AspNet.Mvc5) NuGet package into your .NET application from [NuGet.org](https://www.nuget.org/): ![OCR ASP.NET MVC NuGet package installation](OCR-Images/OCR-MVC-NuGet-package.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - -Step 4: Include the following namespaces in the HomeController.cs file. +Step 4: Include the following namespaces in the **HomeController.cs** file: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -37,7 +69,7 @@ using Syncfusion.Pdf.Parsing; {% endhighlight %} {% endtabs %} -Step 5: Add a new button in the *Index.cshtml* as follows. +Step 5: Add a new button in the **Index.cshtml** as follows: {% tabs %} {% highlight CSHTML %} @@ -54,38 +86,40 @@ Step 5: Add a new button in the *Index.cshtml* as follows. {% endhighlight %} {% endtabs %} -Step 6: Add a new action method named PerformOCR in the HomeController.cs file and use the following code sample to perform OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 6: Add a new action method named **PerformOCR** in the **HomeController.cs** file and use the following code sample to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class: {% tabs %} {% highlight c# tabtitle="C#" %} + public ActionResult PerformOCR() { - //Initialize the OCR processor. - using (OCRProcessor processor = new OCRProcessor()) - { - FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read); - //Load a PDF document. - PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream); - //Set OCR language to process. - processor.Settings.Language = Languages.English; - processor.Settings.TesseractVersion = TesseractVersion.Version3_05; - //Process OCR by providing the PDF document. - processor.PerformOCR(lDoc); - //Open the document in browser after saving it. - lDoc.Save("Output.pdf", HttpContext.ApplicationInstance.Response, Syncfusion.Pdf.HttpReadType.Save); - //Close the document. - lDoc.Close(true); - } - return View(); + // Initialize the OCR processor + using (OCRProcessor processor = new OCRProcessor()) + { + // Open the input PDF document + FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read); + // Load the PDF document + PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream); + // Set the OCR language + processor.Settings.Language = Languages.English; + // Set the Tesseract version + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Perform OCR on the document + processor.PerformOCR(lDoc); + // Save and download the processed document to the browser + lDoc.Save("Output.pdf", HttpContext.ApplicationInstance.Response, Syncfusion.Pdf.HttpReadType.Save); + // Close and dispose the document + lDoc.Close(true); + } + return View(); } {% endhighlight %} {% endtabs %} -By executing the program, you will get a PDF document as follows. +By executing the program, you will obtain a PDF document with extracted text as follows: ![OCR ASP.NET MVC output PDF document](OCR-Images/OCR-output-image.png) -A complete working sample can be downloaded from the [Github](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/ASP.NET%20MVC). +A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/ASP.NET%20MVC). -Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. - \ No newline at end of file +Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. \ No newline at end of file diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/azure.md b/Document-Processing/Data-Extraction/NET/ocr-processor/azure.md index 4d4c4e689e..cdb911d3c2 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/azure.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/azure.md @@ -11,24 +11,59 @@ keywords: Assemblies The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Azure with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. +## Prerequisites + +**Version Compatibility** + +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8 SDK or later +- Azure subscription with Azure App Service or Azure Functions + +**Register the License Key** + +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. + +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +{% endhighlight %} +{% endtabs %} + +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + ## Azure App Service Windows -### Steps to perform OCR on entire PDF document in Azure App Service +### Steps to perform OCR on an entire PDF document in Azure App Service -Step 1: Create a new ASP.NET Core MVC application. -![Create ASP.NET Core MVC application](OCR-Images/azure_step1.png) +Step 1: Create a new ASP.NET Core MVC application targeting **.NET 8 or later**: +![Create ASP.NET Core MVC application](OCR-Images/azure_step1.png) -Step 2: In configuration windows, name your project and click Next. -![Configuration window1](OCR-Images/Azure_configuration_window1.png) -![Configuration window2](OCR-Images/azure_additional_information.png) +Step 2: In the configuration window, name your project and click **Next**: +![Configuration window1](OCR-Images/Azure_configuration_window1.png) +![Configuration window2](OCR-Images/azure_additional_information.png) -Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your ASP.NET Core application from [nuget.org](https://www.nuget.org/): ![PDF OCR ASP.NET Core NuGet package](OCR-Images/OCR-Core-NuGet-package.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - -Step 4: Add a new button in index.cshtml as follows. +Step 4: Add a new button in **Index.cshtml** to trigger the OCR process: {% tabs %} {% highlight CSHTML %} @@ -47,34 +82,36 @@ Step 4: Add a new button in index.cshtml as follows. {% endhighlight %} {% endtabs %} -Step 5: Include the following namespaces in the HomeController.cs file. +Step 5: Include the following namespaces in **HomeController.cs**: {% tabs %} {% highlight c# tabtitle="C#" %} using Syncfusion.OCRProcessor; using Syncfusion.Pdf.Parsing; -using Microsoft.AspNetCore.Hosting.IHostingEnvironment; +using Microsoft.AspNetCore.Hosting; {% endhighlight %} {% endtabs %} -Step 6: Add the code samples for performing OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class. +Step 6: Add the code sample to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class: {% tabs %} {% highlight c# tabtitle="C#" %} public IActionResult PerformOCR() { - //Initialize the OCR processor. + // Initialize the OCR processor OCRProcessor processor = new OCRProcessor(); - //Load a PDF document. + // Load a PDF document PdfLoadedDocument lDoc = new PdfLoadedDocument("Input.pdf"); - //Set OCR language to process. + // Set OCR language processor.Settings.Language = Languages.English; - //Perform OCR with input document. + // Set Tesseract version (5.0 is bundled with v21.1.x+) + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Perform OCR on the document string ocr = processor.PerformOCR(lDoc); - //Save the document. + // Save the processed document MemoryStream stream = new MemoryStream(); lDoc.Save(stream); return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "OCR_Azure.pdf"); @@ -83,65 +120,65 @@ public IActionResult PerformOCR() {% endhighlight %} {% endtabs %} -Step 7: Now, check the OCR creation in the local machine. +Step 7: Test the OCR creation on your local machine. -### Steps to publish as Azure App Service +### Steps to publish to Azure App Service -Step 1: Right-click the project and click Publish. -![Click publish button](OCR-Images/azure_step5.png) +Step 1: Right-click the project and click **Publish**: +![Click publish button](OCR-Images/azure_step5.png) -Step 2: Create a new profile in the publish target window. -![Create new profile1](OCR-Images/azure_step6.png) +Step 2: Create a new profile in the publish target window: +![Create new profile1](OCR-Images/azure_step6.png) -Step 3: Select the Specific target as **Azure App Service (Windows)**. -![Create new profile2](OCR-Images/azure_step7.png) +Step 3: Select the specific target as **Azure App Service (Windows)**: +![Create new profile2](OCR-Images/azure_step7.png) -Step 4: To create a new app service, click **Create new** option. +Step 4: To create a new App Service, click **Create new**: ![Click create new option](OCR-Images/azure_step8.png) -Step 5: Click the **Create** button to proceed with **App Service** creation. +Step 5: Click the **Create** button to proceed with **App Service** creation: ![Click the create button](OCR-Images/azure_step9.png) -Step 6: Click the **Finish** button to finalize the **App Service** creation. +Step 6: Click the **Finish** button to finalize the **App Service** creation: ![Click the finish button](OCR-Images/azure_step10.png) -Step 7: Click **Close** button. +Step 7: Click the **Close** button: ![Create a ASP.NET Core Project](OCR-Images/azure_step11.png) -Step 8: Click the **Publish** button. +Step 8: Click the **Publish** button: ![Click the Publish button](OCR-Images/azure_step12.png) -Step 9: Now, Publish has been succeeded. +Step 9: The publish operation has been completed successfully: ![Publish has been succeeded](OCR-Images/azure_step13.png) -Now, the published webpage will open in the browser, then click the **Perform OCR** button then perform OCR on a PDF document. -![Published webpage](OCR-Images/Output-genrate-webpage.png) -![OCR output document](OCR-Images/OCR-output-image.png) +The published webpage will open in the browser. Click the **Perform OCR** button to perform OCR on a PDF document: +![Published webpage](OCR-Images/Output-genrate-webpage.png) +![OCR output document](OCR-Images/OCR-output-image.png) -A complete work sample for performing OCR on a PDF document in Azure App Service on Windows can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure/Azure%20App%20Services). +A complete working sample for performing OCR on a PDF document in Azure App Service on Windows can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure/Azure%20App%20Services). ## Azure Functions -### Steps to perform OCR on the entire PDF document in Azure Functions +### Steps to perform OCR on an entire PDF document in Azure Functions -Step 1: Create the Azure function project. -![Create azure function project](OCR-Images/AzureFunctions1.png) +Step 1: Create the Azure Function project: +![Create azure function project](OCR-Images/AzureFunctions1.png) -Step 2: Select the framework to Azure Functions and select HTTP triggers as follows. -![Configuration window1](OCR-Images/AzureFunctions2.png) -![Additional information](OCR-Images/AzureFunctions3.png) +Step 2: Select Azure Functions as the framework and configure HTTP trigger: +![Configuration window1](OCR-Images/AzureFunctions2.png) +![Additional information](OCR-Images/AzureFunctions3.png) -Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your Azure Functions project from [nuget.org](https://www.nuget.org/): ![NuGet package installation](OCR-Images/OCR-Core-NuGet-package.png) -Step 4: Copy the tessdata folder from the **bin->Debug->net6.0->runtimes** and paste it into the folder that contains the project file. -![OCR Azure Functions Tessdata Path](OCR-Images/Tessdata-path.png) -![OCR Azure Functions Tessdata Store](OCR-Images/Tessdata_Store.png) +Step 4: Copy the **tessdata** folder from **bin > Debug > net6.0 > runtimes** and paste it into the folder containing your project file: +![OCR Azure Functions Tessdata Path](OCR-Images/Tessdata-path.png) +![OCR Azure Functions Tessdata Store](OCR-Images/Tessdata_Store.png) -Step 5: Then, set Copy to output directory to give copy always the tessdata folder. +Step 5: Set the **tessdata** folder to **Copy Always** in the output directory: ![OCR Azure Functions Tessdata Store](OCR-Images/Set_Copy_Always.png) -Step 6: Include the following namespaces in the **Function1.cs** file to perform OCR for a PDF document using C#. +Step 6: Include the following namespaces in **Function1.cs** to perform OCR on a PDF document: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -163,7 +200,7 @@ using Microsoft.Azure.WebJobs.Extensions.Http; {% endhighlight %} {% endtabs %} -Step 7: Add the following code sample in the Function1 class to perform OCR for a PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class in Azure Functions. +Step 7: Add the following code sample in the **Function1** class to perform OCR on a PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -174,31 +211,34 @@ public static async Task Run([HttpTrigger(AuthorizationLeve MemoryStream ms = new MemoryStream(); try { + // Initialize the OCR processor OCRProcessor processor = new OCRProcessor(); FileStream stream = new FileStream(Path.Combine(executionContext.FunctionAppDirectory, "Data", "Input.pdf"), FileMode.Open); - //Load a PDF document. + // Load a PDF document PdfLoadedDocument lDoc = new PdfLoadedDocument(stream); - //Set OCR language to process. + // Set OCR language processor.Settings.Language = Languages.English; - //Perform OCR with input document. - string ocr = processor.PerformOCR(lDoc,Path.Combine(executionContext.FunctionAppDirectory, "tessdata")); - //Save the PDF document. + // Set Tesseract version (5.0 is bundled with v21.1.x+) + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Perform OCR on the document with tessdata path + string ocr = processor.PerformOCR(lDoc, Path.Combine(executionContext.FunctionAppDirectory, "tessdata")); + // Save the processed PDF document lDoc.Save(ms); ms.Position = 0; } catch (Exception ex) { - //Add a page to the document. + // Create an error document with exception details PdfDocument document = new PdfDocument(); PdfPage page = document.Pages.Add(); - //Create PDF graphics for the page. + // Create PDF graphics for the page PdfGraphics graphics = page.Graphics; - //Set the standard font. + // Set the standard font PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 6); - //Draw the text. + // Draw the error message graphics.DrawString(ex.ToString(), font, PdfBrushes.Black, new Syncfusion.Drawing.PointF(0, 0)); ms = new MemoryStream(); - //Save the PDF document. + // Save the error document document.Save(ms); } HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); @@ -214,40 +254,39 @@ public static async Task Run([HttpTrigger(AuthorizationLeve {% endhighlight %} {% endtabs %} -Step 8: Now, check the OCR creation in the local machine. +Step 8: Test the OCR creation on your local machine. -### Steps to publish as Azure Functions +### Steps to publish to Azure Functions -Step 1: Right-click the project and click Publish. Then, create a new profile in the Publish Window. So, create the Azure Function App with a consumption plan. +Step 1: Right-click the project and click **Publish**. Create a new profile in the Publish window to create the Azure Function App with a consumption plan: ![OCR Azure Functions publish1](OCR-Images/AzureFunctions5.png) ![OCR Azure Functions publish2](OCR-Images/azure_step6.png) ![OCR Azure Functions publish3](OCR-Images/AzureFunctions7.png) -Step 2: To create a new app service, click **Create new** option. +Step 2: To create a new Function App, click **Create new**: ![Click create new option](OCR-Images/AzureFunctions8.png) -Step 3: Click the **Create** button to proceed with **App Service** creation. +Step 3: Click the **Create** button to proceed with **Function App** creation: ![Click the create button](OCR-Images/AzureFunctions9.png) -Step 4: Click the **Finish** button to finalize the **App Service** creation. +Step 4: Click the **Finish** button to finalize the **Function App** creation: ![Click the finish button](OCR-Images/AzureFunctions10.png) -Step 5: Click deployment type. +Step 5: Select the deployment type: ![Create a Deployment type](OCR-Images/Deployment_type.png) -Step 6: Click **Close** button. +Step 6: Click the **Close** button: ![Create a ASP.NET Core Project](OCR-Images/AzureFunctions11.png) -Step 7: Click the **Publish** button. +Step 7: Click the **Publish** button: ![Click the Publish button](OCR-Images/AzureFunctions12.png) -Step 8: Now, Publish has been succeeded. +Step 8: The publish operation has been completed successfully: ![Publish has been succeeded](OCR-Images/AzureFunctions13.png) - -Step 9: Now, go to the Azure portal and select the Functions Apps. After running the service, click Get function URL > Copy. Include the URL as a query string in the URL. Then, paste it into the new browser tab. You will get a PDF document as follows. +Step 9: Go to the Azure portal and select **Function Apps**. After the service is running, click **Get function URL > Copy**. Include the URL as a query string and paste it into a new browser tab. You will obtain a PDF document as follows: ![Output PDF document](OCR-Images/OCR-output-image.png) A complete working sample can be downloaded from [GitHub](https://github.com/SyncfusionExamples/OCR-csharp-examples/tree/master/Azure/Azure%20Function). -Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. \ No newline at end of file +Click [here](https://www.syncfusion.com/document-sdk/net-pdf-library) to explore the rich set of Syncfusion® PDF library features. \ No newline at end of file diff --git a/Document-Processing/Data-Extraction/NET/ocr-processor/blazor.md b/Document-Processing/Data-Extraction/NET/ocr-processor/blazor.md index 1d475319f8..6cf28ca849 100644 --- a/Document-Processing/Data-Extraction/NET/ocr-processor/blazor.md +++ b/Document-Processing/Data-Extraction/NET/ocr-processor/blazor.md @@ -9,63 +9,93 @@ keywords: Assemblies # Perform OCR in Blazor -The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in the Blazor application with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. +The [.NET OCR library](https://www.syncfusion.com/document-sdk/net-pdf-library/ocr-process) is used to extract text from scanned PDFs and images in Blazor applications with the help of Google's [Tesseract](https://github.com/tesseract-ocr/tesseract) Optical Character Recognition engine. -## Steps to perform OCR on the entire PDF document in the Blazor application +## Prerequisites -{% tabcontents %} +**Version Compatibility** -{% tabcontent Visual Studio %} +- Syncfusion.PDF.OCR.Net.Core supports .NET 8.0 and later versions. + +**Supported Inputs** + +The OCR processor supports the following input formats: + +- Single-page and multi-page PDF documents +- Scanned images in common formats (JPEG, PNG, TIFF) +- Recommended DPI: 200 DPI or higher for optimal OCR accuracy + +**Required Software** + +- .NET 8 SDK or later +- Visual Studio, Visual Studio Code, or JetBrains Rider + +**Register the License Key** -**Prerequisites**: +N> Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must add the Syncfusion.Licensing assembly reference and register a license key in your application. For more information, see the licensing documentation. -* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download). -* Install Visual Studio: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download?_exp_download=d53503e735). +Include the following code in the **Program.cs** file to register the license key: + +{% tabs %} +{% highlight c# tabtitle="C#" %} +using Syncfusion.Licensing; + +// Register Syncfusion license at application startup +SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); + +{% endhighlight %} +{% endtabs %} -Step 1: Create a new C# Blazor Server application project. Select Blazor App from the template and click Next. +N> 1. Beginning from version 21.1.x, the TesseractBinaries and Tesseract language data folders are now included by default; you no longer have to set these paths explicitly. +N> 2. The current NuGet package includes Tesseract 5.0, which provides support for 100+ languages. + +## Steps to perform OCR on an entire PDF document in Blazor + +{% tabcontents %} + +{% tabcontent Visual Studio %} + +Step 1: Create a new C# Blazor Server application project targeting **.NET 6 or later**. Select **Blazor App** from the template and click **Next**: ![Blazor server app creation](OCR-Images/blazor_server_app_creation.png) -Step 2: In the project configuration window, name your project and click Create. +Step 2: In the project configuration window, name your project and click **Create**. ![Blazor server project configuraion1](OCR-Images/blazor_server_configuration1.png) -Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package as a reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/). +Step 3: Install the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) NuGet package into your Blazor application from [NuGet.org](https://www.nuget.org/). ![NuGet package installation](OCR-Images/OCR-Core-NuGet-package.png) -N> 1. Beginning from version 21.1.x, the default configuration includes the addition of the TesseractBinaries and Tesseract language data folder paths, eliminating the requirement to explicitly provide these paths. -N> 2. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. - -Step 4: Create a new class file named *ExportService* under the Data folder and include the following namespaces in the file. +Step 4: Create a new class file named **ExportService** under the Data folder and include the following namespaces: {% tabs %} {% highlight c# tabtitle="C#" %} using Syncfusion.OCRProcessor; using Syncfusion.Pdf.Parsing; -using System.IO; {% endhighlight %} {% endtabs %} -Step 5: Use the following code sample to perform OCR on the entire PDF document using [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class in the **ExportService** file. +Step 5: Use the following code sample to perform OCR on the entire PDF document using the [PerformOCR](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html#Syncfusion_OCRProcessor_OCRProcessor_PerformOCR_Syncfusion_Pdf_Parsing_PdfLoadedDocument_System_String_) method of the [OCRProcessor](https://help.syncfusion.com/cr/document-processing/Syncfusion.OCRProcessor.OCRProcessor.html) class in the **ExportService** file: {% tabs %} {% highlight c# tabtitle="C#" %} public MemoryStream CreatePdf() { - //Initialize the OCR processor. + // Initialize the OCR processor using (OCRProcessor processor = new OCRProcessor("Tesseractbinaries/Windows")) { FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read); - //Load a PDF document. + // Load a PDF document PdfLoadedDocument lDoc = new PdfLoadedDocument(fileStream); - //Set OCR language to process. + // Set OCR language processor.Settings.Language = Languages.English; - //Process OCR by providing the PDF document. + // Set Tesseract version + processor.Settings.TesseractVersion = TesseractVersion.Version5_0; + // Perform OCR on the document processor.PerformOCR(lDoc, "tessdata/"); - //Create memory stream. + // Create memory stream and save the processed document MemoryStream stream = new MemoryStream(); - //Save the document to memory stream. lDoc.Save(stream); return stream; } @@ -74,7 +104,7 @@ public MemoryStream CreatePdf() {% endhighlight %} {% endtabs %} -Step 6: Register your service in the ConfigureServices method available in the *Startup.cs* class as follows. +Step 6: Register your service in the **ConfigureServices** method available in **Startup.cs**: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -90,19 +120,19 @@ public void ConfigureServices(IServiceCollection services) {% endhighlight %} {% endtabs %} -Step 7: Inject ExportService into *FetchData.razor* using the following code. +Step 7: Inject **ExportService** into **FetchData.razor** using the following code: {% tabs %} {% highlight CSHTML %} @inject ExportService exportService @inject Microsoft.JSInterop.IJSRuntime JS -@using System.IO +@using System.IO {% endhighlight %} {% endtabs %} -Step 8: Create a button in the *FetchData.razor* using the following code. +Step 8: Create a button in **FetchData.razor** using the following code: {% tabs %} {% highlight CSHTML %} @@ -112,7 +142,7 @@ Step 8: Create a button in the *FetchData.razor* using the following code. {% endhighlight %} {% endtabs %} -Step 9: Add the PerformOCR method in *FetchData.razor* page to call the export service. +Step 9: Add the **PerformOCR** method in **FetchData.razor** to call the export service: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -122,9 +152,9 @@ Step 9: Add the PerformOCR method in *FetchData.razor* page to call the export s protected async Task PerformOCR() { ExportService exportService = new ExportService(); - using (MemoryStream excelStream = exportService.CreatePdf()) + using (MemoryStream pdfStream = exportService.CreatePdf()) { - await JS.SaveAs("Output.pdf", excelStream.ToArray()); + await JS.SaveAs("Output.pdf", pdfStream.ToArray()); } } } @@ -132,7 +162,7 @@ Step 9: Add the PerformOCR method in *FetchData.razor* page to call the export s {% endhighlight %} {% endtabs %} -Step 10: Create a class file with the FileUtil name and add the following code to invoke the JavaScript action to download the file in the browser. +Step 10: Create a class file named **FileUtil** and add the following code to invoke the JavaScript action to download the file in the browser: {% tabs %} {% highlight c# tabtitle="C#" %} @@ -149,7 +179,7 @@ public static class FileUtil {% endhighlight %} {% endtabs %} -Step 11: Add the following JavaScript function in the *_Host.cshtml* available under the Pages folder. +Step 11: Add the following JavaScript function in **_Host.cshtml** (available under the Pages folder): {% tabs %} {% highlight CSHTML %} @@ -157,7 +187,7 @@ Step 11: Add the following JavaScript function in the *_Host.cshtml* available u