Back to Devexpress

DxPdfViewer.DocumentName Property

blazor-devexpress-dot-blazor-dot-pdfviewer-dot-dxpdfviewer-dafae84f.md

latest1.6 KB
Original Source

DxPdfViewer.DocumentName Property

Specifies the name of the downloaded file.

Namespace : DevExpress.Blazor.PdfViewer

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

NuGet Package : DevExpress.Blazor.PdfViewer

Declaration

csharp
[DefaultValue("Document")]
[Parameter]
public string DocumentName { get; set; }

Property Value

TypeDefaultDescription
String"Document"

The name of the downloaded file.

|

Remarks

Use the DocumentName property to specify the name of the downloaded document.

Note

Do not include the file extension in the name – the component automatically downloads files in PDF format.

razor
@rendermode InteractiveServer
@using System.Reflection

<DxPdfViewer DocumentContent="@DocumentContent"
             DocumentName="Custom name" />

@code {
    byte[] DocumentContent { get; set; }
    protected override void OnInitialized() {
        Assembly assembly = Assembly.GetExecutingAssembly();
        using (Stream stream = assembly.GetManifestResourceStream("Pdf.DataSources.Document.pdf"))
        using (var binaryReader = new BinaryReader(stream))
            DocumentContent = binaryReader.ReadBytes((int)stream.Length);
    }
}

See Also

DxPdfViewer Class

DxPdfViewer Members

DevExpress.Blazor.PdfViewer Namespace