Perform print in same window in Blazor SfPdfViewer Component

25 Aug 20251 minute to read

The PrintMode enum of SfPdfViewer2 allows you to decide whether to print in the same window or in a new window. The available enum values are PrintMode.Default and PrintMode.NewWindow.

  • Default - If you set PrintMode.Default, printing will occur in the same window.
  • NewWindow - If you set PrintMode.NewWindow, printing will open in a new window.
@using Syncfusion.Blazor.SfPdfViewer

<SfPdfViewer2 PrintMode="PrintMode.Default"
              DocumentPath="@DocumentPath"
              Height="100%"
              Width="100%"></SfPdfViewer2>

@code {
    private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf";
}

In the provided code, PrintMode.Default is used to specify printing in the same window.

See also