PdfViewer Class
Definition
Keyboard nudging of the selected annotation and deselection from presses outside the pages.
public class PdfViewer
Constructors
| Name | Description |
|---|---|
| PdfViewer | No summary available. |
PdfViewer Constructor
public PdfViewer()
Methods
| Name | Description |
|---|---|
| AddBookmark | Adds a bookmark for the given 1-based page. No-op when the page is out of range or already bookmarked. Returns if a bookmark was added. |
| AddHandler (2 overloads) | Adds a handler for the specified routed event. Inherited from Interactive. |
| AddStampAsync | No summary available. |
| AddStickyNoteAsync | No summary available. |
| ApplyStyling | Applies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement. |
| ApplyTemplate | Creates the visual children of the control, if necessary Inherited from TemplatedControl. |
| Arrange | Arranges the control and its children. Inherited from Layoutable. |
| BeginInit | Inherited from StyledElement. |
| Bind (8 overloads) | Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject. |
| CheckAccess | Returns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject. |
| ClearError | Clears Avalonia.Controls.PdfViewer.ErrorMessage. An open document stays open; after a failed load the viewer returns to its empty state. The template's dismiss buttons call this. |
| ClearSearch | Clears the current search query, results, and highlights. |
| ClearSelection | Clears the current text selection. |
| ClearValue (4 overloads) | Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject. |
| CloseDocument | Closes the current document. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| CopySelectionToClipboard | Copies the current selection to the clipboard. |
| DefaultStampColorFor | The colour a stamp is drawn in when Avalonia.Controls.PdfViewer.StampColor is not set. |
| EndInit | Inherited from StyledElement. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| FindNext | Advances to the next search match (wraps around). |
| FindPrevious | Moves to the previous search match (wraps around). |
| FitHeight | Fits the current page height to the view. |
| FitPage | Fits the entire page to the view. |
| FitWidth | Fits the page width to the view. |
| Focus | Focuses the control. Inherited from InputElement. |
| FocusViewer | Focuses the PDF viewer control for keyboard navigation. Call this after external interactions (like opening a file) to enable keyboard navigation. |
| FormatStampDate | Formats date the way a stamp's date line is drawn. |
| GetAnnotationsAsync | Gets the annotations on a page (0-based index). Returns an empty list when no document is loaded or the index is out of range. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetFlowDirection | Gets the value of the attached Avalonia.Visual.FlowDirectionProperty on a control. Inherited from Visual. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetIsHoldingEnabled | Inherited from InputElement. |
| GetIsHoldWithMouseEnabled | Inherited from InputElement. |
| GetIsTemplateFocusTarget | Gets the value of the IsTemplateFocusTargetProperty attached property on a control. Inherited from TemplatedControl. |
| GetOutline | Gets the document outline (bookmarks). |
| GetPageLabel | The page's label from the document's /PageLabels ("iv", "A-2"), or null when the document defines none. pageNumber is 1-based. |
| GetPageTextAsync | Extracts the plain text of a single page (0-based index). Returns an empty string when no document is loaded or the index is out of range. |
| GetSelectedText | Gets the currently selected text. |
| GetTextAsync | Extracts the plain text of the whole document, one page per element. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| GoToBookmark | Navigates to a bookmark's target: its full destination (page plus position) when it has one, else its page. Returns true if the bookmark has a page target. |
| GoToPage | Navigates to a specific page. |
| HighlightSelectionAsync | No summary available. |
| InvalidateArrange | Invalidates the arrangement of the control and queues a new layout pass. Inherited from Layoutable. |
| InvalidateMeasure | Invalidates the measurement of the control and queues a new layout pass. Inherited from Layoutable. |
| InvalidateVisual | Invalidates the visual and queues a repaint. Inherited from Visual. |
| IsAnimating | Checks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject. |
| IsPageBookmarked | Returns whether the given 1-based page currently has a bookmark. |
| IsSet | Checks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject. |
| LoadDocumentAsync (3 overloads) | Loads a PDF document from a stream. The stream is read once, from its current position (a seekable stream left at its end is read from the start), and is never disposed or kept: the viewer holds its own copy of the bytes, so the caller may dispose the stream as soon as this call returns. The document has no path; save with Avalonia.Controls.PdfViewer.SaveDocumentAsync(string) or Save As. |
| Measure | Carries out a measure of the control. Inherited from Layoutable. |
| NavigateTo | Navigates to a link destination: the page, and in the continuous view modes the position on it (an /XYZ or /FitH target lands with its top edge at the top of the viewport, not the page top); an /XYZ zoom that is set is applied first. Returns true if it was an in-document page destination that could be resolved. |
| NextPage | Navigates to the next page (or next spread in two-page mode). |
| Open | Opens a document via the file picker (fire-and-forget). See Avalonia.Controls.PdfViewer.OpenAsync(System.Threading.CancellationToken). |
| OpenAsync | Asks the user for a PDF and loads it. Raises Avalonia.Controls.PdfViewer.OpenRequested first; when the host does not handle it, the platform file picker of the owning Avalonia.Controls.TopLevel is used. A file with a local path is opened by path (so Avalonia.Controls.PdfViewer.Source is set and in-place saving works); otherwise it is read through a stream. |
| OpenMoreOptions | Opens the More Options flyout programmatically. |
| PreviousPage | Navigates to the previous page (or previous spread in two-page mode). |
| Prints the current document (fire-and-forget). Errors surface via Avalonia.Controls.PdfViewer.ErrorMessage. | |
| PrintAsync | Prints the current document. Raises Avalonia.Controls.PdfViewer.PrintRequested first; if the handler marks it handled nothing else happens, otherwise the Avalonia.Controls.PdfViewer.PrintService shows the system print dialog. No-op when no document is loaded. |
| RaiseEvent | Raises a routed event. Inherited from Interactive. |
| RedactSelectionAsync | No summary available. |
| Redo | Re-applies the most recently undone edit, if any. |
| RedoAsync | Re-applies the most recently undone edit and completes when the document has been updated. |
| RemoveBookmark | Removes the bookmark for the given 1-based page. Returns if a bookmark was removed. |
| RemoveHandler (2 overloads) | Removes a handler for the specified routed event. Inherited from Interactive. |
| Render | Renders the visual to a Avalonia.Media.DrawingContext. Inherited from Visual. |
| RenderPageToImageAsync | Renders a page (0-based index) to a bitmap at the given scale (1.0 == 100%). Returns null when no document is loaded or the index is out of range. The caller owns the returned bitmap and should dispose it. |
| ResetZoom | Resets zoom to 100%. |
| Save | Saves the document in place (fire-and-forget); a failure, including a stream-backed document with no path, is reported through Avalonia.Controls.PdfViewer.ErrorMessage. See Avalonia.Controls.PdfViewer.SaveAsync. |
| SaveAs | Saves via the save picker (fire-and-forget). See Avalonia.Controls.PdfViewer.SaveAsAsync(System.Threading.CancellationToken). |
| SaveAsAsync | Writes the document, with its annotation edits, to a file chosen by the user. Raises Avalonia.Controls.PdfViewer.SaveAsRequested first; when the host does not handle it, the platform save picker of the owning Avalonia.Controls.TopLevel is used. Choosing the open file saves in place (see Avalonia.Controls.PdfViewer.SaveAsync); choosing another local path writes it and the viewer switches to that file, keeping the current page. |
| SaveAsync | Saves the document in place to its original Avalonia.Controls.PdfViewer.Source path, including any annotation edits. No-op when Avalonia.Controls.PdfViewer.AllowDocumentSaving is false or when no document is loaded. A document loaded from a stream or byte array has no path to save to: use Avalonia.Controls.PdfViewer.SaveDocumentAsync(System.IO.Stream) or Avalonia.Controls.PdfViewer.SaveAsAsync(System.Threading.CancellationToken) for those. |
| SaveDocumentAsync (2 overloads) | Saves the document (with all annotations) to a stream. |
| SearchAsync (2 overloads) | Searches for text in the document and publishes the results (Avalonia.Controls.PdfViewer.SearchResults, find next/previous, Avalonia.Controls.PdfViewer.SearchCompleted). A failure is reported through Avalonia.Controls.PdfViewer.ErrorMessage and returns an empty list. |
| SelectAll | Selects all text on the current page. |
| SetCurrentValue (2 overloads) | Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject. |
| SetFlowDirection | Sets the value of the attached Avalonia.Visual.FlowDirectionProperty on a control. Inherited from Visual. |
| SetIsHoldingEnabled | Inherited from InputElement. |
| SetIsHoldWithMouseEnabled | Inherited from InputElement. |
| SetIsTemplateFocusTarget | Sets the value of the IsTemplateFocusTargetProperty attached property on a control. Inherited from TemplatedControl. |
| SetValue (3 overloads) | Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| Share | Shares the current document (fire-and-forget). Errors surface via Avalonia.Controls.PdfViewer.ErrorMessage. |
| ShareAsync | Shares the current document. Raises Avalonia.Controls.PdfViewer.ShareRequested first; if the handler marks it handled nothing else happens, otherwise the Avalonia.Controls.PdfViewer.ShareService shows the system share sheet. No-op when no document is loaded. |
| SquigglySelectionAsync | No summary available. |
| StampNameForLabel | Stamp name for a label: the label without spaces, so standard labels map to standard names. |
| StampStyleDisplayName | The English name of a style as shown in the Stamp dropdown (see Avalonia.Controls.PdfViewer.Strings for other languages). |
| StrikeoutSelectionAsync | No summary available. |
| ToggleBookmark | Toggles the bookmark for the given 1-based page. Returns the new state ( when the page is now bookmarked). |
| ToggleBookmarkCurrentPage | Toggles the bookmark for the current page (the ⌘D / Ctrl+D action). |
| TryGetResource | Inherited from StyledElement. |
| UnderlineSelectionAsync | No summary available. |
| Undo | Reverts the most recent edit, if any. |
| UndoAsync | Reverts the most recent edit and completes when the document has been updated. |
| UpdateLayout | Executes a layout pass. Inherited from Layoutable. |
| UpdateStickyNoteAsync | No summary available. |
| VerifyAccess | Checks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject. |
| ZoomIn | Zooms in to the next preset level. |
| ZoomOut | Zooms out to the previous preset level. |
AddBookmark Method
Adds a bookmark for the given 1-based page. No-op when the page is out of range or already bookmarked. Returns if a bookmark was added.
public bool AddBookmark(int pageNumber)
Parameters
pageNumber int
Returns
bool
AddStampAsync Method
public System.Threading.Tasks.Task<int> AddStampAsync(int pageIndex, string label, double pdfX, double pdfY, Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> color, Nullable<Avalonia.Controls.PdfStampStyle> style, Nullable<bool> includeDate)
Parameters
pageIndex int
label string
pdfX double
pdfY double
color Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>
style Nullable<Avalonia.Controls.PdfStampStyle>
includeDate Nullable<bool>
Returns
System.Threading.Tasks.Task<int>
AddStickyNoteAsync Method
public System.Threading.Tasks.Task<int> AddStickyNoteAsync(int pageIndex, double pdfX, double pdfY, string text, Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> color)
Parameters
pageIndex int
pdfX double
pdfY double
text string
color Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>
Returns
System.Threading.Tasks.Task<int>
ClearError Method
Clears Avalonia.Controls.PdfViewer.ErrorMessage. An open document stays open; after a failed load the viewer returns to its empty state. The template's dismiss buttons call this.
public void ClearError()
ClearSearch Method
Clears the current search query, results, and highlights.
public void ClearSearch()
ClearSelection Method
Clears the current text selection.
public void ClearSelection()
CloseDocument Method
Closes the current document.
public void CloseDocument()
CopySelectionToClipboard Method
Copies the current selection to the clipboard.
public System.Threading.Tasks.Task CopySelectionToClipboard()
Returns
System.Threading.Tasks.Task
DefaultStampColorFor Method
The colour a stamp is drawn in when Avalonia.Controls.PdfViewer.StampColor is not set.
public Avalonia.Controls.Pdf.Core.PdfAnnotationColor DefaultStampColorFor(string label)
Parameters
label string
Returns
FindNext Method
Advances to the next search match (wraps around).
public void FindNext()
FindPrevious Method
Moves to the previous search match (wraps around).
public void FindPrevious()
FitHeight Method
Fits the current page height to the view.
public void FitHeight()
FitPage Method
Fits the entire page to the view.
public void FitPage()
FitWidth Method
Fits the page width to the view.
public void FitWidth()
FocusViewer Method
Focuses the PDF viewer control for keyboard navigation. Call this after external interactions (like opening a file) to enable keyboard navigation.
public void FocusViewer()
FormatStampDate Method
Formats date the way a stamp's date line is drawn.
public string FormatStampDate(DateTime date)
Parameters
date DateTime
Returns
string
GetAnnotationsAsync Method
Gets the annotations on a page (0-based index). Returns an empty list when no document is loaded or the index is out of range.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfAnnotationInfo>> GetAnnotationsAsync(int pageIndex, System.Threading.CancellationToken cancellationToken)
Parameters
pageIndex int
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfAnnotationInfo>>
GetOutline Method
Gets the document outline (bookmarks).
public System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfBookmark> GetOutline()
Returns
System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfBookmark>
GetPageLabel Method
The page's label from the document's /PageLabels ("iv", "A-2"), or null when the document
defines none. pageNumber is 1-based.
public string GetPageLabel(int pageNumber)
Parameters
pageNumber int
Returns
string
GetPageTextAsync Method
Extracts the plain text of a single page (0-based index). Returns an empty string when no document is loaded or the index is out of range.
public System.Threading.Tasks.Task<string> GetPageTextAsync(int pageIndex, System.Threading.CancellationToken cancellationToken)
Parameters
pageIndex int
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<string>
GetSelectedText Method
Gets the currently selected text.
public string GetSelectedText()
Returns
string
The selected text, or null if no selection.
GetTextAsync Method
Extracts the plain text of the whole document, one page per element.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<string>> GetTextAsync(System.Threading.CancellationToken cancellationToken)
Parameters
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<string>>
GoToBookmark Method
Navigates to a bookmark's target: its full destination (page plus position) when it has
one, else its page. Returns true if the bookmark has a page target.
public bool GoToBookmark(Avalonia.Controls.Pdf.Core.PdfBookmark bookmark)
Parameters
bookmark Avalonia.Controls.Pdf.Core.PdfBookmark
Returns
bool
GoToPage Method
Navigates to a specific page.
public void GoToPage(int pageNumber)
Parameters
pageNumber int
HighlightSelectionAsync Method
public System.Threading.Tasks.Task<int> HighlightSelectionAsync(Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> color)
Parameters
color Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>
Returns
System.Threading.Tasks.Task<int>
IsPageBookmarked Method
Returns whether the given 1-based page currently has a bookmark.
public bool IsPageBookmarked(int pageNumber)
Parameters
pageNumber int
Returns
bool
LoadDocumentAsync overloads
LoadDocumentAsync Method
Loads a PDF document from a stream. The stream is read once, from its current position (a seekable stream left at its end is read from the start), and is never disposed or kept: the viewer holds its own copy of the bytes, so the caller may dispose the stream as soon as this call returns. The document has no path; save with Avalonia.Controls.PdfViewer.SaveDocumentAsync(string) or Save As.
public System.Threading.Tasks.Task LoadDocumentAsync(System.IO.Stream stream, string password)
Parameters
stream System.IO.Stream
password string
Returns
System.Threading.Tasks.Task
LoadDocumentAsync Method
public System.Threading.Tasks.Task LoadDocumentAsync(ReadOnlyMemory<byte> data, string password)
Parameters
data ReadOnlyMemory<byte>
password string
Returns
System.Threading.Tasks.Task
LoadDocumentAsync Method
Loads a PDF document from a file path.
public System.Threading.Tasks.Task LoadDocumentAsync(string path, string password)
Parameters
path string
password string
Returns
System.Threading.Tasks.Task
NavigateTo Method
Navigates to a link destination: the page, and in the continuous view modes the position
on it (an /XYZ or /FitH target lands with its top edge at the top of the viewport, not the
page top); an /XYZ zoom that is set is applied first. Returns true if it was an
in-document page destination that could be resolved.
public bool NavigateTo(Avalonia.Controls.Pdf.Core.PdfLinkDestination destination)
Parameters
destination Avalonia.Controls.Pdf.Core.PdfLinkDestination
Returns
bool
NextPage Method
Navigates to the next page (or next spread in two-page mode).
public void NextPage()
Open Method
Opens a document via the file picker (fire-and-forget). See Avalonia.Controls.PdfViewer.OpenAsync(System.Threading.CancellationToken).
public void Open()
OpenAsync Method
Asks the user for a PDF and loads it. Raises Avalonia.Controls.PdfViewer.OpenRequested first; when the host does not handle it, the platform file picker of the owning Avalonia.Controls.TopLevel is used. A file with a local path is opened by path (so Avalonia.Controls.PdfViewer.Source is set and in-place saving works); otherwise it is read through a stream.
public System.Threading.Tasks.Task OpenAsync(System.Threading.CancellationToken cancellationToken)
Parameters
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task
Exceptions
OpenMoreOptions Method
Opens the More Options flyout programmatically.
public void OpenMoreOptions()
PreviousPage Method
Navigates to the previous page (or previous spread in two-page mode).
public void PreviousPage()
Print Method
Prints the current document (fire-and-forget). Errors surface via Avalonia.Controls.PdfViewer.ErrorMessage.
public void Print()
PrintAsync Method
Prints the current document. Raises Avalonia.Controls.PdfViewer.PrintRequested first; if the handler marks it handled nothing else happens, otherwise the Avalonia.Controls.PdfViewer.PrintService shows the system print dialog. No-op when no document is loaded.
public System.Threading.Tasks.Task PrintAsync(Avalonia.Controls.Pdf.Services.PrintOptions options, System.Threading.CancellationToken cancellationToken)
Parameters
options Avalonia.Controls.Pdf.Services.PrintOptions
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task
Exceptions
RedactSelectionAsync Method
public System.Threading.Tasks.Task<int> RedactSelectionAsync(Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> color)
Parameters
color Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>
Returns
System.Threading.Tasks.Task<int>
Redo Method
Re-applies the most recently undone edit, if any.
public void Redo()
RedoAsync Method
Re-applies the most recently undone edit and completes when the document has been updated.
public System.Threading.Tasks.Task RedoAsync()
Returns
System.Threading.Tasks.Task
RemoveBookmark Method
Removes the bookmark for the given 1-based page. Returns if a bookmark was removed.
public bool RemoveBookmark(int pageNumber)
Parameters
pageNumber int
Returns
bool
RenderPageToImageAsync Method
Renders a page (0-based index) to a bitmap at the given scale (1.0 == 100%).
Returns null when no document is loaded or the index is out of range.
The caller owns the returned bitmap and should dispose it.
public System.Threading.Tasks.Task<Avalonia.Media.Imaging.Bitmap> RenderPageToImageAsync(int pageIndex, double scale, System.Threading.CancellationToken cancellationToken)
Parameters
pageIndex int
scale double
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<Avalonia.Media.Imaging.Bitmap>
ResetZoom Method
Resets zoom to 100%.
public void ResetZoom()
Save Method
Saves the document in place (fire-and-forget); a failure, including a stream-backed document with no path, is reported through Avalonia.Controls.PdfViewer.ErrorMessage. See Avalonia.Controls.PdfViewer.SaveAsync.
public void Save()
SaveAs Method
Saves via the save picker (fire-and-forget). See Avalonia.Controls.PdfViewer.SaveAsAsync(System.Threading.CancellationToken).
public void SaveAs()
SaveAsAsync Method
Writes the document, with its annotation edits, to a file chosen by the user. Raises Avalonia.Controls.PdfViewer.SaveAsRequested first; when the host does not handle it, the platform save picker of the owning Avalonia.Controls.TopLevel is used. Choosing the open file saves in place (see Avalonia.Controls.PdfViewer.SaveAsync); choosing another local path writes it and the viewer switches to that file, keeping the current page.
public System.Threading.Tasks.Task SaveAsAsync(System.Threading.CancellationToken cancellationToken)
Parameters
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task
Exceptions
SaveAsync Method
Saves the document in place to its original Avalonia.Controls.PdfViewer.Source path, including any
annotation edits. No-op when Avalonia.Controls.PdfViewer.AllowDocumentSaving is false or when no
document is loaded. A document loaded from a stream or byte array has no path to save to:
use Avalonia.Controls.PdfViewer.SaveDocumentAsync(System.IO.Stream) or Avalonia.Controls.PdfViewer.SaveAsAsync(System.Threading.CancellationToken) for those.
public System.Threading.Tasks.Task SaveAsync()
Returns
System.Threading.Tasks.Task
Exceptions
SaveDocumentAsync overloads
SaveDocumentAsync Method
Saves the document (with all annotations) to a stream.
public System.Threading.Tasks.Task SaveDocumentAsync(System.IO.Stream stream)
Parameters
stream System.IO.Stream
Returns
System.Threading.Tasks.Task
SaveDocumentAsync Method
Saves the document (with all annotations) to a file path.
public System.Threading.Tasks.Task SaveDocumentAsync(string filePath)
Parameters
filePath string
Returns
System.Threading.Tasks.Task
SearchAsync overloads
SearchAsync Method
Searches for text in the document and publishes the results (Avalonia.Controls.PdfViewer.SearchResults, find next/previous, Avalonia.Controls.PdfViewer.SearchCompleted). A failure is reported through Avalonia.Controls.PdfViewer.ErrorMessage and returns an empty list.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfSearchResult>> SearchAsync(string query, Avalonia.Controls.Pdf.Core.SearchOptions options)
Parameters
query string
options Avalonia.Controls.Pdf.Core.SearchOptions
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfSearchResult>>
SearchAsync Method
Searches for text in the document and publishes the results. The document is scanned a
page at a time, so cancellationToken stops the search within a page.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfSearchResult>> SearchAsync(string query, Avalonia.Controls.Pdf.Core.SearchOptions options, System.Threading.CancellationToken cancellationToken)
Parameters
query string
options Avalonia.Controls.Pdf.Core.SearchOptions
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfSearchResult>>
Exceptions
SelectAll Method
Selects all text on the current page.
public void SelectAll()
Share Method
Shares the current document (fire-and-forget). Errors surface via Avalonia.Controls.PdfViewer.ErrorMessage.
public void Share()
ShareAsync Method
Shares the current document. Raises Avalonia.Controls.PdfViewer.ShareRequested first; if the handler marks it handled nothing else happens, otherwise the Avalonia.Controls.PdfViewer.ShareService shows the system share sheet. No-op when no document is loaded.
public System.Threading.Tasks.Task ShareAsync(Avalonia.Controls.Pdf.Services.ShareOptions options, System.Threading.CancellationToken cancellationToken)
Parameters
options Avalonia.Controls.Pdf.Services.ShareOptions
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task
Exceptions
SquigglySelectionAsync Method
public System.Threading.Tasks.Task<int> SquigglySelectionAsync(Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> color)
Parameters
color Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>
Returns
System.Threading.Tasks.Task<int>
StampNameForLabel Method
Stamp name for a label: the label without spaces, so standard labels map to standard names.
public string StampNameForLabel(string label)
Parameters
label string
Returns
string
StampStyleDisplayName Method
The English name of a style as shown in the Stamp dropdown (see Avalonia.Controls.PdfViewer.Strings for other languages).
public string StampStyleDisplayName(Avalonia.Controls.PdfStampStyle style)
Parameters
style Avalonia.Controls.PdfStampStyle
Returns
string
StrikeoutSelectionAsync Method
public System.Threading.Tasks.Task<int> StrikeoutSelectionAsync(Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> color)
Parameters
color Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>
Returns
System.Threading.Tasks.Task<int>
ToggleBookmark Method
Toggles the bookmark for the given 1-based page. Returns the new state ( when the page is now bookmarked).
public bool ToggleBookmark(int pageNumber)
Parameters
pageNumber int
Returns
bool
ToggleBookmarkCurrentPage Method
Toggles the bookmark for the current page (the ⌘D / Ctrl+D action).
public void ToggleBookmarkCurrentPage()
UnderlineSelectionAsync Method
public System.Threading.Tasks.Task<int> UnderlineSelectionAsync(Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> color)
Parameters
color Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>
Returns
System.Threading.Tasks.Task<int>
Undo Method
Reverts the most recent edit, if any.
public void Undo()
UndoAsync Method
Reverts the most recent edit and completes when the document has been updated.
public System.Threading.Tasks.Task UndoAsync()
Returns
System.Threading.Tasks.Task
UpdateStickyNoteAsync Method
public System.Threading.Tasks.Task UpdateStickyNoteAsync(int pageIndex, int annotIndex, string text, Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> color)
Parameters
pageIndex int
annotIndex int
text string
color Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>
Returns
System.Threading.Tasks.Task
ZoomIn Method
Zooms in to the next preset level.
public void ZoomIn()
ZoomOut Method
Zooms out to the previous preset level.
public void ZoomOut()
Properties
| Name | Description |
|---|---|
| ActiveTool | Gets or sets the tool applied to the next pointer gesture on a page. The built-in toolbar and a host's own controls both read and write this one value: setting it arms the tool (and, for Avalonia.Controls.PdfViewerTool.Shape, keeps or defaults Avalonia.Controls.PdfViewer.SelectedShapeType), Avalonia.Controls.PdfViewerTool.None disarms every tool. Editing capability still applies: while Avalonia.Controls.PdfViewer.CanEditAnnotations is false the value stays Avalonia.Controls.PdfViewerTool.None. |
| ActualThemeVariant | Gets the UI theme that is currently used by the element, which might be different than the RequestedThemeVariantProperty. Inherited from StyledElement. |
| AddBookmarkCommand | Gets a command that bookmarks the page supplied as the command parameter (defaulting to the current page). Enabled while a document is loaded. |
| AllowAnnotationEditing | Gets or sets whether annotation tools may be used. Default true. Ignored (treated as false) when Avalonia.Controls.PdfViewer.IsReadOnly is set. |
| AllowDocumentSaving | Gets or sets whether the built-in save command/UI is available. Default true. Programmatic Avalonia.Controls.PdfViewer.SaveDocumentAsync(System.IO.Stream) is unaffected. |
| AllowFormEditing | Gets or sets whether interactive form fields accept input. Default true. Ignored (treated as false) when Avalonia.Controls.PdfViewer.IsReadOnly is set. |
| AllowTextSelection | Gets or sets whether the user can select (and copy) text. Default true. |
| AnnotationMode | Gets or sets the annotation interaction mode. |
| AutoSave | Gets or sets whether the document is automatically saved after annotation changes. Requires Avalonia.Controls.PdfViewer.Source to be set (file-path based loading). |
| Background | Gets or sets the brush used to draw the control's background. Inherited from TemplatedControl. |
| BackgroundSizing | Gets or sets how the control's background is drawn relative to the control's border. Inherited from TemplatedControl. |
| Bookmarks | Gets the current user bookmarks, ordered by page. These are saved reading positions, distinct from the document outline (Avalonia.Controls.PdfViewer.HasOutline). Persisted to the document's XMP metadata in the Preview-compatible apple-preview format. |
| BorderBrush | Gets or sets the brush used to draw the control's border. Inherited from TemplatedControl. |
| BorderThickness | Gets or sets the thickness of the control's border. Inherited from TemplatedControl. |
| Bounds | Gets the bounds of the control relative to its parent. Inherited from Visual. |
| CacheMode | Gets or sets the cache mode of the visual. Inherited from Visual. |
| CanEditAnnotations | Gets whether annotation editing is currently permitted — when Avalonia.Controls.PdfViewer.IsReadOnly is set or Avalonia.Controls.PdfViewer.AllowAnnotationEditing is cleared. Bindable so the template can gate the annotation toolbar. |
| CanPrint | True when a document is loaded and printing can go somewhere: either Avalonia.Controls.PdfViewer.PrintRequested has a handler or a supported Avalonia.Controls.PdfViewer.PrintService exists. |
| CanRedo | Gets whether there is an undone edit that Avalonia.Controls.PdfViewer.Redo can re-apply. |
| CanShare | True when a document is loaded and sharing can go somewhere: either Avalonia.Controls.PdfViewer.ShareRequested has a handler or a supported Avalonia.Controls.PdfViewer.ShareService exists. |
| CanUndo | Gets whether there is an edit that Avalonia.Controls.PdfViewer.Undo can revert. Bindable so a host or template can enable an Undo button. |
| Classes | Gets or sets the styled element's classes. Inherited from StyledElement. |
| Clip | Gets or sets the geometry clip for this visual. Inherited from Visual. |
| ClipToBounds | Gets or sets a value indicating whether the control should be clipped to its bounds. Inherited from Visual. |
| ContextFlyout | Gets or sets a context flyout to the control Inherited from Control. |
| ContextMenu | Gets or sets a context menu to the control. Inherited from Control. |
| CopyCommand | Gets a command that copies the current text selection to the clipboard. |
| CornerRadius | Gets or sets the radius of the border rounded corners. Inherited from TemplatedControl. |
| CurrentPage | Gets or sets the current page number (1-based). |
| CurrentSearchResultIndex | Gets the 0-based index of the active search match, or -1 when there are none. |
| Cursor | Gets or sets associated mouse cursor. Inherited from InputElement. |
| DataContext | Gets or sets the control's data context. Inherited from StyledElement. |
| DataTemplates | Gets or sets the data templates for the control. Inherited from Control. |
| DesiredSize | Gets the size that this element computed during the measure pass of the layout process. Inherited from Layoutable. |
| DismissErrorCommand | Gets a command that clears Avalonia.Controls.PdfViewer.ErrorMessage. Enabled while an error is shown. |
| Dispatcher | Returns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject. |
| DocumentSource | Gets or sets the document to display, accepting a string file path, a Uri (file scheme), a System.IO.Stream, or a byte array. This is the binding-friendly alternative to Avalonia.Controls.PdfViewer.Source; assigning it loads the document immediately. Setting it to null closes the current document. |
| DrawStrokeColor | Gets or sets the default draw/ink stroke color. |
| DrawStrokeWidth | Gets or sets the draw stroke width in PDF points (0.5–20). |
| Effect | Gets or sets the effect of the control. Inherited from Visual. |
| EnableKeyboardShortcuts | Gets or sets whether the viewer handles its built-in keyboard shortcuts — copy, select-all, the zoom accelerators, save, arrow-key navigation and nudging. Default true. Set false when a host binds those keystrokes to its own commands and doesn't want the viewer to consume them. Form-field text input and Escape-to-deselect are unaffected. |
| ErrorMessage | Gets the current error message, if any. |
| FitPageCommand | Gets a command that fits the whole page to the viewport. |
| FitWidthCommand | Gets a command that fits the page width to the viewport. |
| FlowDirection | Gets or sets the text flow direction. Inherited from Visual. |
| Focusable | Gets or sets a value indicating whether the control can receive focus. Inherited from InputElement. |
| FocusAdorner | Gets or sets the control's focus adorner. Inherited from Control. |
| FontFamily | Gets or sets the font family used to draw the control's text. Inherited from TemplatedControl. |
| FontFeatures | Gets or sets the font features turned on/off. Inherited from TemplatedControl. |
| FontSize | Gets or sets the size of the control's text in points. Inherited from TemplatedControl. |
| FontStretch | Gets or sets the font stretch used to draw the control's text. Inherited from TemplatedControl. |
| FontStyle | Gets or sets the font style used to draw the control's text. Inherited from TemplatedControl. |
| FontWeight | Gets or sets the font weight used to draw the control's text. Inherited from TemplatedControl. |
| Foreground | Gets or sets the brush used to draw the control's text and other foreground elements. Inherited from TemplatedControl. |
| GestureRecognizers | Inherited from InputElement. |
| GoToPageCommand | Gets a command that navigates to the page number supplied as the command parameter (an int or a string parseable as one). |
| HasBookmarks | Gets whether the document has bookmarks. |
| HasDocument | Gets whether a document is currently open. The template uses it to show errors as a dismissible banner over an open document instead of the full-canvas error state. |
| HasMirrorTransform | Gets or sets a value indicating whether to apply mirror transform on this control. Inherited from Visual. |
| HasOutline | Gets whether the document has an outline (table of contents). |
| HasSelection | Gets whether there is an active text selection. |
| Height | Gets or sets the height of the element. Inherited from Layoutable. |
| HighlightColor | Gets or sets the default highlight annotation color. |
| HorizontalAlignment | Gets or sets the element's preferred horizontal alignment in its parent. Inherited from Layoutable. |
| IncludeStampDate | Gets or sets whether stamps added from now on carry the current date as a second line (see Avalonia.Controls.PdfViewer.StampDateFormat). The Stamp dropdown's "Include date" toggle sets this too. Default . Existing stamps keep their date, or their lack of one. |
| IsArrangeValid | Gets a value indicating whether the control's layouts arrange is valid. Inherited from Layoutable. |
| IsArrowKeyNudgeEnabled | Gets or sets whether the arrow keys move the selected annotation by one pixel (ten with Shift) instead of navigating. Default true. With no annotation selected the arrow keys always navigate. Also off when Avalonia.Controls.PdfViewer.EnableKeyboardShortcuts is false. |
| IsBookmarksEnabled | Gets or sets whether the Bookmarks sidebar pane is available. When its tab is hidden and the mode can't be selected. Default . |
| IsDirty | Gets whether the document has edits (annotations, form values, redactions, bookmarks) that have not been written since it was loaded or last saved. Cleared by a successful Avalonia.Controls.PdfViewer.SaveAsync, Avalonia.Controls.PdfViewer.SaveDocumentAsync(System.IO.Stream) or auto-save and by loading another document. Undoing back to the saved state does not clear it. |
| IsDrawToolVisible | Gets or sets whether the Draw (ink) tool is shown. Default . |
| IsEffectivelyEnabled | Gets a value indicating whether this control and all its parents are enabled. Inherited from InputElement. |
| IsEffectivelyVisible | Gets a value indicating whether this control and all its parents are visible. Inherited from Visual. |
| IsEnabled | Gets or sets a value indicating whether the control is enabled for user interaction. Inherited from InputElement. |
| IsFocused | Gets a value indicating whether the control is focused. Inherited from InputElement. |
| IsHighlightToolVisible | Gets or sets whether the Highlight tool is shown. Default . |
| IsHitTestVisible | Gets or sets a value indicating whether the control is considered for hit testing. Inherited from InputElement. |
| IsInitialized | Gets a value that indicates whether the element has finished initialization. Inherited from StyledElement. |
| IsKeyboardFocusWithin | Gets a value indicating whether keyboard focus is anywhere within the element or its visual tree child elements. Inherited from InputElement. |
| IsLinkToolVisible | Gets or sets whether the Link tool is shown. Default . |
| IsLoaded | Gets a value indicating whether the control is fully constructed in the visual tree and both layout and render are complete. Inherited from Control. |
| IsLoading | Gets whether the control is currently loading a document. |
| IsMeasureValid | Gets a value indicating whether the control's layout measure is valid. Inherited from Layoutable. |
| IsMobileLayout | Gets whether the touch-optimised mobile layout is used. When true, the annotation tools are relocated from the centre of the top toolbar to a dedicated bar along the bottom of the control; the search field, page navigation and menu stay in the top toolbar. The control manages this automatically — true on iOS/Android, or on any platform when the control is narrower than 500 device-independent pixels — recomputing as it resizes, so any value set externally is transient. |
| IsMoreOptionsVisible | Gets or sets whether the toolbar's More Options menu (print, share, view modes) is shown. |
| IsNoteToolVisible | Gets or sets whether the Note (sticky note) tool is shown. Default . |
| IsOpenVisible | Gets or sets whether an Open entry is offered at the top of the More Options menu. Off by default: most hosts load documents themselves. The entry runs Avalonia.Controls.PdfViewer.OpenAsync(System.Threading.CancellationToken). |
| IsPointerOver | Gets a value indicating whether the pointer is currently over the control. Inherited from InputElement. |
| IsPrintVisible | Gets or sets whether the Print entry is offered in the More Options menu. Even when true the entry is hidden on platforms without a print service unless Avalonia.Controls.PdfViewer.PrintRequested is handled. |
| IsReadOnly | Gets or sets a value that, when true, disables all document editing (annotation tools and form input). Text selection and navigation remain available. |
| IsRedactionUndoEnabled | Gets or sets whether redactions are recorded in the undo history. When false a redaction is final as soon as it is applied and holds no document copy; other edits stay undoable. Defaults to true. |
| IsRedactToolVisible | Gets or sets whether the Redact tool is shown. Default . |
| IsSaveAsVisible | Gets or sets whether a Save As entry is offered in the More Options menu. Off by default. The entry runs Avalonia.Controls.PdfViewer.SaveAsAsync(System.Threading.CancellationToken). |
| IsSaveVisible | Gets or sets whether a Save entry (save in place, see Avalonia.Controls.PdfViewer.SaveAsync) is offered in the More Options menu. Off by default; hidden anyway while Avalonia.Controls.PdfViewer.AllowDocumentSaving is false. |
| IsShapeToolVisible | Gets or sets whether the Shapes tool is shown. Default . |
| IsShareVisible | Gets or sets whether the Share entry is offered in the More Options menu. Even when true the entry is hidden on platforms without a share service unless Avalonia.Controls.PdfViewer.ShareRequested is handled. |
| IsSidebarOpen | Gets whether the sidebar is open (any mode other than None). |
| IsSidebarVisible | Gets or sets whether the sidebar is visible (including collapsed state). When false, the sidebar is completely hidden and cannot be toggled. |
| IsSquigglyToolVisible | Gets or sets whether the Squiggly tool is shown. Default . |
| IsStampToolVisible | Gets or sets whether the Stamp dropdown is shown in the toolbar. Default . |
| IsStrikethroughToolVisible | Gets or sets whether the Strikethrough tool is shown. Default . |
| IsTableOfContentsEnabled | Gets or sets whether the Table of Contents sidebar pane is available. When its tab is hidden and the mode can't be selected. Default . |
| IsTabStop | Gets or sets a value that indicates whether the control is included in tab navigation. Inherited from InputElement. |
| IsTextToolVisible | Gets or sets whether the Add Text (free text) tool is shown. Default . |
| IsToolbarVisible | Gets or sets whether the toolbar is visible. |
| IsUnderlineToolVisible | Gets or sets whether the Underline tool is shown. Default . |
| IsVisible | Gets or sets a value indicating whether this control is visible. Inherited from Visual. |
| Item | Inherited from AvaloniaObject. |
| KeyBindings | Inherited from InputElement. |
| LetterSpacing | Gets or sets the letter spacing for the control's text content. Inherited from TemplatedControl. |
| Margin | Gets or sets the margin around the element. Inherited from Layoutable. |
| MaxHeight | Gets or sets the maximum height of the element. Inherited from Layoutable. |
| MaxRedactionUndoSteps | Gets or sets how many redactions can be undone (0–100). A redaction rewrites page content, so each undo step keeps a serialized copy of the whole document as it was; this limit bounds that memory separately from Avalonia.Controls.PdfViewer.MaxUndoSteps. The most recent redactions are kept: when the limit is exceeded the oldest redaction step is dropped from the history while the annotation steps around it stay. Zero records no redactions. Defaults to 10. |
| MaxRenderScale | Gets or sets the maximum device-pixel ratio the page raster is rendered at. Pages are rendered at ZoomLevel × clamp(screenScaling, 1, MaxRenderScale) pixels so text stays crisp on HiDPI displays. Higher values are sharper but use more memory (bitmap bytes scale with the square of the ratio); set to 1.0 to disable DPI-aware rendering. Default 2.0. |
| MaxUndoSteps | Gets or sets how many undo steps are retained (0–1000). Lowering it trims the oldest history. Zero disables undo/redo entirely. Defaults to 100. |
| MaxWidth | Gets or sets the maximum width of the element. Inherited from Layoutable. |
| MaxZoom | Gets or sets the maximum allowed Avalonia.Controls.PdfViewer.ZoomLevel (1.0 == 100%). Default 5.0, at most Avalonia.Controls.PdfViewer.MaxZoomLimit. |
| Metadata | Gets the loaded document's metadata, or null when no document is open. |
| MinHeight | Gets or sets the minimum height of the element. Inherited from Layoutable. |
| MinWidth | Gets or sets the minimum width of the element. Inherited from Layoutable. |
| MinZoom | Gets or sets the minimum allowed Avalonia.Controls.PdfViewer.ZoomLevel (1.0 == 100%). Default 0.05. |
| Name | Gets or sets the name of the styled element. Inherited from StyledElement. |
| NextPageCommand | Gets a command that advances to the next page. Disabled on the last page. |
| NoteColor | Gets or sets the default note color. |
| Opacity | Gets or sets the opacity of the control. Inherited from Visual. |
| OpacityMask | Gets or sets the opacity mask of the control. Inherited from Visual. |
| OpenCommand | Gets a command that opens a document via Avalonia.Controls.PdfViewer.Open (file picker or Avalonia.Controls.PdfViewer.OpenRequested). |
| Padding | Gets or sets the padding placed between the border of the control and its content. Inherited from TemplatedControl. |
| PageCount | Gets the total number of pages in the document. |
| PageRenderBuffer | Gets or sets how many pages on each side of the viewport are decoded ahead of time in continuous mode. Higher values reduce blank placeholders while scrolling at the cost of memory; lower values minimize memory. Clamped to [0, Avalonia.Controls.PdfViewer.MaxPageRenderBuffer]. Default is 2. |
| PageRetentionBuffer | Gets or sets how many pages on each side of the viewport are kept decoded before being evicted in continuous mode. Acts as hysteresis: pages between the render buffer and this margin stay in memory so short back-and-forth scrolling does not re-render them. If set below Avalonia.Controls.PdfViewer.PageRenderBuffer, the render buffer is used for retention. Clamped to [0, Avalonia.Controls.PdfViewer.MaxPageRetentionBuffer]. Default is 4. |
| Parent | Gets the styled element's logical parent. Inherited from StyledElement. |
| Password | Gets or sets the password for encrypted PDFs. |
| Permissions | Gets the loaded document's permission flags, or null when no document is open. |
| PreviousPageCommand | Gets a command that goes to the previous page. Disabled on the first page. |
| PrintCommand | Gets a command that prints the document via the configured Avalonia.Controls.PdfViewer.PrintService. Disabled when no print service is set. |
| PrintService | Gets or sets the print service used by Avalonia.Controls.PdfViewer.Print, Avalonia.Controls.PdfViewer.PrintAsync(Avalonia.Controls.Pdf.Services.PrintOptions,System.Threading.CancellationToken) and Avalonia.Controls.PdfViewer.PrintCommand. While the property is unset it resolves to the built-in service for the current platform (Windows, macOS, iOS, Android; null elsewhere). Assign or bind your own implementation to replace it, set null to disable the built-in one, or clear the property to return to the platform default. Handle Avalonia.Controls.PdfViewer.PrintRequested to bypass the service entirely. |
| RedactionRemovesHiddenInformation | Gets or sets whether a redaction also removes the places a document keeps copies of its content outside the page: the tagged structure tree (with its /ActualText and /Alt text), the redacted page's embedded thumbnail, and the XMP and Info metadata (title, author, keywords). Default true. Objects nothing references any more are dropped either way. Outline titles and file attachments are never touched. |
| RemoveBookmarkCommand | Gets a command that removes the bookmark for the page supplied as the command parameter (defaulting to the current page). Enabled while a document is loaded. |
| RenderTransform | Gets or sets the render transform of the control. Inherited from Visual. |
| RenderTransformOrigin | Gets or sets the transform origin of the control. Inherited from Visual. |
| ResetZoomCommand | Gets a command that resets the zoom to 100%. Enabled while a document is loaded. |
| Resources | Gets or sets the styled element's resource dictionary. Inherited from StyledElement. |
| RespectDocumentPermissions | Gets or sets whether the document's own permission flags (Avalonia.Controls.PdfViewer.Permissions, the encryption dictionary's /P entry) restrict what the viewer offers: annotation editing, form filling, text selection and printing are each withheld when the document forbids them. Default true. A document opened with its owner password is unrestricted. Set false to ignore the flags, as an owner's own tooling might. |
| SaveAsCommand | Gets a command that saves to a chosen file via Avalonia.Controls.PdfViewer.SaveAs. |
| SaveCommand | Gets a command that saves the document in place. Honors Avalonia.Controls.PdfViewer.AllowDocumentSaving. |
| SearchMatchCase | Gets or sets whether the toolbar search matches letter case. Default false. |
| SearchMatchWholeWord | Gets or sets whether the toolbar search matches whole words only. Default false. |
| SearchQuery | Gets or sets the search query. |
| SearchResultCount | Gets the number of matches for the current search. |
| SearchResults | Gets the current search results. |
| SelectAllCommand | Gets a command that selects all text on the current page. |
| SelectedShapeType | Gets or sets the active shape tool type. |
| SelectedText | Gets the currently selected text. |
| SetToolCommand | Gets a command that activates a tool: the parameter is a Avalonia.Controls.PdfViewerTool (or its name). Lets a host with its own toolbar drive the same tools as the built-in one. |
| ShapeFillColor | Gets or sets the default shape fill color. Null means no fill. |
| ShapeStrokeColor | Gets or sets the default shape stroke color. Null means no stroke. |
| ShapeStrokeWidth | Gets or sets the default shape stroke width in PDF points (0.5–20). |
| ShapeSubtypeMode | Gets or sets how shapes are written to the file: with their standard subtypes so other readers can edit them, or as stamps that survive other editors untouched. See Avalonia.Controls.PdfShapeSubtypeMode. Default Avalonia.Controls.PdfShapeSubtypeMode.Auto. |
| ShareCommand | Gets a command that shares the document via the configured Avalonia.Controls.PdfViewer.ShareService or a Avalonia.Controls.PdfViewer.ShareRequested handler. Disabled when neither is available. |
| ShareService | Gets or sets the share service used by Avalonia.Controls.PdfViewer.Share, Avalonia.Controls.PdfViewer.ShareAsync(Avalonia.Controls.Pdf.Services.ShareOptions,System.Threading.CancellationToken) and Avalonia.Controls.PdfViewer.ShareCommand. Same semantics as Avalonia.Controls.PdfViewer.PrintService: unset resolves to the platform service, null disables it, clearing the property restores the default. |
| ShowBookmarkIndicators | Gets or sets whether a bookmark ribbon is drawn in the top-right corner of bookmarked pages. Defaults to . |
| SidebarMode | Gets or sets the sidebar mode. |
| SidebarPlacement | Gets or sets how the sidebar sits relative to the document. Avalonia.Controls.SidebarPlacement.Auto (default) mirrors the toolbar layout — overlay on mobile, offset on desktop; Avalonia.Controls.SidebarPlacement.Overlay floats it over a centered document; Avalonia.Controls.SidebarPlacement.Offset shifts the document canvas right by the sidebar width so they don't overlap. |
| SidebarSelectionBrush | Optional override for the selection colour used across all sidebar panes — table of contents, bookmarks, and the selected thumbnail. When set it replaces the theme's selection accent; when the theme default applies (accent-aware in Fluent, monotone in the Default theme). The contrasting foreground (text/chevron) is chosen automatically from the brush's luminance. |
| SidebarWidth | Gets or sets the sidebar width in DIPs (100–300). |
| Source | Gets or sets the path to the PDF file to display. |
| SquigglyColor | Gets or sets the default squiggly underline annotation color. |
| StampColor | Gets or sets the colour used for every stamp. Null (the default) picks a colour by meaning: green for approvals and completions, blue for informational stamps, red for restrictions. |
| StampDateFormat | Gets or sets the .NET date format of a stamp's date line, formatted with the invariant culture and drawn in capitals. Default Avalonia.Controls.PdfViewer.DefaultStampDateFormat ("12 SEP 2026"). |
| StampDateText | The date line a stamp placed now would carry: today in Avalonia.Controls.PdfViewer.StampDateFormat, in capitals. |
| StampLabels | Gets or sets the labels listed by the Stamp dropdown. A label is drawn in capitals and stored as the stamp's /Name with spaces removed ("Not Approved" becomes /NotApproved, one of the standard names). Default Avalonia.Controls.PdfViewer.DefaultStampLabels. |
| StampStyle | Gets or sets the look of stamps added from now on. See Avalonia.Controls.PdfStampStyle. Default Avalonia.Controls.PdfStampStyle.Classic. The Stamp dropdown's style selector sets this too. Existing stamps keep their own style. |
| StrikeoutColor | Gets or sets the default strikeout annotation color. |
| Strings | Gets or sets the user-facing texts of the viewer (tooltips, menus, dialogs, sidebar labels, placeholders, error banners). The template binds to it, so the toolbar follows a change at once; texts built in code (context menus, the Stamp dropdown, thumbnail labels) use the current value when they are next built. Set it before loading a document for a complete switch. Never null: assigning null restores Avalonia.Controls.PdfViewerStrings.Default. |
| StyleKey | Gets the type by which the element is styled. Inherited from StyledElement. |
| Styles | Gets the styles for the styled element. Inherited from StyledElement. |
| TabIndex | Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by pressing the Tab key. Inherited from InputElement. |
| Tag | Gets or sets a user-defined object attached to the control. Inherited from Control. |
| Template | Gets or sets the template that defines the control's appearance. Inherited from TemplatedControl. |
| TemplatedParent | Gets the styled element whose lookless template this styled element is part of. Inherited from StyledElement. |
| TextAnnotationFillColor | Gets or sets the text annotation fill color. Null means no fill. |
| TextAnnotationFont | Gets or sets the text annotation font name. |
| TextAnnotationFontAttributes | Gets or sets the text annotation font attributes. |
| TextAnnotationFontSize | Gets or sets the text annotation font size (1–144). |
| TextAnnotationStrokeColor | Gets or sets the text annotation stroke color. Null means no stroke. |
| TextAnnotationStrokeWidth | Gets or sets the text annotation stroke width (0.5–20). |
| TextAnnotationTextAlign | Gets or sets the text annotation text alignment. |
| TextAnnotationTextColor | Gets or sets the text annotation text color. |
| Theme | Gets or sets the theme to be applied to the element. Inherited from StyledElement. |
| ToggleBookmarkCommand | Gets a command that toggles the bookmark for the page supplied as the command parameter (an int or a string parseable as one), or the current page when no parameter is given. Mirrors the ⌘D / Ctrl+D shortcut. |
| ToolbarLayoutMode | Gets or sets how the toolbar layout is chosen. Avalonia.Controls.PdfToolbarLayoutMode.Mobile or Avalonia.Controls.PdfToolbarLayoutMode.Desktop force that layout regardless of platform or width; Avalonia.Controls.PdfToolbarLayoutMode.Auto (default) decides from platform and available width. This is the supported way to force the touch toolbar; Avalonia.Controls.PdfViewer.IsMobileLayout is the resulting effective state. |
| Transitions | Gets or sets the property transitions for the control. Inherited from Animatable. |
| UnderlineColor | Gets or sets the default underline annotation color. |
| UseLayoutRounding | Gets or sets a value that determines whether the element should be snapped to pixel boundaries at layout time. Inherited from Layoutable. |
| VerticalAlignment | Gets or sets the element's preferred vertical alignment in its parent. Inherited from Layoutable. |
| VerticalScrollOffset | Gets or sets the vertical scroll offset of the page area, in device-independent pixels. |
| ViewMode | Gets or sets the view mode. |
| Width | Gets or sets the width of the element. Inherited from Layoutable. |
| ZIndex | Gets or sets the Z index of the control. Inherited from Visual. |
| ZoomInCommand | Gets a command that zooms in one step. Enabled while a document is loaded. |
| ZoomLevel | Gets or sets the zoom level (1.0 = 100%). |
| ZoomMode | Gets or sets how pages are sized to the viewport. Fit modes recalculate Avalonia.Controls.PdfViewer.ZoomLevel on resize; Avalonia.Controls.PdfZoomMode.Manual leaves it fixed. |
| ZoomOutCommand | Gets a command that zooms out one step. Enabled while a document is loaded. |
| ZoomStep | Gets or sets the additive increment used by Avalonia.Controls.PdfViewer.ZoomIn / Avalonia.Controls.PdfViewer.ZoomOut. When 0 (the default), the built-in preset levels are used instead. |
ActiveTool Property
Gets or sets the tool applied to the next pointer gesture on a page. The built-in toolbar and a host's own controls both read and write this one value: setting it arms the tool (and, for Avalonia.Controls.PdfViewerTool.Shape, keeps or defaults Avalonia.Controls.PdfViewer.SelectedShapeType), Avalonia.Controls.PdfViewerTool.None disarms every tool. Editing capability still applies: while Avalonia.Controls.PdfViewer.CanEditAnnotations is false the value stays Avalonia.Controls.PdfViewerTool.None.
public Avalonia.Controls.PdfViewerTool ActiveTool { get; set; }
AddBookmarkCommand Property
Gets a command that bookmarks the page supplied as the command parameter (defaulting to the current page). Enabled while a document is loaded.
public System.Windows.Input.ICommand AddBookmarkCommand { get; set; }
AllowAnnotationEditing Property
Gets or sets whether annotation tools may be used. Default true.
Ignored (treated as false) when Avalonia.Controls.PdfViewer.IsReadOnly is set.
public bool AllowAnnotationEditing { get; set; }
AllowDocumentSaving Property
Gets or sets whether the built-in save command/UI is available. Default true.
Programmatic Avalonia.Controls.PdfViewer.SaveDocumentAsync(System.IO.Stream) is unaffected.
public bool AllowDocumentSaving { get; set; }
AllowFormEditing Property
Gets or sets whether interactive form fields accept input. Default true.
Ignored (treated as false) when Avalonia.Controls.PdfViewer.IsReadOnly is set.
public bool AllowFormEditing { get; set; }
AllowTextSelection Property
Gets or sets whether the user can select (and copy) text. Default true.
public bool AllowTextSelection { get; set; }
AnnotationMode Property
Gets or sets the annotation interaction mode.
public Avalonia.Controls.AnnotationMode AnnotationMode { get; set; }
AutoSave Property
Gets or sets whether the document is automatically saved after annotation changes. Requires Avalonia.Controls.PdfViewer.Source to be set (file-path based loading).
public bool AutoSave { get; set; }
Bookmarks Property
Gets the current user bookmarks, ordered by page. These are saved reading positions,
distinct from the document outline (Avalonia.Controls.PdfViewer.HasOutline). Persisted to the document's
XMP metadata in the Preview-compatible apple-preview format.
public System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfUserBookmark> Bookmarks { get; set; }
CanEditAnnotations Property
Gets whether annotation editing is currently permitted — when Avalonia.Controls.PdfViewer.IsReadOnly is set or Avalonia.Controls.PdfViewer.AllowAnnotationEditing is cleared. Bindable so the template can gate the annotation toolbar.
public bool CanEditAnnotations { get; set; }
CanPrint Property
True when a document is loaded and printing can go somewhere: either Avalonia.Controls.PdfViewer.PrintRequested has a handler or a supported Avalonia.Controls.PdfViewer.PrintService exists.
public bool CanPrint { get; set; }
CanRedo Property
Gets whether there is an undone edit that Avalonia.Controls.PdfViewer.Redo can re-apply.
public bool CanRedo { get; set; }
CanShare Property
True when a document is loaded and sharing can go somewhere: either Avalonia.Controls.PdfViewer.ShareRequested has a handler or a supported Avalonia.Controls.PdfViewer.ShareService exists.
public bool CanShare { get; set; }
CanUndo Property
Gets whether there is an edit that Avalonia.Controls.PdfViewer.Undo can revert. Bindable so a host or template can enable an Undo button.
public bool CanUndo { get; set; }
CopyCommand Property
Gets a command that copies the current text selection to the clipboard.
public System.Windows.Input.ICommand CopyCommand { get; set; }
CurrentPage Property
Gets or sets the current page number (1-based).
public int CurrentPage { get; set; }
CurrentSearchResultIndex Property
Gets the 0-based index of the active search match, or -1 when there are none.
public int CurrentSearchResultIndex { get; set; }
DismissErrorCommand Property
Gets a command that clears Avalonia.Controls.PdfViewer.ErrorMessage. Enabled while an error is shown.
public System.Windows.Input.ICommand DismissErrorCommand { get; set; }
DocumentSource Property
Gets or sets the document to display, accepting a string file path,
a Uri (file scheme), a System.IO.Stream, or a byte array.
This is the binding-friendly alternative to Avalonia.Controls.PdfViewer.Source; assigning it loads
the document immediately. Setting it to null closes the current document.
public object DocumentSource { get; set; }
DrawStrokeColor Property
Gets or sets the default draw/ink stroke color.
public Avalonia.Controls.Pdf.Core.PdfAnnotationColor DrawStrokeColor { get; set; }
DrawStrokeWidth Property
Gets or sets the draw stroke width in PDF points (0.5–20).
public float DrawStrokeWidth { get; set; }
EnableKeyboardShortcuts Property
Gets or sets whether the viewer handles its built-in keyboard shortcuts — copy, select-all,
the zoom accelerators, save, arrow-key navigation and nudging. Default true. Set false when a
host binds those keystrokes to its own commands and doesn't want the viewer to consume them.
Form-field text input and Escape-to-deselect are unaffected.
public bool EnableKeyboardShortcuts { get; set; }
ErrorMessage Property
Gets the current error message, if any.
public string ErrorMessage { get; set; }
FitPageCommand Property
Gets a command that fits the whole page to the viewport.
public System.Windows.Input.ICommand FitPageCommand { get; set; }
FitWidthCommand Property
Gets a command that fits the page width to the viewport.
public System.Windows.Input.ICommand FitWidthCommand { get; set; }
GoToPageCommand Property
Gets a command that navigates to the page number supplied as the command parameter (an int or a string parseable as one).
public System.Windows.Input.ICommand GoToPageCommand { get; set; }
HasBookmarks Property
Gets whether the document has bookmarks.
public bool HasBookmarks { get; set; }
HasDocument Property
Gets whether a document is currently open. The template uses it to show errors as a dismissible banner over an open document instead of the full-canvas error state.
public bool HasDocument { get; set; }
HasOutline Property
Gets whether the document has an outline (table of contents).
public bool HasOutline { get; set; }
HasSelection Property
Gets whether there is an active text selection.
public bool HasSelection { get; set; }
HighlightColor Property
Gets or sets the default highlight annotation color.
public Avalonia.Controls.Pdf.Core.PdfAnnotationColor HighlightColor { get; set; }
IncludeStampDate Property
Gets or sets whether stamps added from now on carry the current date as a second line (see Avalonia.Controls.PdfViewer.StampDateFormat). The Stamp dropdown's "Include date" toggle sets this too. Default . Existing stamps keep their date, or their lack of one.
public bool IncludeStampDate { get; set; }
IsArrowKeyNudgeEnabled Property
Gets or sets whether the arrow keys move the selected annotation by one pixel (ten with
Shift) instead of navigating. Default true. With no annotation selected the arrow
keys always navigate. Also off when Avalonia.Controls.PdfViewer.EnableKeyboardShortcuts is false.
public bool IsArrowKeyNudgeEnabled { get; set; }
IsBookmarksEnabled Property
Gets or sets whether the Bookmarks sidebar pane is available. When its tab is hidden and the mode can't be selected. Default .
public bool IsBookmarksEnabled { get; set; }
IsDirty Property
Gets whether the document has edits (annotations, form values, redactions, bookmarks) that have not been written since it was loaded or last saved. Cleared by a successful Avalonia.Controls.PdfViewer.SaveAsync, Avalonia.Controls.PdfViewer.SaveDocumentAsync(System.IO.Stream) or auto-save and by loading another document. Undoing back to the saved state does not clear it.
public bool IsDirty { get; set; }
IsDrawToolVisible Property
Gets or sets whether the Draw (ink) tool is shown. Default .
public bool IsDrawToolVisible { get; set; }
IsHighlightToolVisible Property
Gets or sets whether the Highlight tool is shown. Default .
public bool IsHighlightToolVisible { get; set; }
IsLinkToolVisible Property
Gets or sets whether the Link tool is shown. Default .
public bool IsLinkToolVisible { get; set; }
IsLoading Property
Gets whether the control is currently loading a document.
public bool IsLoading { get; set; }
IsMobileLayout Property
Gets whether the touch-optimised mobile layout is used. When true, the annotation tools are relocated from the centre of the top toolbar to a dedicated bar along the bottom of the control; the search field, page navigation and menu stay in the top toolbar. The control manages this automatically — true on iOS/Android, or on any platform when the control is narrower than 500 device-independent pixels — recomputing as it resizes, so any value set externally is transient.
public bool IsMobileLayout { get; set; }
IsMoreOptionsVisible Property
Gets or sets whether the toolbar's More Options menu (print, share, view modes) is shown.
public bool IsMoreOptionsVisible { get; set; }
IsNoteToolVisible Property
Gets or sets whether the Note (sticky note) tool is shown. Default .
public bool IsNoteToolVisible { get; set; }
IsOpenVisible Property
Gets or sets whether an Open entry is offered at the top of the More Options menu. Off by default: most hosts load documents themselves. The entry runs Avalonia.Controls.PdfViewer.OpenAsync(System.Threading.CancellationToken).
public bool IsOpenVisible { get; set; }
IsPrintVisible Property
Gets or sets whether the Print entry is offered in the More Options menu. Even when
true the entry is hidden on platforms without a print service unless
Avalonia.Controls.PdfViewer.PrintRequested is handled.
public bool IsPrintVisible { get; set; }
IsReadOnly Property
Gets or sets a value that, when true, disables all document editing
(annotation tools and form input). Text selection and navigation remain available.
public bool IsReadOnly { get; set; }
IsRedactionUndoEnabled Property
Gets or sets whether redactions are recorded in the undo history. When false a
redaction is final as soon as it is applied and holds no document copy; other edits stay
undoable. Defaults to true.
public bool IsRedactionUndoEnabled { get; set; }
IsRedactToolVisible Property
Gets or sets whether the Redact tool is shown. Default .
public bool IsRedactToolVisible { get; set; }
IsSaveAsVisible Property
Gets or sets whether a Save As entry is offered in the More Options menu. Off by default. The entry runs Avalonia.Controls.PdfViewer.SaveAsAsync(System.Threading.CancellationToken).
public bool IsSaveAsVisible { get; set; }
IsSaveVisible Property
Gets or sets whether a Save entry (save in place, see Avalonia.Controls.PdfViewer.SaveAsync) is offered
in the More Options menu. Off by default; hidden anyway while
Avalonia.Controls.PdfViewer.AllowDocumentSaving is false.
public bool IsSaveVisible { get; set; }
IsShapeToolVisible Property
Gets or sets whether the Shapes tool is shown. Default .
public bool IsShapeToolVisible { get; set; }
IsShareVisible Property
Gets or sets whether the Share entry is offered in the More Options menu. Even when
true the entry is hidden on platforms without a share service unless
Avalonia.Controls.PdfViewer.ShareRequested is handled.
public bool IsShareVisible { get; set; }
IsSidebarOpen Property
Gets whether the sidebar is open (any mode other than None).
public bool IsSidebarOpen { get; set; }
IsSidebarVisible Property
Gets or sets whether the sidebar is visible (including collapsed state). When false, the sidebar is completely hidden and cannot be toggled.
public bool IsSidebarVisible { get; set; }
IsSquigglyToolVisible Property
Gets or sets whether the Squiggly tool is shown. Default .
public bool IsSquigglyToolVisible { get; set; }
IsStampToolVisible Property
Gets or sets whether the Stamp dropdown is shown in the toolbar. Default .
public bool IsStampToolVisible { get; set; }
IsStrikethroughToolVisible Property
Gets or sets whether the Strikethrough tool is shown. Default .
public bool IsStrikethroughToolVisible { get; set; }
IsTableOfContentsEnabled Property
Gets or sets whether the Table of Contents sidebar pane is available. When its tab is hidden and the mode can't be selected. Default .
public bool IsTableOfContentsEnabled { get; set; }
IsTextToolVisible Property
Gets or sets whether the Add Text (free text) tool is shown. Default .
public bool IsTextToolVisible { get; set; }
IsToolbarVisible Property
Gets or sets whether the toolbar is visible.
public bool IsToolbarVisible { get; set; }
IsUnderlineToolVisible Property
Gets or sets whether the Underline tool is shown. Default .
public bool IsUnderlineToolVisible { get; set; }
MaxRedactionUndoSteps Property
Gets or sets how many redactions can be undone (0–100). A redaction rewrites page content, so
each undo step keeps a serialized copy of the whole document as it was; this limit bounds
that memory separately from Avalonia.Controls.PdfViewer.MaxUndoSteps. The most recent redactions are kept:
when the limit is exceeded the oldest redaction step is dropped from the history while the
annotation steps around it stay. Zero records no redactions. Defaults to 10.
public int MaxRedactionUndoSteps { get; set; }
MaxRenderScale Property
Gets or sets the maximum device-pixel ratio the page raster is rendered at. Pages are
rendered at ZoomLevel × clamp(screenScaling, 1, MaxRenderScale) pixels so text stays
crisp on HiDPI displays. Higher values are sharper but use more memory (bitmap bytes scale
with the square of the ratio); set to 1.0 to disable DPI-aware rendering. Default 2.0.
public double MaxRenderScale { get; set; }
MaxUndoSteps Property
Gets or sets how many undo steps are retained (0–1000). Lowering it trims the oldest history.
Zero disables undo/redo entirely. Defaults to 100.
public int MaxUndoSteps { get; set; }
MaxZoom Property
Gets or sets the maximum allowed Avalonia.Controls.PdfViewer.ZoomLevel (1.0 == 100%). Default 5.0, at most Avalonia.Controls.PdfViewer.MaxZoomLimit.
public double MaxZoom { get; set; }
Metadata Property
Gets the loaded document's metadata, or null when no document is open.
public Avalonia.Controls.Pdf.Core.PdfMetadata Metadata { get; set; }
MinZoom Property
Gets or sets the minimum allowed Avalonia.Controls.PdfViewer.ZoomLevel (1.0 == 100%). Default 0.05.
public double MinZoom { get; set; }
NextPageCommand Property
Gets a command that advances to the next page. Disabled on the last page.
public System.Windows.Input.ICommand NextPageCommand { get; set; }
NoteColor Property
Gets or sets the default note color.
public Avalonia.Controls.Pdf.Core.PdfAnnotationColor NoteColor { get; set; }
OpenCommand Property
Gets a command that opens a document via Avalonia.Controls.PdfViewer.Open (file picker or Avalonia.Controls.PdfViewer.OpenRequested).
public System.Windows.Input.ICommand OpenCommand { get; set; }
PageCount Property
Gets the total number of pages in the document.
public int PageCount { get; set; }
PageRenderBuffer Property
Gets or sets how many pages on each side of the viewport are decoded ahead of time in continuous mode. Higher values reduce blank placeholders while scrolling at the cost of memory; lower values minimize memory. Clamped to [0, Avalonia.Controls.PdfViewer.MaxPageRenderBuffer]. Default is 2.
public int PageRenderBuffer { get; set; }
PageRetentionBuffer Property
Gets or sets how many pages on each side of the viewport are kept decoded before being evicted in continuous mode. Acts as hysteresis: pages between the render buffer and this margin stay in memory so short back-and-forth scrolling does not re-render them. If set below Avalonia.Controls.PdfViewer.PageRenderBuffer, the render buffer is used for retention. Clamped to [0, Avalonia.Controls.PdfViewer.MaxPageRetentionBuffer]. Default is 4.
public int PageRetentionBuffer { get; set; }
Password Property
Gets or sets the password for encrypted PDFs.
public string Password { get; set; }
Permissions Property
Gets the loaded document's permission flags, or null when no document is open.
public Nullable<Avalonia.Controls.PdfPermissions> Permissions { get; set; }
PreviousPageCommand Property
Gets a command that goes to the previous page. Disabled on the first page.
public System.Windows.Input.ICommand PreviousPageCommand { get; set; }
PrintCommand Property
Gets a command that prints the document via the configured Avalonia.Controls.PdfViewer.PrintService. Disabled when no print service is set.
public System.Windows.Input.ICommand PrintCommand { get; set; }
PrintService Property
Gets or sets the print service used by Avalonia.Controls.PdfViewer.Print, Avalonia.Controls.PdfViewer.PrintAsync(Avalonia.Controls.Pdf.Services.PrintOptions,System.Threading.CancellationToken) and
Avalonia.Controls.PdfViewer.PrintCommand. While the property is unset it resolves to the built-in service
for the current platform (Windows, macOS, iOS, Android; null elsewhere). Assign or
bind your own implementation to replace it, set null to disable the built-in one,
or clear the property to return to the platform default. Handle
Avalonia.Controls.PdfViewer.PrintRequested to bypass the service entirely.
public Avalonia.Controls.Pdf.Services.IPrintService PrintService { get; set; }
RedactionRemovesHiddenInformation Property
Gets or sets whether a redaction also removes the places a document keeps copies of its
content outside the page: the tagged structure tree (with its /ActualText and /Alt text),
the redacted page's embedded thumbnail, and the XMP and Info metadata (title, author,
keywords). Default true. Objects nothing references any more are dropped either way.
Outline titles and file attachments are never touched.
public bool RedactionRemovesHiddenInformation { get; set; }
RemoveBookmarkCommand Property
Gets a command that removes the bookmark for the page supplied as the command parameter (defaulting to the current page). Enabled while a document is loaded.
public System.Windows.Input.ICommand RemoveBookmarkCommand { get; set; }
ResetZoomCommand Property
Gets a command that resets the zoom to 100%. Enabled while a document is loaded.
public System.Windows.Input.ICommand ResetZoomCommand { get; set; }
RespectDocumentPermissions Property
Gets or sets whether the document's own permission flags (Avalonia.Controls.PdfViewer.Permissions, the
encryption dictionary's /P entry) restrict what the viewer offers: annotation editing, form
filling, text selection and printing are each withheld when the document forbids them.
Default true. A document opened with its owner password is unrestricted. Set
false to ignore the flags, as an owner's own tooling might.
public bool RespectDocumentPermissions { get; set; }
SaveAsCommand Property
Gets a command that saves to a chosen file via Avalonia.Controls.PdfViewer.SaveAs.
public System.Windows.Input.ICommand SaveAsCommand { get; set; }
SaveCommand Property
Gets a command that saves the document in place. Honors Avalonia.Controls.PdfViewer.AllowDocumentSaving.
public System.Windows.Input.ICommand SaveCommand { get; set; }
SearchMatchCase Property
Gets or sets whether the toolbar search matches letter case. Default false.
public bool SearchMatchCase { get; set; }
SearchMatchWholeWord Property
Gets or sets whether the toolbar search matches whole words only. Default false.
public bool SearchMatchWholeWord { get; set; }
SearchQuery Property
Gets or sets the search query.
public string SearchQuery { get; set; }
SearchResultCount Property
Gets the number of matches for the current search.
public int SearchResultCount { get; set; }
SearchResults Property
Gets the current search results.
public System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfSearchResult> SearchResults { get; set; }
SelectAllCommand Property
Gets a command that selects all text on the current page.
public System.Windows.Input.ICommand SelectAllCommand { get; set; }
SelectedShapeType Property
Gets or sets the active shape tool type.
public Avalonia.Controls.ShapeType SelectedShapeType { get; set; }
SelectedText Property
Gets the currently selected text.
public string SelectedText { get; set; }
SetToolCommand Property
Gets a command that activates a tool: the parameter is a Avalonia.Controls.PdfViewerTool (or its name). Lets a host with its own toolbar drive the same tools as the built-in one.
public System.Windows.Input.ICommand SetToolCommand { get; set; }
ShapeFillColor Property
Gets or sets the default shape fill color. Null means no fill.
public Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> ShapeFillColor { get; set; }
ShapeStrokeColor Property
Gets or sets the default shape stroke color. Null means no stroke.
public Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> ShapeStrokeColor { get; set; }
ShapeStrokeWidth Property
Gets or sets the default shape stroke width in PDF points (0.5–20).
public float ShapeStrokeWidth { get; set; }
ShapeSubtypeMode Property
Gets or sets how shapes are written to the file: with their standard subtypes so other readers can edit them, or as stamps that survive other editors untouched. See Avalonia.Controls.PdfShapeSubtypeMode. Default Avalonia.Controls.PdfShapeSubtypeMode.Auto.
public Avalonia.Controls.PdfShapeSubtypeMode ShapeSubtypeMode { get; set; }
ShareCommand Property
Gets a command that shares the document via the configured Avalonia.Controls.PdfViewer.ShareService or a Avalonia.Controls.PdfViewer.ShareRequested handler. Disabled when neither is available.
public System.Windows.Input.ICommand ShareCommand { get; set; }
ShareService Property
Gets or sets the share service used by Avalonia.Controls.PdfViewer.Share, Avalonia.Controls.PdfViewer.ShareAsync(Avalonia.Controls.Pdf.Services.ShareOptions,System.Threading.CancellationToken) and
Avalonia.Controls.PdfViewer.ShareCommand. Same semantics as Avalonia.Controls.PdfViewer.PrintService: unset resolves to
the platform service, null disables it, clearing the property restores the default.
public Avalonia.Controls.Pdf.Services.IShareService ShareService { get; set; }
ShowBookmarkIndicators Property
Gets or sets whether a bookmark ribbon is drawn in the top-right corner of bookmarked pages. Defaults to .
public bool ShowBookmarkIndicators { get; set; }
SidebarMode Property
Gets or sets the sidebar mode.
public Avalonia.Controls.SidebarMode SidebarMode { get; set; }
SidebarPlacement Property
Gets or sets how the sidebar sits relative to the document. Avalonia.Controls.SidebarPlacement.Auto (default) mirrors the toolbar layout — overlay on mobile, offset on desktop; Avalonia.Controls.SidebarPlacement.Overlay floats it over a centered document; Avalonia.Controls.SidebarPlacement.Offset shifts the document canvas right by the sidebar width so they don't overlap.
public Avalonia.Controls.SidebarPlacement SidebarPlacement { get; set; }
SidebarSelectionBrush Property
Optional override for the selection colour used across all sidebar panes — table of contents, bookmarks, and the selected thumbnail. When set it replaces the theme's selection accent; when the theme default applies (accent-aware in Fluent, monotone in the Default theme). The contrasting foreground (text/chevron) is chosen automatically from the brush's luminance.
public Avalonia.Media.IBrush SidebarSelectionBrush { get; set; }
SidebarWidth Property
Gets or sets the sidebar width in DIPs (100–300).
public double SidebarWidth { get; set; }
Source Property
Gets or sets the path to the PDF file to display.
public string Source { get; set; }
SquigglyColor Property
Gets or sets the default squiggly underline annotation color.
public Avalonia.Controls.Pdf.Core.PdfAnnotationColor SquigglyColor { get; set; }
StampColor Property
Gets or sets the colour used for every stamp. Null (the default) picks a colour by meaning: green for approvals and completions, blue for informational stamps, red for restrictions.
public Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> StampColor { get; set; }
StampDateFormat Property
Gets or sets the .NET date format of a stamp's date line, formatted with the invariant culture and drawn in capitals. Default Avalonia.Controls.PdfViewer.DefaultStampDateFormat ("12 SEP 2026").
public string StampDateFormat { get; set; }
StampDateText Property
The date line a stamp placed now would carry: today in Avalonia.Controls.PdfViewer.StampDateFormat, in capitals.
public string StampDateText { get; set; }
StampLabels Property
Gets or sets the labels listed by the Stamp dropdown. A label is drawn in capitals and
stored as the stamp's /Name with spaces removed ("Not Approved" becomes
/NotApproved, one of the standard names). Default Avalonia.Controls.PdfViewer.DefaultStampLabels.
public System.Collections.Generic.IReadOnlyList<string> StampLabels { get; set; }
StampStyle Property
Gets or sets the look of stamps added from now on. See Avalonia.Controls.PdfStampStyle. Default Avalonia.Controls.PdfStampStyle.Classic. The Stamp dropdown's style selector sets this too. Existing stamps keep their own style.
public Avalonia.Controls.PdfStampStyle StampStyle { get; set; }
StrikeoutColor Property
Gets or sets the default strikeout annotation color.
public Avalonia.Controls.Pdf.Core.PdfAnnotationColor StrikeoutColor { get; set; }
Strings Property
Gets or sets the user-facing texts of the viewer (tooltips, menus, dialogs, sidebar labels, placeholders, error banners). The template binds to it, so the toolbar follows a change at once; texts built in code (context menus, the Stamp dropdown, thumbnail labels) use the current value when they are next built. Set it before loading a document for a complete switch. Never null: assigning null restores Avalonia.Controls.PdfViewerStrings.Default.
public Avalonia.Controls.PdfViewerStrings Strings { get; set; }
TextAnnotationFillColor Property
Gets or sets the text annotation fill color. Null means no fill.
public Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> TextAnnotationFillColor { get; set; }
TextAnnotationFont Property
Gets or sets the text annotation font name.
public string TextAnnotationFont { get; set; }
TextAnnotationFontAttributes Property
Gets or sets the text annotation font attributes.
public Avalonia.Controls.FontAttributes TextAnnotationFontAttributes { get; set; }
TextAnnotationFontSize Property
Gets or sets the text annotation font size (1–144).
public float TextAnnotationFontSize { get; set; }
TextAnnotationStrokeColor Property
Gets or sets the text annotation stroke color. Null means no stroke.
public Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> TextAnnotationStrokeColor { get; set; }
TextAnnotationStrokeWidth Property
Gets or sets the text annotation stroke width (0.5–20).
public float TextAnnotationStrokeWidth { get; set; }
TextAnnotationTextAlign Property
Gets or sets the text annotation text alignment.
public Avalonia.Controls.TextAnnotationAlignment TextAnnotationTextAlign { get; set; }
TextAnnotationTextColor Property
Gets or sets the text annotation text color.
public Avalonia.Controls.Pdf.Core.PdfAnnotationColor TextAnnotationTextColor { get; set; }
ToggleBookmarkCommand Property
Gets a command that toggles the bookmark for the page supplied as the command parameter (an int or a string parseable as one), or the current page when no parameter is given. Mirrors the ⌘D / Ctrl+D shortcut.
public System.Windows.Input.ICommand ToggleBookmarkCommand { get; set; }
ToolbarLayoutMode Property
Gets or sets how the toolbar layout is chosen. Avalonia.Controls.PdfToolbarLayoutMode.Mobile or Avalonia.Controls.PdfToolbarLayoutMode.Desktop force that layout regardless of platform or width; Avalonia.Controls.PdfToolbarLayoutMode.Auto (default) decides from platform and available width. This is the supported way to force the touch toolbar; Avalonia.Controls.PdfViewer.IsMobileLayout is the resulting effective state.
public Avalonia.Controls.PdfToolbarLayoutMode ToolbarLayoutMode { get; set; }
UnderlineColor Property
Gets or sets the default underline annotation color.
public Avalonia.Controls.Pdf.Core.PdfAnnotationColor UnderlineColor { get; set; }
VerticalScrollOffset Property
Gets or sets the vertical scroll offset of the page area, in device-independent pixels.
public double VerticalScrollOffset { get; set; }
ViewMode Property
Gets or sets the view mode.
public Avalonia.Controls.PdfViewMode ViewMode { get; set; }
ZoomInCommand Property
Gets a command that zooms in one step. Enabled while a document is loaded.
public System.Windows.Input.ICommand ZoomInCommand { get; set; }
ZoomLevel Property
Gets or sets the zoom level (1.0 = 100%).
public double ZoomLevel { get; set; }
ZoomMode Property
Gets or sets how pages are sized to the viewport. Fit modes recalculate Avalonia.Controls.PdfViewer.ZoomLevel on resize; Avalonia.Controls.PdfZoomMode.Manual leaves it fixed.
public Avalonia.Controls.PdfZoomMode ZoomMode { get; set; }
ZoomOutCommand Property
Gets a command that zooms out one step. Enabled while a document is loaded.
public System.Windows.Input.ICommand ZoomOutCommand { get; set; }
ZoomStep Property
Gets or sets the additive increment used by Avalonia.Controls.PdfViewer.ZoomIn / Avalonia.Controls.PdfViewer.ZoomOut.
When 0 (the default), the built-in preset levels are used instead.
public double ZoomStep { get; set; }
Fields
ActiveToolProperty Field
Defines the Avalonia.Controls.PdfViewer.ActiveTool property.
public Avalonia.StyledProperty<Avalonia.Controls.PdfViewerTool> ActiveToolProperty
AllowAnnotationEditingProperty Field
Defines the Avalonia.Controls.PdfViewer.AllowAnnotationEditing property.
public Avalonia.StyledProperty<bool> AllowAnnotationEditingProperty
AllowDocumentSavingProperty Field
Defines the Avalonia.Controls.PdfViewer.AllowDocumentSaving property.
public Avalonia.StyledProperty<bool> AllowDocumentSavingProperty
AllowFormEditingProperty Field
Defines the Avalonia.Controls.PdfViewer.AllowFormEditing property.
public Avalonia.StyledProperty<bool> AllowFormEditingProperty
AllowTextSelectionProperty Field
Defines the Avalonia.Controls.PdfViewer.AllowTextSelection property.
public Avalonia.StyledProperty<bool> AllowTextSelectionProperty
AnnotatingClass Field
An annotation tool is active (Avalonia.Controls.PdfViewer.AnnotationMode is not None).
public string AnnotatingClass
AnnotationModeProperty Field
Defines the Avalonia.Controls.PdfViewer.AnnotationMode property.
public Avalonia.StyledProperty<Avalonia.Controls.AnnotationMode> AnnotationModeProperty
AutoSaveProperty Field
Defines the Avalonia.Controls.PdfViewer.AutoSave property.
public Avalonia.StyledProperty<bool> AutoSaveProperty
CanEditAnnotationsProperty Field
Defines the Avalonia.Controls.PdfViewer.CanEditAnnotations property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> CanEditAnnotationsProperty
CanRedoProperty Field
Defines the Avalonia.Controls.PdfViewer.CanRedo property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> CanRedoProperty
CanUndoProperty Field
Defines the Avalonia.Controls.PdfViewer.CanUndo property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> CanUndoProperty
CurrentPageProperty Field
Defines the Avalonia.Controls.PdfViewer.CurrentPage property.
public Avalonia.StyledProperty<int> CurrentPageProperty
CurrentSearchResultIndexProperty Field
Defines the Avalonia.Controls.PdfViewer.CurrentSearchResultIndex property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, int> CurrentSearchResultIndexProperty
DefaultStampDateFormat Field
The date format used by default for a stamp's date line ("12 SEP 2026").
public string DefaultStampDateFormat
DefaultStampLabels Field
The stamp labels offered by default: the ISO 32000 standard names plus common extras.
public System.Collections.Generic.IReadOnlyList<string> DefaultStampLabels
DocumentSourceProperty Field
Defines the Avalonia.Controls.PdfViewer.DocumentSource property.
public Avalonia.StyledProperty<object> DocumentSourceProperty
DrawStrokeColorProperty Field
Defines the Avalonia.Controls.PdfViewer.DrawStrokeColor property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> DrawStrokeColorProperty
DrawStrokeWidthProperty Field
Defines the Avalonia.Controls.PdfViewer.DrawStrokeWidth property.
public Avalonia.StyledProperty<float> DrawStrokeWidthProperty
EditingTextClass Field
A free-text annotation is being edited in place.
public string EditingTextClass
EnableKeyboardShortcutsProperty Field
Defines the Avalonia.Controls.PdfViewer.EnableKeyboardShortcuts property.
public Avalonia.StyledProperty<bool> EnableKeyboardShortcutsProperty
ErrorClass Field
Avalonia.Controls.PdfViewer.ErrorMessage is set.
public string ErrorClass
ErrorMessageProperty Field
Defines the Avalonia.Controls.PdfViewer.ErrorMessage property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, string> ErrorMessageProperty
FormFieldFocusedClass Field
Keyboard input is going to a form field.
public string FormFieldFocusedClass
HasBookmarksProperty Field
Defines the Avalonia.Controls.PdfViewer.HasBookmarks property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> HasBookmarksProperty
HasDocumentClass Field
A document is open.
public string HasDocumentClass
HasDocumentProperty Field
Defines the Avalonia.Controls.PdfViewer.HasDocument property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> HasDocumentProperty
HasOutlineProperty Field
Defines the Avalonia.Controls.PdfViewer.HasOutline property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> HasOutlineProperty
HasSelectionProperty Field
Defines the Avalonia.Controls.PdfViewer.HasSelection property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> HasSelectionProperty
HighlightColorProperty Field
Defines the Avalonia.Controls.PdfViewer.HighlightColor property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> HighlightColorProperty
IncludeStampDateProperty Field
Defines the Avalonia.Controls.PdfViewer.IncludeStampDate property.
public Avalonia.StyledProperty<bool> IncludeStampDateProperty
IsArrowKeyNudgeEnabledProperty Field
Defines the Avalonia.Controls.PdfViewer.IsArrowKeyNudgeEnabled property.
public Avalonia.StyledProperty<bool> IsArrowKeyNudgeEnabledProperty
IsBookmarksEnabledProperty Field
Defines the Avalonia.Controls.PdfViewer.IsBookmarksEnabled property.
public Avalonia.StyledProperty<bool> IsBookmarksEnabledProperty
IsDirtyProperty Field
Defines the Avalonia.Controls.PdfViewer.IsDirty property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> IsDirtyProperty
IsDrawToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsDrawToolVisible property.
public Avalonia.StyledProperty<bool> IsDrawToolVisibleProperty
IsHighlightToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsHighlightToolVisible property.
public Avalonia.StyledProperty<bool> IsHighlightToolVisibleProperty
IsLinkToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsLinkToolVisible property.
public Avalonia.StyledProperty<bool> IsLinkToolVisibleProperty
IsLoadingProperty Field
Defines the Avalonia.Controls.PdfViewer.IsLoading property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> IsLoadingProperty
IsMobileLayoutProperty Field
Defines the Avalonia.Controls.PdfViewer.IsMobileLayout property. Managed automatically by
the control: true on iOS/Android, and on any platform once the control is
narrower than MobileLayoutWidthThreshold device-independent pixels.
public Avalonia.StyledProperty<bool> IsMobileLayoutProperty
IsMoreOptionsVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsMoreOptionsVisible property.
public Avalonia.StyledProperty<bool> IsMoreOptionsVisibleProperty
IsNoteToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsNoteToolVisible property.
public Avalonia.StyledProperty<bool> IsNoteToolVisibleProperty
IsOpenVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsOpenVisible property.
public Avalonia.StyledProperty<bool> IsOpenVisibleProperty
IsPrintVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsPrintVisible property.
public Avalonia.StyledProperty<bool> IsPrintVisibleProperty
IsReadOnlyProperty Field
Defines the Avalonia.Controls.PdfViewer.IsReadOnly property.
public Avalonia.StyledProperty<bool> IsReadOnlyProperty
IsRedactionUndoEnabledProperty Field
Defines the Avalonia.Controls.PdfViewer.IsRedactionUndoEnabled property.
public Avalonia.StyledProperty<bool> IsRedactionUndoEnabledProperty
IsRedactToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsRedactToolVisible property.
public Avalonia.StyledProperty<bool> IsRedactToolVisibleProperty
IsSaveAsVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsSaveAsVisible property.
public Avalonia.StyledProperty<bool> IsSaveAsVisibleProperty
IsSaveVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsSaveVisible property.
public Avalonia.StyledProperty<bool> IsSaveVisibleProperty
IsShapeToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsShapeToolVisible property.
public Avalonia.StyledProperty<bool> IsShapeToolVisibleProperty
IsShareVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsShareVisible property.
public Avalonia.StyledProperty<bool> IsShareVisibleProperty
IsSidebarOpenProperty Field
Defines the Avalonia.Controls.PdfViewer.IsSidebarOpen property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, bool> IsSidebarOpenProperty
IsSidebarVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsSidebarVisible property.
public Avalonia.StyledProperty<bool> IsSidebarVisibleProperty
IsSquigglyToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsSquigglyToolVisible property.
public Avalonia.StyledProperty<bool> IsSquigglyToolVisibleProperty
IsStampToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsStampToolVisible property.
public Avalonia.StyledProperty<bool> IsStampToolVisibleProperty
IsStrikethroughToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsStrikethroughToolVisible property.
public Avalonia.StyledProperty<bool> IsStrikethroughToolVisibleProperty
IsTableOfContentsEnabledProperty Field
Defines the Avalonia.Controls.PdfViewer.IsTableOfContentsEnabled property.
public Avalonia.StyledProperty<bool> IsTableOfContentsEnabledProperty
IsTextToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsTextToolVisible property.
public Avalonia.StyledProperty<bool> IsTextToolVisibleProperty
IsToolbarVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsToolbarVisible property.
public Avalonia.StyledProperty<bool> IsToolbarVisibleProperty
IsUnderlineToolVisibleProperty Field
Defines the Avalonia.Controls.PdfViewer.IsUnderlineToolVisible property.
public Avalonia.StyledProperty<bool> IsUnderlineToolVisibleProperty
LoadingClass Field
A document is being loaded.
public string LoadingClass
MaxPageRenderBuffer Field
The largest accepted value for Avalonia.Controls.PdfViewer.PageRenderBuffer.
public int MaxPageRenderBuffer
MaxPageRetentionBuffer Field
The largest accepted value for Avalonia.Controls.PdfViewer.PageRetentionBuffer.
public int MaxPageRetentionBuffer
MaxRedactionUndoStepsLimit Field
Largest redaction undo history the control accepts. Each step holds a serialized copy of the document, so this is far lower than Avalonia.Controls.PdfViewer.MaxUndoStepsLimit.
public int MaxRedactionUndoStepsLimit
MaxRedactionUndoStepsProperty Field
Defines the Avalonia.Controls.PdfViewer.MaxRedactionUndoSteps property.
public Avalonia.StyledProperty<int> MaxRedactionUndoStepsProperty
MaxRenderScaleProperty Field
Defines the Avalonia.Controls.PdfViewer.MaxRenderScale property.
public Avalonia.StyledProperty<double> MaxRenderScaleProperty
MaxUndoStepsLimit Field
Largest retained undo history the control accepts.
public int MaxUndoStepsLimit
MaxUndoStepsProperty Field
Defines the Avalonia.Controls.PdfViewer.MaxUndoSteps property.
public Avalonia.StyledProperty<int> MaxUndoStepsProperty
MaxZoomLimit Field
Largest Avalonia.Controls.PdfViewer.MaxZoom the control accepts (10000%).
public double MaxZoomLimit
MaxZoomProperty Field
Defines the Avalonia.Controls.PdfViewer.MaxZoom property.
public Avalonia.StyledProperty<double> MaxZoomProperty
MinZoomProperty Field
Defines the Avalonia.Controls.PdfViewer.MinZoom property.
public Avalonia.StyledProperty<double> MinZoomProperty
MobileClass Field
The compact mobile layout is in effect.
public string MobileClass
NarrowClass Field
The control is narrower than Avalonia.Controls.PdfViewer.NarrowToolbarWidth (a phone in portrait): the toolbar condenses.
public string NarrowClass
NarrowToolbarWidth Field
Below this width the search field and the right cluster cannot share the toolbar, so the toolbar condenses: the search collapses to an icon and, opened, takes the whole row.
public double NarrowToolbarWidth
NoteColorProperty Field
Defines the Avalonia.Controls.PdfViewer.NoteColor property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> NoteColorProperty
Remarks
Default matches the first sticky-note swatch (warm yellow).
PageCountProperty Field
Defines the Avalonia.Controls.PdfViewer.PageCount property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, int> PageCountProperty
PageRenderBufferProperty Field
Defines the Avalonia.Controls.PdfViewer.PageRenderBuffer property. Values are clamped to [0, Avalonia.Controls.PdfViewer.MaxPageRenderBuffer].
public Avalonia.StyledProperty<int> PageRenderBufferProperty
PageRetentionBufferProperty Field
Defines the Avalonia.Controls.PdfViewer.PageRetentionBuffer property. Values are clamped to [0, Avalonia.Controls.PdfViewer.MaxPageRetentionBuffer].
public Avalonia.StyledProperty<int> PageRetentionBufferProperty
PasswordProperty Field
Defines the Avalonia.Controls.PdfViewer.Password property.
public Avalonia.StyledProperty<string> PasswordProperty
PrintServiceProperty Field
Defines the Avalonia.Controls.PdfViewer.PrintService property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Services.IPrintService> PrintServiceProperty
ReadOnlyClass Field
Avalonia.Controls.PdfViewer.IsReadOnly is true.
public string ReadOnlyClass
RedactionRemovesHiddenInformationProperty Field
Defines the Avalonia.Controls.PdfViewer.RedactionRemovesHiddenInformation property.
public Avalonia.StyledProperty<bool> RedactionRemovesHiddenInformationProperty
RespectDocumentPermissionsProperty Field
Defines the Avalonia.Controls.PdfViewer.RespectDocumentPermissions property.
public Avalonia.StyledProperty<bool> RespectDocumentPermissionsProperty
SearchMatchCaseProperty Field
Defines the Avalonia.Controls.PdfViewer.SearchMatchCase property.
public Avalonia.StyledProperty<bool> SearchMatchCaseProperty
SearchMatchWholeWordProperty Field
Defines the Avalonia.Controls.PdfViewer.SearchMatchWholeWord property.
public Avalonia.StyledProperty<bool> SearchMatchWholeWordProperty
SearchOpenClass Field
The condensed search field is open (only meaningful with Avalonia.Controls.PdfViewer.NarrowClass).
public string SearchOpenClass
SearchQueryProperty Field
Defines the Avalonia.Controls.PdfViewer.SearchQuery property.
public Avalonia.StyledProperty<string> SearchQueryProperty
SearchResultCountProperty Field
Defines the Avalonia.Controls.PdfViewer.SearchResultCount property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, int> SearchResultCountProperty
SearchResultsProperty Field
Defines the Avalonia.Controls.PdfViewer.SearchResults property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Pdf.Core.PdfSearchResult>> SearchResultsProperty
SelectedShapeTypeProperty Field
Defines the Avalonia.Controls.PdfViewer.SelectedShapeType property.
public Avalonia.StyledProperty<Avalonia.Controls.ShapeType> SelectedShapeTypeProperty
SelectedTextProperty Field
Defines the Avalonia.Controls.PdfViewer.SelectedText property.
public Avalonia.DirectProperty<Avalonia.Controls.PdfViewer, string> SelectedTextProperty
ShapeFillColorProperty Field
Defines the Avalonia.Controls.PdfViewer.ShapeFillColor property. Null means no fill.
public Avalonia.StyledProperty<Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>> ShapeFillColorProperty
ShapeSelectedClass Field
A shape annotation is selected for editing.
public string ShapeSelectedClass
ShapeStrokeColorProperty Field
Defines the Avalonia.Controls.PdfViewer.ShapeStrokeColor property. Null means no stroke.
public Avalonia.StyledProperty<Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>> ShapeStrokeColorProperty
ShapeStrokeWidthProperty Field
Defines the Avalonia.Controls.PdfViewer.ShapeStrokeWidth property.
public Avalonia.StyledProperty<float> ShapeStrokeWidthProperty
ShapeSubtypeModeProperty Field
Defines the Avalonia.Controls.PdfViewer.ShapeSubtypeMode property.
public Avalonia.StyledProperty<Avalonia.Controls.PdfShapeSubtypeMode> ShapeSubtypeModeProperty
ShareServiceProperty Field
Defines the Avalonia.Controls.PdfViewer.ShareService property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Services.IShareService> ShareServiceProperty
ShowBookmarkIndicatorsProperty Field
Defines the Avalonia.Controls.PdfViewer.ShowBookmarkIndicators property.
public Avalonia.StyledProperty<bool> ShowBookmarkIndicatorsProperty
SidebarModeProperty Field
Defines the Avalonia.Controls.PdfViewer.SidebarMode property.
public Avalonia.StyledProperty<Avalonia.Controls.SidebarMode> SidebarModeProperty
SidebarOpenClass Field
A sidebar pane is open (Avalonia.Controls.PdfViewer.SidebarMode is not None).
public string SidebarOpenClass
SidebarPlacementProperty Field
Defines the Avalonia.Controls.PdfViewer.SidebarPlacement property.
public Avalonia.StyledProperty<Avalonia.Controls.SidebarPlacement> SidebarPlacementProperty
SidebarSelectionBrushProperty Field
Defines the Avalonia.Controls.PdfViewer.SidebarSelectionBrush property.
public Avalonia.StyledProperty<Avalonia.Media.IBrush> SidebarSelectionBrushProperty
SidebarWidthProperty Field
Defines the Avalonia.Controls.PdfViewer.SidebarWidth property.
public Avalonia.StyledProperty<double> SidebarWidthProperty
SourceProperty Field
Defines the Avalonia.Controls.PdfViewer.Source property.
public Avalonia.StyledProperty<string> SourceProperty
SquigglyColorProperty Field
Defines the Avalonia.Controls.PdfViewer.SquigglyColor property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> SquigglyColorProperty
StampColorProperty Field
Defines the Avalonia.Controls.PdfViewer.StampColor property.
public Avalonia.StyledProperty<Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>> StampColorProperty
StampDateFormatProperty Field
Defines the Avalonia.Controls.PdfViewer.StampDateFormat property.
public Avalonia.StyledProperty<string> StampDateFormatProperty
StampLabelsProperty Field
Defines the Avalonia.Controls.PdfViewer.StampLabels property.
public Avalonia.StyledProperty<System.Collections.Generic.IReadOnlyList<string>> StampLabelsProperty
StampStyleProperty Field
Defines the Avalonia.Controls.PdfViewer.StampStyle property.
public Avalonia.StyledProperty<Avalonia.Controls.PdfStampStyle> StampStyleProperty
StrikeoutColorProperty Field
Defines the Avalonia.Controls.PdfViewer.StrikeoutColor property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> StrikeoutColorProperty
StringsProperty Field
Defines the Avalonia.Controls.PdfViewer.Strings property.
public Avalonia.StyledProperty<Avalonia.Controls.PdfViewerStrings> StringsProperty
TextAnnotationFillColorProperty Field
Defines the Avalonia.Controls.PdfViewer.TextAnnotationFillColor property. Null means no fill (default).
public Avalonia.StyledProperty<Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>> TextAnnotationFillColorProperty
TextAnnotationFontAttributesProperty Field
Defines the Avalonia.Controls.PdfViewer.TextAnnotationFontAttributes property.
public Avalonia.StyledProperty<Avalonia.Controls.FontAttributes> TextAnnotationFontAttributesProperty
TextAnnotationFontProperty Field
Defines the Avalonia.Controls.PdfViewer.TextAnnotationFont property.
public Avalonia.StyledProperty<string> TextAnnotationFontProperty
TextAnnotationFontSizeProperty Field
Defines the Avalonia.Controls.PdfViewer.TextAnnotationFontSize property.
public Avalonia.StyledProperty<float> TextAnnotationFontSizeProperty
TextAnnotationStrokeColorProperty Field
Defines the Avalonia.Controls.PdfViewer.TextAnnotationStrokeColor property. Null means no stroke (default).
public Avalonia.StyledProperty<Nullable<Avalonia.Controls.Pdf.Core.PdfAnnotationColor>> TextAnnotationStrokeColorProperty
TextAnnotationStrokeWidthProperty Field
Defines the Avalonia.Controls.PdfViewer.TextAnnotationStrokeWidth property.
public Avalonia.StyledProperty<float> TextAnnotationStrokeWidthProperty
TextAnnotationTextAlignProperty Field
Defines the Avalonia.Controls.PdfViewer.TextAnnotationTextAlign property.
public Avalonia.StyledProperty<Avalonia.Controls.TextAnnotationAlignment> TextAnnotationTextAlignProperty
TextAnnotationTextColorProperty Field
Defines the Avalonia.Controls.PdfViewer.TextAnnotationTextColor property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> TextAnnotationTextColorProperty
TextSelectedClass Field
Page text is selected.
public string TextSelectedClass
ToolbarLayoutModeProperty Field
Defines the Avalonia.Controls.PdfViewer.ToolbarLayoutMode property — the public knob for forcing the touch or desktop toolbar. Avalonia.Controls.PdfToolbarLayoutMode.Auto by default.
public Avalonia.StyledProperty<Avalonia.Controls.PdfToolbarLayoutMode> ToolbarLayoutModeProperty
UnderlineColorProperty Field
Defines the Avalonia.Controls.PdfViewer.UnderlineColor property.
public Avalonia.StyledProperty<Avalonia.Controls.Pdf.Core.PdfAnnotationColor> UnderlineColorProperty
ViewModeProperty Field
Defines the Avalonia.Controls.PdfViewer.ViewMode property.
public Avalonia.StyledProperty<Avalonia.Controls.PdfViewMode> ViewModeProperty
ZoomLevelProperty Field
Defines the Avalonia.Controls.PdfViewer.ZoomLevel property.
public Avalonia.StyledProperty<double> ZoomLevelProperty
ZoomModeProperty Field
Defines the Avalonia.Controls.PdfViewer.ZoomMode property.
public Avalonia.StyledProperty<Avalonia.Controls.PdfZoomMode> ZoomModeProperty
ZoomStepProperty Field
Defines the Avalonia.Controls.PdfViewer.ZoomStep property.
public Avalonia.StyledProperty<double> ZoomStepProperty
Events
| Name | Description |
|---|---|
| ActualThemeVariantChanged | Raised when the theme variant is changed on the element or an ancestor of the element. Inherited from StyledElement. |
| AnnotationAdded | Raised when an annotation is added to the document. |
| AnnotationError | Raised when an annotation operation fails — adding, editing or deleting an annotation. |
| AttachedToLogicalTree | Raised when the styled element is attached to a rooted logical tree. Inherited from StyledElement. |
| AttachedToVisualTree | Raised when the control is attached to a rooted visual tree. Inherited from Visual. |
| BookmarksChanged | Raised whenever the user bookmark set changes (added, removed, or reloaded on document load). |
| ContextCanceled | Occurs when the context input gesture continues into another gesture, to notify the element that the context flyout should not be opened. Inherited from InputElement. |
| ContextRequested | Occurs when the user has completed a context input gesture, such as a right-click. Inherited from InputElement. |
| DataContextChanged | Occurs when the Avalonia.StyledElement.DataContext property changes. Inherited from StyledElement. |
| DetachedFromLogicalTree | Raised when the styled element is detached from a rooted logical tree. Inherited from StyledElement. |
| DetachedFromVisualTree | Raised when the control is detached from a rooted visual tree. Inherited from Visual. |
| DocumentClosed | Raised when the current document is closed. |
| DocumentLoaded | Raised when a document is loaded. |
| DoubleTapped | Occurs when the user briefly contacts and releases twice on a single point, without significant movement. Inherited from InputElement. |
| EffectiveViewportChanged | Occurs when the element's effective viewport changes. Inherited from Layoutable. |
| GettingFocus | Occurs before the control receives focus. Inherited from InputElement. |
| GotFocus | Occurs when the control receives focus. Inherited from InputElement. |
| Holding | Occurs when the user makes a single contact, then maintains contact beyond a given time threshold without releasing or making another contact. Inherited from InputElement. |
| Initialized | Occurs when the styled element has finished initialization. Inherited from StyledElement. |
| KeyDown | Occurs when a key is pressed while the control has focus. Inherited from InputElement. |
| KeyUp | Occurs when a key is released while the control has focus. Inherited from InputElement. |
| LayoutUpdated | Occurs when a layout pass completes for the control. Inherited from Layoutable. |
| LinkClicked | Raised when a link is clicked. |
| Loaded | Occurs when the control has been fully constructed in the visual tree and both layout and render are complete. Inherited from Control. |
| LoadError | Raised when loading fails. |
| LosingFocus | Occurs before the control loses focus. Inherited from InputElement. |
| LostFocus | Occurs when the control loses focus. Inherited from InputElement. |
| OpenRequested | Raised when opening a document is requested (menu, Avalonia.Controls.PdfViewer.Open, Avalonia.Controls.PdfViewer.OpenAsync(System.Threading.CancellationToken) or Avalonia.Controls.PdfViewer.OpenCommand) before the built-in file picker is shown. Set Avalonia.Controls.PdfOpenRequestedEventArgs.Handled to open the document in the application. |
| PageChanged | Raised when Avalonia.Controls.PdfViewer.CurrentPage changes. |
| PageRendered | Raised after a page's bitmap has been rendered to the view. |
| Pinch | Occurs when the user moves two contact points closer together. Inherited from InputElement. |
| PinchEnded | Occurs when the user releases both contact points used in a pinch gesture. Inherited from InputElement. |
| PointerCaptureLost | Occurs when the control or its child control loses the pointer capture for any reason, event will not be triggered for a parent control if capture was transferred to another child of that parent control. Inherited from InputElement. |
| PointerEntered | Occurs when the pointer enters the control. Inherited from InputElement. |
| PointerExited | Occurs when the pointer leaves the control. Inherited from InputElement. |
| PointerMoved | Occurs when the pointer moves over the control. Inherited from InputElement. |
| PointerPressed | Occurs when the pointer is pressed over the control. Inherited from InputElement. |
| PointerReleased | Occurs when the pointer is released over the control. Inherited from InputElement. |
| PointerTouchPadGestureMagnify | Occurs when the user moves two contact points away from each other on a touchpad. Inherited from InputElement. |
| PointerTouchPadGestureRotate | Occurs when the user places two contact points and moves them in a circular motion on a touchpad. Inherited from InputElement. |
| PointerTouchPadGestureSwipe | Occurs when the user performs a rapid dragging motion in a single direction on a touchpad. Inherited from InputElement. |
| PointerWheelChanged | Occurs when the mouse is scrolled over the control. Inherited from InputElement. |
| PrintRequested | Raised when printing is requested (menu, Avalonia.Controls.PdfViewer.Print, Avalonia.Controls.PdfViewer.PrintAsync(Avalonia.Controls.Pdf.Services.PrintOptions,System.Threading.CancellationToken) or Avalonia.Controls.PdfViewer.PrintCommand) before the built-in print service runs. Set Avalonia.Controls.PdfPrintRequestedEventArgs.Handled to print in the application instead. |
| PropertyChanged | Raised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject. |
| PullGesture | Occurs when the user drags from the edge of a control. Inherited from InputElement. |
| PullGestureEnded | Occurs when the user releases the pointer after a pull gesture. Inherited from InputElement. |
| ResourcesChanged | Occurs when a resource in this styled element or a parent styled element has changed. Inherited from StyledElement. |
| RightTapped | Occurs when the user briefly contacts and releases a single point, without significant movement, using a mechanism on the input device recognized as a right button or equivalent. Inherited from InputElement. |
| SaveAsRequested | Raised when Save As is requested (menu, Avalonia.Controls.PdfViewer.SaveAs, Avalonia.Controls.PdfViewer.SaveAsAsync(System.Threading.CancellationToken) or Avalonia.Controls.PdfViewer.SaveAsCommand) before the built-in save picker is shown. Set Avalonia.Controls.PdfSaveAsRequestedEventArgs.Handled to write the document in the application. |
| ScrollGesture | Occurs when the user continuously moves the pointer in the same direction within the control’s boundaries. Inherited from InputElement. |
| ScrollGestureEnded | Occurs when a scroll gesture has fully stopped, taking into account any inertial movement that continues the scroll after the user has released the pointer. Inherited from InputElement. |
| ScrollGestureInertiaStarting | Occurs within a scroll gesture, when the user releases the pointer, and scrolling continues by transitioning to momentum-based gliding movement. Inherited from InputElement. |
| SearchCompleted | Raised when a search completes (including programmatic Avalonia.Controls.PdfViewer.SearchAsync(string,Avalonia.Controls.Pdf.Core.SearchOptions)). |
| ShareRequested | Raised when sharing is requested (menu, Avalonia.Controls.PdfViewer.Share, Avalonia.Controls.PdfViewer.ShareAsync(Avalonia.Controls.Pdf.Services.ShareOptions,System.Threading.CancellationToken) or Avalonia.Controls.PdfViewer.ShareCommand) before the built-in share service runs. Set Avalonia.Controls.PdfShareRequestedEventArgs.Handled to share in the application instead. |
| SizeChanged | Occurs when the bounds (actual size) of the control have changed. Inherited from Control. |
| SwipeGesture | Occurs when the user rapidly drags the pointer in a single direction across the control. Inherited from InputElement. |
| SwipeGestureEnded | Occurs when a swipe gesture ends on the control. Inherited from InputElement. |
| Tapped | Occurs when the user briefly contacts and releases a single point, without significant movement. Inherited from InputElement. |
| TemplateApplied | Raised when the control's template is applied. Inherited from TemplatedControl. |
| TextInput | Occurs when a user typed some text while the control has focus. Inherited from InputElement. |
| TextInputMethodClientRequested | Occurs when an input element gains input focus and input method is looking for the corresponding client Inherited from InputElement. |
| UndoRedoStateChanged | Raised whenever Avalonia.Controls.PdfViewer.CanUndo or Avalonia.Controls.PdfViewer.CanRedo changes. |
| Unloaded | Occurs when the control is removed from the visual tree. Inherited from Control. |
| ZoomChanged | Raised when Avalonia.Controls.PdfViewer.ZoomLevel changes. |
AnnotationAdded Event
Raised when an annotation is added to the document.
public event EventHandler<Avalonia.Controls.Pdf.Core.PdfAnnotationEventArgs> AnnotationAdded
AnnotationError Event
Raised when an annotation operation fails — adding, editing or deleting an annotation.
public event EventHandler<Avalonia.Controls.PdfAnnotationErrorEventArgs> AnnotationError
Remarks
The user has already acted by the time this fires (drawn a shape, pressed Delete), so a failure is silent from their point of view unless the host surfaces it. The message is also written to Avalonia.Controls.PdfViewer.ErrorMessage, so binding that is enough for simple hosts; handle this event when you need the Avalonia.Controls.PdfAnnotationErrorEventArgs.Operation or the underlying exception.
BookmarksChanged Event
Raised whenever the user bookmark set changes (added, removed, or reloaded on document load).
public event EventHandler BookmarksChanged
DocumentClosed Event
Raised when the current document is closed.
public event EventHandler DocumentClosed
DocumentLoaded Event
Raised when a document is loaded.
public event EventHandler<Avalonia.Controls.PdfDocumentLoadedEventArgs> DocumentLoaded
LinkClicked Event
Raised when a link is clicked.
public event EventHandler<Avalonia.Controls.PdfLinkClickedEventArgs> LinkClicked
LoadError Event
Raised when loading fails.
public event EventHandler<Avalonia.Controls.PdfLoadErrorEventArgs> LoadError
OpenRequested Event
Raised when opening a document is requested (menu, Avalonia.Controls.PdfViewer.Open, Avalonia.Controls.PdfViewer.OpenAsync(System.Threading.CancellationToken) or Avalonia.Controls.PdfViewer.OpenCommand) before the built-in file picker is shown. Set Avalonia.Controls.PdfOpenRequestedEventArgs.Handled to open the document in the application.
public event EventHandler<Avalonia.Controls.PdfOpenRequestedEventArgs> OpenRequested
PageChanged Event
Raised when Avalonia.Controls.PdfViewer.CurrentPage changes.
public event EventHandler<Avalonia.Controls.PdfPageChangedEventArgs> PageChanged
PageRendered Event
Raised after a page's bitmap has been rendered to the view.
public event EventHandler<Avalonia.Controls.PdfPageRenderedEventArgs> PageRendered
PrintRequested Event
Raised when printing is requested (menu, Avalonia.Controls.PdfViewer.Print, Avalonia.Controls.PdfViewer.PrintAsync(Avalonia.Controls.Pdf.Services.PrintOptions,System.Threading.CancellationToken) or Avalonia.Controls.PdfViewer.PrintCommand) before the built-in print service runs. Set Avalonia.Controls.PdfPrintRequestedEventArgs.Handled to print in the application instead.
public event EventHandler<Avalonia.Controls.PdfPrintRequestedEventArgs> PrintRequested
SaveAsRequested Event
Raised when Save As is requested (menu, Avalonia.Controls.PdfViewer.SaveAs, Avalonia.Controls.PdfViewer.SaveAsAsync(System.Threading.CancellationToken) or Avalonia.Controls.PdfViewer.SaveAsCommand) before the built-in save picker is shown. Set Avalonia.Controls.PdfSaveAsRequestedEventArgs.Handled to write the document in the application.
public event EventHandler<Avalonia.Controls.PdfSaveAsRequestedEventArgs> SaveAsRequested
SearchCompleted Event
Raised when a search completes (including programmatic Avalonia.Controls.PdfViewer.SearchAsync(string,Avalonia.Controls.Pdf.Core.SearchOptions)).
public event EventHandler<Avalonia.Controls.PdfSearchCompletedEventArgs> SearchCompleted
ShareRequested Event
Raised when sharing is requested (menu, Avalonia.Controls.PdfViewer.Share, Avalonia.Controls.PdfViewer.ShareAsync(Avalonia.Controls.Pdf.Services.ShareOptions,System.Threading.CancellationToken) or Avalonia.Controls.PdfViewer.ShareCommand) before the built-in share service runs. Set Avalonia.Controls.PdfShareRequestedEventArgs.Handled to share in the application instead.
public event EventHandler<Avalonia.Controls.PdfShareRequestedEventArgs> ShareRequested
UndoRedoStateChanged Event
Raised whenever Avalonia.Controls.PdfViewer.CanUndo or Avalonia.Controls.PdfViewer.CanRedo changes.
public event EventHandler UndoRedoStateChanged
ZoomChanged Event
Raised when Avalonia.Controls.PdfViewer.ZoomLevel changes.
public event EventHandler<Avalonia.Controls.PdfZoomChangedEventArgs> ZoomChanged