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 TypeDefault
ChildContent

Defines the content to be rendered inside the component.

Remarks

This property allows developers to define custom content within the PDF viewer component.

RenderFragmentnull
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.

PdfDownloadFileNamePromptOptionsnew()
Mode

Specifies how PDF pages are displayed. The default value is SinglePage.

Possible values:SinglePage, Continuous

PdfViewerModePdfViewerMode.SinglePage
Orientation

Specifies the orientation of the PDF document. The default value is Portrait.

Possible values:Portrait, Landscape

PdfOrientationPdfOrientation.Portrait
PageNumber

Specifies the current page number of the PDF document. The default value is 1.

int1
PasswordPromptOptions

Defines options for customizing the default modal password prompt.

PdfPasswordPromptOptionsnew()
Scale

Specifies the scale factor for displaying the PDF document. The default value is 1, which represents the original size.

double1
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.

boolfalse
UseModalPasswordPrompt

Determines whether the default modal prompt should be used when PasswordRequested is not provided.

booltrue

PdfViewerContainer

Parameter Description TypeDefault
ChildContent

Defines the content to be rendered inside the component.

Remarks

This property allows developers to define custom content within the PDF container component.

RenderFragmentnull

PdfViewerToolbar

Parameter Description TypeDefault
ShowDownloading

Specifies if the download button should be displayed.

booltrue
ShowPaging

Specifies if the paging buttons should be displayed.

booltrue
ShowPrinting

Specifies if the print button should be displayed.

booltrue
ShowZooming

Specifies if the zoom buttons should be displayed.

booltrue

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 DescriptionReturnParameters
Download Downloads the currently loaded PDF document. Task
GoToPage Navigates to the specified page number in the PDF document. Taskint 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. Taskdouble scale
On this page