Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxPdfViewer.IsSinglePagePreview Property

Specifies whether to display one or multiple pages in a preview.

Namespace: DevExpress.Blazor.PdfViewer

Assembly: DevExpress.Blazor.PdfViewer.v24.2.dll

NuGet Package: DevExpress.Blazor.PdfViewer

#Declaration

C#
[DefaultValue(false)]
[Parameter]
public bool IsSinglePagePreview { get; set; }

#Property Value

Type Default Description
Boolean false

true to display one page in a preview; otherwise, false.

#Remarks

If your PDF document contains multiple pages, <PdfViewer> displays all those pages in a preview.

PDF Viewer - Multiple Page Preview

To preview one page at a time, enable the IsSinglePagePreview property:

PDF Viewer - Single Page Preview

Razor
@using System.Reflection

<DxPdfViewer @ref="pdfViewer"
             DocumentContent="@DocumentContent"
             IsSinglePagePreview="true" />

@code {
    DxPdfViewer pdfViewer { get; set; }
    byte[] DocumentContent { get; set; }

    protected override async Task OnInitializedAsync() {
        Assembly assembly = Assembly.GetExecutingAssembly();
        Stream stream = assembly.GetManifestResourceStream("Pdf.DataSources.Document.pdf");

        using (var binaryReader = new BinaryReader(stream)) {
            DocumentContent = binaryReader.ReadBytes((int)stream.Length);
        }
    }
}
See Also