For the following, only PageChanged is invoked by PDF Viewer. DocumentLoaded is not invoked when the document loads and ZoomChanged is not invoked when the zoom is changed.
<SfPdfViewerServer @ref="PdfViewer" Height="700px" Width="100%"> <PdfViewerEvents DocumentLoaded="@DocumentLoaded" /> <PdfViewerEvents ZoomChanged="@ZoomChangeEvent" /> <PdfViewerEvents PageChanged="@PageChangeEvent" /> </SfPdfViewerServer> @code { public void DocumentLoaded(LoadEventArgs value) { string name; name = value.DocumentName; } public void ZoomChangeEvent(ZoomChangeEventArgs value) { int zoom; zoom = value.CurrentZoomValue; } public void PageChangeEvent(PageChangeEventArgs value) { int page; page = value.CurrentPageNumber; } }
For the following, ZoomChanged and PageChanged do not get invoked if the zoom or page are changed.
<SfPdfViewerServer @ref="PdfViewer" Height="700px" Width="100%"
ZoomValueChanged="@ZoomChanged" CurrentPageNumberChanged="@PageChanged"> </SfPdfViewerServer> @code { public void ZoomChanged(int value) { int zoom; zoom = value; } public void PageChanged(int value) { int page; page = value; } }
Please advise what needs to be done to get these to work.
Hi Dennis,
We are checking your query to reproduce the reported issues. We will update the details on April 26, 2022.
Regards,
Shamini
Hi Dennis,
|
Query |
Response |
|
For the following, only PageChanged is invoked by PDF Viewer. DocumentLoaded is not invoked when the document loads and ZoomChanged is not invoked when the zoom is changed. |
We were able to reproduce the issue “DocumentLoaded and ZoomChanged events are not working in 20.x versions”. We will validate the issue and update further details on April 28, 2022. |
|
For the following, ZoomChanged and PageChanged do not get invoked if the zoom or page are changed. |
Instead of event callbacks, we suggest using the ZoomChanged and PageChanged events with which you can get the current zoom value (once when the above issue is resolved) and the current page number respectively. |
Regards,
Shamini
Hi Dennis,
We have improved the PDF Viewer component architecture from the 2022 Volume 1 release. So we need to invoke all the PDF Viewer events in a single tag. We suggest you invoke the multiple events in a single events tag instead of the multiple events tags. Please find the code snippet below.
Code snippet:
|
<PdfViewerEvents DocumentLoaded="@DocumentLoaded" ZoomChanged="@ZoomChangeEvent" PageChanged="@PageChangeEvent" /> |
Regards,
Shamini
Hi Shamini,
Thanks for the fix. What is the version number for 2022 Volume 1 release?
Thanks,
Dennis
Hi Dennis,
The version number for the 2022 Volume 1 release is v20.1.0.47.
Packages link:
|
Blazor Client |
|
|
Blazor Sever |
https://www.nuget.org/packages/Syncfusion.Blazor.PdfViewerServer.Windows |
CDN: https://cdn.syncfusion.com/blazor/20.1.47/styles/bootstrap5.css
https://cdn.syncfusion.com/blazor/20.1.47/syncfusion-blazor-pdfviewer.min.js
Regards,
Shamini
Hi Shamini,
Thanks for confirming. I think I may have misunderstood earlier that the issue was fixed in 2022 Volume 1. Based on the version number, I was already using a later version.
Am I correct to think understand the following issue has not been fixed yet? “DocumentLoaded and ZoomChanged events are not working in 20.x versions”
Regards,
Dennis
Hi Dennis,
As mentioned in our earlier update, we have improved the PDF Viewer component architecture from the 2022 Volume 1 release (i.e., 20.x versions). Hence, it is not an issue but the usage level change and we suggest invoking the multiple events in a single event tag instead of the multiple events tags as below to resolve the reported issue.
|
<PdfViewerEvents DocumentLoaded="@DocumentLoaded" ZoomChanged="@ZoomChangeEvent" PageChanged="@PageChangeEvent" /> |
Regards,
Shamini
Hi Shamini,
I confirm when adding a single PdfViewerEvents as you showed, it work.
Regards,
Dennis
Hi Dennis,
Thanks for the update.
Regards,
Shamini