Blazorise PdfViewer: API Reference
Explore the Blazorise PdfViewer API reference for documents, navigation events, toolbar components, and methods.
The PdfViewer API covers document loading, page navigation, zooming, toolbar customization, and programmatic viewer control.
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() |
Mode |
Specifies how PDF pages are displayed. The default value is SinglePage. Possible values: |
PdfViewerMode | PdfViewerMode.SinglePage |
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 | |
PreviousPage |
Navigates to the previous page of the PDF document. | Task | |
Print |
Prints the currently loaded PDF document. | Task | |
SetScale |
Sets the scale factor for displaying the PDF document. | Task | double scale |