# pdf-viewer-default

> PDF Viewer renders a document in a fixed-height viewer for browsing PDF content with the standard viewer interface.

**Framework:** blazor  **Component:** PdfViewer  **Variant:** default

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/blazor/pdf-viewer-default.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.Blazor.PdfViewer
```

**Notes**

- Syncfusion release: 2026 Volume 2 (v34.1.29)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/pdf-viewer-default/PdfViewer.razor

```razor
@page "/default"
@using Syncfusion.Blazor.SfPdfViewer

<div class="control-section">  
    <div class="pdf-viewer-shell @(pdfReady ? "visible" : "")">
            <SfPdfViewer2 Height="640px"
                          Width="100%"
                          DocumentPath="@DocumentPath">
                <PdfViewerEvents DocumentLoaded="OnPdfLoaded" />           
            </SfPdfViewer2>
    </div>
</div>
@code {
    private string DocumentPath { get; set; } = string.Empty;
    private bool pdfReady = false;
    SfPdfViewer2 viewer2;
    private bool isSpinnerVisible = true;
    protected override void OnInitialized()
    {
        //Sets the PDF document path for initial loading.
        DocumentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
    }
    private void OnPdfLoaded()
    {
        isSpinnerVisible = false;
        pdfReady = true;
    }
}
```
