I have this code but the pdf stopped being displayed after version 19.3.0.43, until it all worked, did something change in 19.3.0.44?
@inject IConfiguration Configuration
<SfPdfViewer Width="100%" Height="100%" @ref="@PDF" DocumentPath=@DocumentPath
ServiceUrl=@Configuration["PdfUrl"]></SfPdfViewer>
@code{
//PARAMETROS
[Parameter]
public string ReportPath { get; set; } = "";
public byte[] byteArray { get; set; } = new byte[0];
public string base64String { get; set; } = "";
public string DocumentPath { get; set; } = "";
private SfPdfViewer PDF = new SfPdfViewer();
protected override void OnInitialized()
{
if(!string.IsNullOrEmpty(ReportPath))
{
byteArray = System.IO.File.ReadAllBytes(ReportPath);
base64String = Convert.ToBase64String(byteArray);
DocumentPath = "data:application/pdf;base64," + ReportPath;
}
}
}
Hi Fernando,
We were unable to reproduce the reported issue in the latest NuGet package(v20.3.0.47). Kindly upgrade the NuGet package and the script version to the latest version to get the reported issue resolved. These versions must be the same. Kindly try upgrading and get back to us if the issue still exists.
Package:
Blazor Client : https://www.nuget.org/packages/Syncfusion.Blazor.PdfViewer/
Blazor Sever: https://www.nuget.org/packages/Syncfusion.Blazor.PdfViewerServer.Windows
CDN:
https://cdn.syncfusion.com/blazor/20.3.47/styles/bootstrap5.css
https://cdn.syncfusion.com/blazor/20.3.47/syncfusion-blazor-pdfviewer.min.js
Regards,
Sinthiya K
The problem persists.
Hi Fernando,
The provided details are not enough to investigate. Kindly share more details of the reported issue and the sample. This will be helpful to investigate further and provide the solution at the earliest.
Regards,
Sinthiya K
I set up the example, it stops loading the component itself and gives an error in the latest version, in version 19.3.0.43 it can open normally. Just update the Nuget package version and see the difference in execution.
Click on the PDF menu.
Hi Fernando,
We were unable to reproduce the reported issue with the provided
details. We have shared the sample in which we have tried to reproduce the
issue in the below link,
Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/LOAD_Sample-2041420385.zip
Kindly try this and revert to us with a modified sample about the reported issue if you have any concerns. This will be helpful for us to analyze further and provide the details.
Visvesvar K V
If I leave only the Windows package of the PDF it works, but as I need it in another project with other components it shows an error "The call is ambiguous between the following methods or properties" in Program.cs
Removing the Nuget package and leaving only the PDF one works but doesn't solve my project.
Hi Fernando,
Kindly use Syncfusion.Blazor.PdfViewer project instead of Syncfusion.Blazor project and then you can add each single component package to your project. This will resolve your issue. Kindly try as we mentioned.
If You still face any issues Kindly revert to us.
Regards,
Visvesvar K V
I tested it worked but I need there is an error in the SfPdfViewer, the SfPdfViewerServer works normally, follows an example project which does not open the PDF and breaks the navigation, it gives an error who interrupts the navigation.
The project is ServerApp in WebAssembly seems to work normally.
Hi Fernando,
Kindly use Syncfusion.Blazor.pdfviewerserver.windows instead of syncfusion.blazor for Wasm project and use <SfPdfViewerServer> tag for it.
We have also referred to the script in Layout. cs HTML file.
<script src="_content/Syncfusion.Blazor.PdfViewer/scripts/syncfusion-blazor-pdfviewer.min.js" type="text/javascript"></script>
We have also added dependency on imports. Razor -
@using Syncfusion.Blazor.PdfViewerServer
We have also shared the modified sample.
Kindly find the sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/PDFViewerSample_913a970e1288957794.zip
Regards,
Visvesvar K V
Good Morning.
I understand how both components work, but I have an application where the syncfusion.blazor package was used, this application has several other components that we developed that use syncfusion.blazor, if I use synfucion.blazor.pdfviewerserver.windows I will have a problem of ambiguity and I will have to remove the entire syncfusion.blazor package from everything and use the segmented syncfusion packages. in the syncfusion documentation it is indicating that the syncfusion.blazor package for both serverside, by webassembly, as I sent in the syncb application example itself. from the syncfusion.pdfviewerserver.* package works in both webassembly and serverside.
We have a scheduled change in our application where we will remove syncfusion.blazor from everything and switch to the syncfusion.blazor.* packages but our application does not do this at this time.
Do you understand my problem?
Hi Fernando,
Kindly use individual Syncfusion NuGet packages for your components. We don’t have support to use Syncfusion.Blazor package along with Syncfusion.Blazor.PdfViewerServer.Windows.
Regards,
Visvesvar K V
Ok, thanks!