blazor-devexpress-dot-blazor-dot-pdfviewer-dot-dxpdfviewer-dafae84f.md
Specifies the name of the downloaded file.
Namespace : DevExpress.Blazor.PdfViewer
Assembly : DevExpress.Blazor.PdfViewer.v25.2.dll
NuGet Package : DevExpress.Blazor.PdfViewer
[DefaultValue("Document")]
[Parameter]
public string DocumentName { get; set; }
| Type | Default | Description |
|---|---|---|
| String | "Document" |
The name of the downloaded file.
|
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.
@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