Blazorise PdfViewer: API Reference
Explore the API reference for the Blazorise PdfViewer component, detailing available attributes and methods.
All media elements exist inside the Video component. This component's main responsibilities are to manage media state updates, dispatch media events, handle media requests, and expose media state through HTML attributes and CSS properties for styling purposes.
API
Parameters
PdfViewer
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Defines the content to be rendered inside the component. RemarksThis property allows developers to define custom content within the PDF viewer component. |
RenderFragment | null |
DownloadFileName |
Specifies an explicit filename used when downloading the PDF document. If not provided, the filename is resolved from PDF metadata title or source. |
string | |
DownloadFileNamePromptOptions |
Defines options for customizing the default modal download filename prompt. |
PdfDownloadFileNamePromptOptions | new() |
Orientation |
Specifies the orientation of the PDF document. The default value is Portrait. Possible values: |
PdfOrientation | PdfOrientation.Portrait |
PageNumber |
Specifies the current page number of the PDF document. The default value is |
int | 1 |
PasswordPromptOptions |
Defines options for customizing the default modal password prompt. |
PdfPasswordPromptOptions | new() |
Scale |
Specifies the scale factor for displaying the PDF document. The default value is |
double | 1 |
Source |
Specifies the source URL or base64 formated string of the PDF document to be loaded. |
string | |
UseModalDownloadFileNamePrompt |
Determines whether the default modal prompt should be used when DownloadFileNameRequested is not provided. |
bool | false |
UseModalPasswordPrompt |
Determines whether the default modal prompt should be used when PasswordRequested is not provided. |
bool | true |
PdfViewerContainer
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Defines the content to be rendered inside the component. RemarksThis property allows developers to define custom content within the PDF container component. |
RenderFragment | null |
PdfViewerToolbar
| Parameter | Description | Type | Default |
|---|---|---|---|
ShowDownloading |
Specifies if the download button should be displayed. |
bool | true |
ShowPaging |
Specifies if the paging buttons should be displayed. |
bool | true |
ShowPrinting |
Specifies if the print button should be displayed. |
bool | true |
ShowZooming |
Specifies if the zoom buttons should be displayed. |
bool | true |
Events
PdfViewer
| Event | Description | Type |
|---|---|---|
DownloadCanceled |
Notifies when the download filename request is canceled. |
EventCallback |
DownloadFileNameRequested |
Provides a callback when a download filename is requested. If not set, the default modal prompt is used when UseModalDownloadFileNamePrompt is enabled. |
Func<PdfDownloadFileNameRequestedEventArgs, Task<string>> |
DownloadRequested |
Notifies when downloading is requested for the PDF document. |
EventCallback |
Loaded |
Notifies when the PDF document finishes loading. |
EventCallback<PdfLoadedEventArgs> |
PageNumberChanged |
Notifies when the current page number changes. |
EventCallback<int> |
PasswordCanceled |
Notifies when the password request is canceled. |
EventCallback |
PasswordRequested |
Provides a callback when a password is required to open a protected PDF document. If not set, a default modal prompt is shown when UseModalPasswordPrompt is enabled. |
Func<PdfPasswordRequestedEventArgs, Task<string>> |
PrintRequested |
Notifies when printing is requested for the PDF document. |
EventCallback |
ScaleChanged |
Notifies when the zoom scale changes. |
EventCallback<double> |
Methods
PdfViewer
| Method | Description | Return | Parameters |
|---|---|---|---|
Download |
Downloads the currently loaded PDF document. | Task | |
GoToPage |
Navigates to the specified page number in the PDF document. | Task | int pageNumber |
NextPage |
Navigates to the next page of the PDF document. | Task | |
NotifyPdfChanged |
Notifies that the page number of the PDF document has changed. | Task | PdfModel model |
NotifyPdfInitialized |
Notifies that a PDF document has been loaded. | Task | PdfModel model |
PreviousPage |
Navigates to the previous page of the PDF document. | Task | |
Print |
Prints the currently loaded PDF document. | Task | |
RequestPdfPassword |
Requests the password needed to open a protected PDF document. | Task<string> | PdfPasswordRequestModel model |
SetScale |
Sets the scale factor for displaying the PDF document. | Task | double scale |