Contents
- Namespaces
- Properties
- Events
- Methods
- Classes
Having trouble getting help?
Contact Support
Contact Support
Migrate from Xamarin.Forms SfPdfViewer to .NET MAUI SfPdfViewer
To make migration from Xamarin SfPdfViewer to .NET MAUI SfPdfViewer easier, we kept most of the APIs from Xamarin SfPdfViewer in MAUI SfPdfViewer. However, to maintain the consistency of API naming in MAUI SfPdfViewer, we renamed some of the APIs. The APIs that have been changed in MAUI SfPdfViewer from Xamarin SfPdfViewer are detailed as follows.
Namespaces
Xamarin SfPdfViewer | .NET MAUI SfPdfViewer |
---|---|
Syncfusion.SfPdfViewer.XForms | Syncfusion.Maui.PdfViewer |
Properties
Xamarin SfPdfViewer | .NET MAUI SfPdfViewer | Description |
---|---|---|
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. | ||
Returns and sets the zoom factor. The default value is 1, which represents 100% zoom. This value can be between 1 and 4. | ||
Returns and sets the minimum zoom factor. The default value is 0.25. This value should not exceed `MaxZoomFactor`. | ||
Returns and sets the maximum zoom factor. The default value is 4. This value should not be lower than `MinZoomFactor`. | ||
Returns and sets the value indicating whether the scroll head can be shown or not. | ||
Gets or sets a value indicating whether the outline view is visible. | ||
Gets or sets a value that indicates whether document link annotations (TOC) in the PDF can be interacted with. | ||
Gets or sets a value that indicates whether document link annotations (TOC) in the PDF can be interacted with. | ||
Gets the outline for the document. | ||
Gets or sets a value that indicates whether the text selection is enabled or not. The default value is true. | ||
Gets or sets the color to highlight the selected text. The default value is Color.FromRgba(0, 0, 205, 80) . |
||
Gets or sets the color for highlighting the current match of the searched text. The default value is Color.FromRgba(249, 125, 0, 80) .
|
||
Gets or sets the color for highlighting the other matches of the searched text. The default value is Color.FromRgba(255, 255, 0, 50) .
|
||
Gets or sets a value indicating the type of annotation that should be drawn using UI interaction on the PDF pages. | ||
Gets the list of annotations in the PDF. | ||
Gets or sets the default annotation settings. | ||
The command that removes all annotations from the PDF document. | ||
The command that performs the undo operation. | ||
The command that performs the redo operation. | ||
Gets or sets the series of coordinates that represent the ink points of an ink annotation. | ||
Gets or sets the border thickness of an ink annotation. | ||
Gets or sets the border thickness of shape annotation. | ||
Gets or sets a value indicating whether each ink strokes should be treated as separate ink annotations. | ||
Gets or sets the default stroke color of shape annotation. | ||
Gets or sets the default color of annotation selector. | ||
Gets or sets the default color of annotation selector when the selected annotation is locked. | ||
Gets or sets the series of coordinates that represent the starting point and ending point of a line annotation. | ||
Gets or sets the default settings for square annotations. | ||
Gets or sets the default settings for circle annotations. | ||
Gets or sets the default settings for line annotations. | ||
Gets or sets the default settings for arrow annotations. | ||
Gets or sets the default settings for ink annotations. | ||
Gets or sets the default settings for stamp annotations. | ||
Gets or sets the default settings for the annotation selector. | ||
Gets or sets a value that indicates whether the form field can be edited or not. | ||
Gets or sets the ink annotation signature in the signature field. | ||
Gets or sets the layout mode in which the pages will be displayed. | ||
Gets or sets a value that indicates the input mode in which the ink strokes should be allowed to be drawn. | ||
Allows drawing ink using both finger and stylus. | ||
Backing store for the ShowToolbars property. |
Events
Xamarin SfPdfViewer | .NET MAUI SfPdfViewer | Description |
---|---|---|
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. | ||
, | Occurs when the text search is in progress. | |
Occurs when the text is selected or when the selected text is changed. | ||
,
|
Occurs when an annotation is added to a page. | |
Occurs when a selected annotation gets deselected. | ||
Occurs when annotation is modified. | ||
Occurs when an annotation is removed from the page. | ||
Occurs when an annotation is selected. | ||
Occurs when a property in the PDF Viewer is modified. It allows you to detect page changes occurred in the PDF Viewer. The example below demonstrates how to implement this:
|
||
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: |
Methods
Xamarin SfPdfViewer | .NET MAUI SfPdfViewer | Description |
---|---|---|
Unload the current PDF document. | ||
Navigates to the location of the given outline element. | ||
Finds and highlights all occurrences of the given text in the PDF document asynchronously. | ||
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. | ||
Navigates to the next match of the searched text. | ||
Navigates to the previous match of the searched text. | ||
Removes all annotations from the PDF document. | ||
Adds the given annotation to the page represented by the annotation’s PageNumber property. | ||
Deselects the given annotation. | ||
Exports the annotations in the PDF document to the specified format and writes the exported data to the given output stream. | ||
Exports the annotations in the PDF document to the specified format and writes the exported data to the given output stream. | ||
Imports annotation data into the PDF document. | ||
Removes the given annotation from the page. | ||
Saves the PDF document and writes the final document into the given output stream. | ||
Saves the PDF document and writes the final document into the given output stream. | ||
Selects the given annotation. | ||
Prints the PDF document. | ||
Specifies whether the form fields should be flattened or not on saving |
Classes
Xamarin SfPdfViewer | .NET MAUI SfPdfViewer | Description |
---|---|---|
Represents a custom bookmark with a name and associated page number. | ||
Enumerates the values that specify the input mode in which the ink strokes should be allowed to be drawn. | ||
Provides data for TextSelectionChanged event. | ||
Provides data for the event. | ||
Represents the text markup annotation on the text contents in the page. | ||
Represents an annotation that displays a shape on the page. | ||
Represents the sticky note annotation on the text contents in the page. | ||
Provides data for the , , , , events. |