Hi. I want to use the multi-format-viewer demo in my project. I have a section that shows a preloaded document:
Of which when I press "View License" i have a pop up dialog on which I wish to display the license. How do I download or read this preloaded file from my desktop?
<!--License Upload-->
<RadzenRow>
<RadzenFormField Text="License Uploader" Style="background-color:#ebeef1;width: 100%;">
<ChildContent>
<SfUploader ID="UploadFiles" @ref="UploadObj" ShowProgressBar="true" AutoUpload="true"
AllowMultiple="false" CssClass="e-primary">
<UploaderButtons Browse="Select Driver's License"></UploaderButtons>
<UploaderEvents BeforeUpload="BeforeUpload" OnActionComplete="OnCom" Success="OnSuccess" ValueChange="OnChange"></UploaderEvents>
@if (driver.UploadedLicense)
{
<UploaderFiles>
<UploaderUploadedFiles Name="@driver.LicenseFile.Name" Size="@driver.LicenseFile.Size" Type="@driver.LicenseFile.Format"></UploaderUploadedFiles>
</UploaderFiles>
}
</SfUploader>
</ChildContent>
<Helper>
<RadzenText TextStyle="TextStyle.Caption">* Document will be saved with as '@driver.Id'</RadzenText>
</Helper>
</RadzenFormField>
</RadzenRow>
@if (driver.UploadedLicense)
{
<!-- View Doc -->
<RadzenButton Click="@((args) => {LicenseDialogVisibility = true; ViewLicenseFile();})" Variant="Radzen.Variant.Filled" Shade="Shade.Dark" Icon="view" Text="View License" ButtonStyle="ButtonStyle.Dark" />
}
<!--View License dialog-->
<SfDialog Width="683px" Height="100%" ShowCloseIcon="false" IsModal="true" CloseOnEscape="true"
@bind-Visible="@LicenseDialogVisibility">
<DialogTemplates>
<Content>
<RadzenStack Style="height: 100%;">
<!-- View Doc -->
<SfPdfViewer2 @ref="viewer" ID="pdfviewer" Height="100%" Width="100%">
<PdfViewerToolbarSettings ToolbarItems="@ToolbarItems"></PdfViewerToolbarSettings>
</SfPdfViewer2>
<!--Close-->
<RadzenButton Click="@((args) => LicenseDialogVisibility = false)" Variant="Radzen.Variant.Filled" Shade="Shade.Dark" Icon="close" Text="Close" ButtonStyle="ButtonStyle.Dark" />
</RadzenStack>
</Content>
</DialogTemplates>
</SfDialog>
Hi À la mode Clothing Outlet,
Thank you for
contacting us. We have created a sample that demonstrates loading different
file types from root locations. Using this sample, you can view the opened
files, make modifications, and save the changes using the download option
available in the toolbar. For your reference, we have included the sample and a
demo below.
Sample
loading multiformat file
Demo
loading multiformat file
Regards,
Sathiyaseelan K
Thank you for your reply. I noticed that it does not work inside a syncfusion popup dialog. Why is that?
Hi À la mode Clothing Outlet,
Thank you for the
update. Similarly, we have prepared a sample where the PDF viewer component is
opened inside a dialog box, but the issue did not occur. Please review the
sample provided below and confirm if the issue persists. Additionally, if you
encounter any errors, kindly share the console error details, a demo video of
the issue, and a sample for further investigation.
Sample
with dialog
Regards,
Sathiyaseelan K