PdfViewer

This documentation provides a comprehensive reference for the PdfViewer component, guiding you through its configuration options.
Demos

Screenshot #

Blazor PdfViewer Component

Parameters #

Name Type Default Required Description Added Version
AdditionalAttributes Dictionary<string, object>? null Gets or sets additional attributes that will be applied to the component. 1.0.0
Class string? null Gets or sets the CSS class name(s) to apply to the component. 1.0.0
Id string? null Gets or sets the ID. If not set, a unique ID will be generated. 1.0.0
Orientation Orientation Portrait Gets or sets the preferred orientation for the PDF viewer. 2.1.0
Password string? null Gets or sets the password used for the PDF document if it is password-protected. 3.5.0
Style string? null Gets or sets the CSS style string that defines the inline styles for the component. 1.0.0
Url string? null Gets or sets the URL of the PDF document to be displayed. PDF Viewer component supports base64 string as a URL. 1.11.0

Methods #

Name Return type Description Added Version
SetZoomPercentageAsync(PdfViewerZoomPercentage zoomPercentage) Task Asynchronously sets the zoom level of the PDF viewer to the specified percentage. 4.0.0

Events #

Name Return Type Description Added Version
OnDocumentLoaded EventCallback<PdfViewerEventArgs> This event fires immediately after the PDF document is loaded. 1.0.0
OnDocumentLoadError EventCallback<string> This event fires if there is an error loading the PDF document. 1.11.0
OnPageChanged EventCallback<PdfViewerEventArgs> This event fires immediately after the page is changed. 1.11.0

PdfViewerZoomPercentage Enum #

Name Value Description Added Version
x25Percent 1 Zoom to 25%. 4.0.0
x33Percent 2 Zoom to 33%. 4.0.0
x50Percent 3 Zoom to 50%. 4.0.0
x67Percent 4 Zoom to 67%. 4.0.0
x75Percent 5 Zoom to 75%. 4.0.0
x80Percent 6 Zoom to 80%. 4.0.0
x90Percent 7 Zoom to 90%. 4.0.0
x100Percent 8 Zoom to 100%. 4.0.0
x110Percent 9 Zoom to 110%. 4.0.0
x125Percent 10 Zoom to 125%. 4.0.0
x150Percent 11 Zoom to 150%. 4.0.0
x175Percent 12 Zoom to 175%. 4.0.0
x200Percent 13 Zoom to 200%. 4.0.0
x250Percent 14 Zoom to 250%. 4.0.0
x300Percent 15 Zoom to 300%. 4.0.0
x400Percent 16 Zoom to 400%. 4.0.0
x500Percent 17 Zoom to 500%. 4.0.0

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.